| Commit message (Expand) | Author | Age | Files | Lines |
| * | git: update to v2.32.0•••Update to git version v2.32.0, this requires changes for these
upstream commits:
* 47957485b3b731a7860e0554d2bd12c0dce1c75a
tree.h API: simplify read_tree_recursive() signature
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2021-06-08 | 1 | -4/+3 |
| * | global: replace references to 'sha1' with 'oid'•••For some time now sha1 is considered broken and upstream is working to
replace it with sha256. Replace all references to 'sha1' with 'oid',
just as upstream does.
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2020-10-20 | 1 | -3/+3 |
| * | global: use proper accessors for maybe_tree•••A previous commit changed ->tree to ->maybe_tree throughout, which may
have worked at the time, but wasn't safe, because maybe_tree is loaded
lazily. This manifested itself in crashes when using the "follow" log
feature. The proper fix is to use the correct contextual accessors
everytime we want access to maybe_tree. Thankfully, the commit.cocci
script takes care of creating mostly-correct patches that we could then
fix up, resulting in this commit here.
Fixes: 255b78f ("git: update to v2.18.0")
Reviewed-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Jason A. Donenfeld | 2020-03-13 | 1 | -3/+4 |
| * | git: update to v2.21.0•••Update to git version v2.21.0. Required changes follow upstream commits:
* 6a7895fd8a3bd409f2b71ffc355d5142172cc2a0
(commit: prepare free_commit_buffer and release_commit_memory for
any repo)
* e092073d643b17c82d72cf692fbfaea9c9796f11
(tree.c: make read_tree*() take 'struct repository *')
Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
| Christian Hesse | 2019-06-05 | 1 | -1/+2 |
| * | git: update to v2.19.1•••Update to git version v2.19.1. Required changes follow upstream commits:
* commit: add repository argument to get_cached_commit_buffer
(3ce85f7e5a41116145179f0fae2ce6d86558d099)
* commit: add repository argument to lookup_commit_reference
(2122f6754c93be8f02bfb5704ed96c88fc9837a8)
* object: add repository argument to parse_object
(109cd76dd3467bd05f8d2145b857006649741d5c)
* tag: add repository argument to deref_tag
(a74093da5ed601a09fa158e5ba6f6f14c1142a3e)
* tag: add repository argument to lookup_tag
(ce71efb713f97f476a2d2ab541a0c73f684a5db3)
* tree: add repository argument to lookup_tree
(f86bcc7b2ce6cad68ba1a48a528e380c6126705e)
* archive.c: avoid access to the_index
(b612ee202a48f129f81f8f6a5af6cf71d1a9caef)
* for_each_*_object: move declarations to object-store.h
(0889aae1cd18c1804ba01c1a4229e516dfb9fe9b)
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2018-10-12 | 1 | -1/+1 |
| * | git: update to v2.18.0•••Update to git version v2.18.0. Required changes follow upstream commits:
* Convert find_unique_abbrev* to struct object_id
(aab9583f7b5ea5463eb3f653a0b4ecac7539dc94)
* sha1_file: convert read_sha1_file to struct object_id
(b4f5aca40e6f77cbabcbf4ff003c3cf30a1830c8)
* sha1_file: convert sha1_object_info* to object_id
(abef9020e3df87c441c9a3a95f592fce5fa49bb9)
* object-store: move packed_git and packed_git_mru to object store
(a80d72db2a73174b3f22142eb2014b33696fd795)
* treewide: rename tree to maybe_tree
(891435d55da80ca3654b19834481205be6bdfe33)
The changed data types required some of our own functions to be converted
to struct object_id:
ls_item
print_dir
print_dir_entry
print_object
single_tree_cb
walk_tree
write_tree_link
And finally we use new upstream functions that were added for
struct object_id:
hashcpy -> oidcpy
sha1_to_hex -> oid_to_hex
Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
| Christian Hesse | 2018-06-27 | 1 | -14/+14 |
| * | ui-plain: print symlink content•••We currently ignore symlinks in ui-plain, leading to a 404. In ui-tree
we print the content of the blob (that is, the path to the target of the
link), so it makes sense to do the same here.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2017-08-10 | 1 | -1/+1 |
| * | git: update to v2.14•••Numerous changes were made to git functions to use an object_id
structure rather than sending sha1 hashes as raw unsigned character
arrays. The functions that affect cgit are: parse_object,
lookup_commit_reference, lookup_tag, lookup_tree, parse_tree_indirect,
diff_root_tree_sha1, diff_tree_sha1, and format_display_notes.
Commit b2141fc (config: don't include config.h by default) made it
necessary to that config.h be explicitly included when needed.
Commit 07a3d41 (grep: remove regflags from the public grep_opt API)
removed one way of specifying the ignore-case grep option.
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
| Jeff Smith | 2017-08-10 | 1 | -1/+1 |
| * | ui-plain: replace 'unsigned char sha1[20]' with 'struct object_id oid'•••Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...
| Christian Hesse | 2016-10-04 | 1 | -3/+3 |
| * | ui-plain: fix to show a repo's root directory listing in plain view•••This is to fix the case of accessing http://host.com/cgit.cgi/repo.git/plain/
There is code here to make this case work (match_baselen is set to -1
for top-of-the-tree views) but the unsigned to signed comparison was
always false in this case, causing an empty directory listing without
this fix.
Signed-off-by: Joe Anakata <jea-signup-github@anakata.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
| Joe Anakata | 2016-02-22 | 1 | -1/+1 |
| * | ui-plain: add enable-html-serving flag•••Unrestricts plain/ to contents likely to be executed by browser.
| Jason A. Donenfeld | 2016-01-14 | 1 | -0/+10 |
| * | git: update to v2.7.0•••Update to git version v2.7.0.
* Upstream commit ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 (Remove
get_object_hash.) changed API:
Convert all instances of get_object_hash to use an appropriate
reference to the hash member of the oid member of struct object.
This provides no functional change, as it is essentially a macro
substitution.
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2016-01-13 | 1 | -1/+1 |
| * | ui-plain: fix resource leak: free before assigning NULL•••Coverity-id: 13939
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2015-10-09 | 1 | -1/+3 |
| * | ui-plain: fix resource leak: free before return•••Coverity-id: 13940
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2015-10-09 | 1 | -0/+1 |
| * | refactor get_mimetype_from_file() to get_mimetype_for_filename()•••* handle mimetype within a single function
* return allocated memory on success
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2015-08-17 | 1 | -22/+6 |
| * | move get_mimetype_from_file() to shared•••Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2015-08-17 | 1 | -40/+0 |
| * | plain: use cgit_print_error_page() instead of html_status()•••This provides a formatted error response rather than a simple HTTP
error.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2015-08-14 | 1 | -5/+5 |
| * | Remove redundant includes•••These are all included in git-compat-util.h (when necessary), which we
include in cgit.h.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2015-08-13 | 1 | -1/+0 |
| * | git: update for v2.3.0•••* sort_string_list(): rename to string_list_sort() (upstream commit
3383e199)
* update read_tree_recursive callback to pass strbuf as base (upstream
commit 6a0b0b6d)
Signed-off-by: Christian Hesse <mail@eworm.de>
| Christian Hesse | 2015-02-08 | 1 | -7/+6 |
| * | Switch to exclusively using global ctx•••Drop the context parameter from the following functions (and all static
helpers used by them) and use the global context instead:
* cgit_print_http_headers()
* cgit_print_docstart()
* cgit_print_pageheader()
Remove context parameter from all commands
Drop the context parameter from the following functions (and all static
helpers used by them) and use the global context instead:
* cgit_get_cmd()
* All cgit command functions.
* cgit_clone_info()
* cgit_clone_objects()
* cgit_clone_head()
* cgit_print_plain()
* cgit_show_stats()
In initialization routines, use the global context variable instead of
passing a pointer around locally.
Remove callback data parameter for cache slots
This is no longer needed since the context is always read from the
global context variable.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2014-01-17 | 1 | -7/+7 |
| * | Update copyright information•••* Name "cgit Development Team" as copyright holder to avoid listing
every single developer.
* Update copyright ranges.
Signed-off-by: Lukas Fleischer <cgit@crytocrack.de>
| Lukas Fleischer | 2014-01-08 | 1 | -1/+1 |
| * | plain: don't append charset for binary MIME types•••When outputting the Content-Type HTTP header we print the MIME type and
then append "; charset=<charset>" if the charset variable is non-null.
We don't want a charset when we have selected "application/octet-stream"
or when the user has specified a custom MIME type, since they may have
specified their own charset. To avoid this, make sure we set the page's
charset to NULL in ui-plain before we generate the HTTP headers.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| John Keeping | 2014-01-08 | 1 | -3/+8 |
| * | use struct strbuf instead of static buffers•••Use "struct strbuf" from Git to remove the limit on file path length.
Notes on scan-tree:
This is slightly involved since I decided to pass the strbuf into
add_repo() and modify if whenever a new file name is required, which
should avoid any extra allocations within that function. The pattern
there is to append the filename, use it and then reset the buffer to its
original length (retaining a trailing '/').
Notes on ui-snapshot:
Since write_archive modifies the argv array passed to it we
copy the argv_array values into a new array of char* and then free the
original argv_array structure and the new array without worrying about
what the values now look like.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -2/+4 |
| * | Remove redundant calls to fmt("%s", ...)•••After this change there is one remaining call 'fmt("%s", delim)' in
ui-shared.c but is needed as delim is stack allocated and so cannot be
returned from the function.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -1/+1 |
| * | Mark char* fields in struct cgit_page as const•••Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -1/+2 |
| * | Always #include corresponding .h in .c files•••While doing this, remove declarations from header files where the
corresponding definition is declared "static" in order to avoid build
errors.
Also re-order existing headers in ui-*.c so that the file-specific
header always comes immediately after "cgit.h", helping with future
consistency.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-04-08 | 1 | -0/+1 |
| * | ui-plain.c: Use a context structure in walk_tree()•••Do not misuse global variables to save the context. Instead, use the
context pointer which was designed to share information between a
read_tree_fn and the caller.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -13/+20 |
| * | ui-plain.c: Do not access match variable in print_*()•••Move all code setting the match variable to walk_tree().
This allows for easily moving this variable into a context structure
without having to pass the context to print_*().
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
| Lukas Fleischer | 2013-03-04 | 1 | -12/+14 |
| * | Update git to v1.7.6.5•••struct pathspec is now used in more places.
Signed-off-by: John Keeping <john@keeping.me.uk>
| John Keeping | 2013-03-02 | 1 | -5/+12 |
| * | Merge branch 'fh/mimetypes' | Lars Hjemli | 2012-03-18 | 1 | -1/+51 |
| |\ |
|
| | * | ui_plain: automatically lookup mimetype when mimetype-file is set•••For sites that do not want to configure mime types by hand but
still want the correct mime type for 'plain' blobs, configuring
a mime type file is made possible. This is handy since such a
file is normally already provided (at least on Linux systems).
Also, this reflects the gitweb option '$mimetypes_file'
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Ferry Huberts | 2011-07-19 | 1 | -1/+51 |
| * | | ui-plain.c: add support for path-selected submodule links•••In ui-plain.c, the links generated for submodule entry ignored the fact
that the entry was in fact a submodule. This patch adds proper submodule
links to the plain directory listings.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2011-06-15 | 1 | -3/+6 |
| |/ |
|
| * | ui-plain.c: fix html and links generated by print_dir() and print_dir_entry()•••This patch fixes the following issues:
* the base argument usually isn't zero-terminated, so printing base
without considering baselen will usually generate random garbage
* when the current url represents a directory but doesn't end in a slash,
relative urls would be incorrect
* using unescaped paths allows XSS
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2011-06-12 | 1 | -19/+46 |
| * | Use GIT-1.7.2.2•••Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2010-08-22 | 1 | -1/+1 |
| * | ui-plain: print directory listings•••When a user requests a plain view of a tree (as opposed to a blob),
print out a directory listing rather than giving a 404 Not Found.
Also, fix a segfault when ctx->qry.path is NULL - i.e, when /plain is
requested without a path.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
| Mark Lodato | 2010-01-31 | 1 | -1/+47 |
| * | ui-plain: more efficient walk_tree()•••Git's read_tree_recursive() already filters out the objects by pathname,
so we only have to compare baselen to the expected. That is, no string
matching is required.
Additionally, if the requested path is a directory, the old code would
walk through all of its immediate children. This is not necessary, this
so we no longer do that.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
| Mark Lodato | 2010-01-31 | 1 | -6/+14 |
| * | ui-plain: remove unused curr_rev variable•••Signed-off-by: Mark Lodato <lodatom@gmail.com>
| Mark Lodato | 2010-01-30 | 1 | -2/+0 |
| * | Fix segfault on ppc when browsing tree | Martins Polakovs | 2009-12-12 | 1 | -1/+1 |
| * | Merge branch 'stable' | Lars Hjemli | 2009-09-06 | 1 | -1/+2 |
| |\ |
|
| | * | ui-plain.c: only return the blob with the specified path•••When a path to a directory was specified for the 'plain'
view, each blob in the directory used to be returned to
the client. This patch fixes the issue by matching the
path of each blob against the requested path.
Noticed-by: Lars Stoltenow <penma@penma.de>
Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
| Lars Hjemli | 2009-09-06 | 1 | -1/+2 |
| * | | Add support for mime type registration and lookup•••This patch makes it possible to register mappings from filename
extension to mime type in cgitrc and use this mapping when returning
blob content in `plain` view.
The reason for adding this mapping to cgitrc (as opposed to parsing
something like /etc/mime.types) is to allow quick lookup of a limited
number of filename extensions (/etc/mime-types on my machine currently
contains over 700 entries).
NB: A nice addition to this patch would be to parse /etc/mime.types
when `plain` view is requested for a file with an extension for which
there is no mapping registered in cgitrc.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2009-07-25 | 1 | -5/+15 |
| * | | Merge branch 'plain-etag'•••Conflicts:
ui-shared.c
| Lars Hjemli | 2009-07-25 | 1 | -0/+1 |
| |\ \ |
|
| | * | | Add support for ETag in 'plain' view•••When downloading a blob identified by its path, the client might want
to know if the blob has been modified since a previous download of the
same path. To this end, an ETag containing the blob SHA1 seems to be
ideal.
Todo: add support for HEAD requests...
Suggested-by: Owen Taylor <otaylor@redhat.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2009-02-19 | 1 | -0/+1 |
| | |/ |
|
| * / | ui-plain: Return 'application/octet-stream' for binary files.•••Signed-off-by: Remko Tronçon <git@el-tramo.be>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Remko Tronçon | 2009-07-25 | 1 | -1/+4 |
| |/ |
|
| * | Fix some warnings to allow -Werror•••The type used to declare the st_size field of a 'struct stat' can
be a 32- or 64-bit sized type, which can vary from one platform to
another, or even from one compilation to another. In particular,
on linux, if you include the following define:
#define _FILE_OFFSET_BITS 64
prior to including certain system header files, then the type used
for the st_size field will be __off64_t, otherwise it will be an
__off_t. Note that the above define is included at the top of
git-compat-util.h.
In cache.c, the "%zd" format specifier expects a "signed size_t",
another type which can vary, when an __off64_t or a __off_t is
provided. To supress the warning, use the PRIuMAX format specifier
and cast the st_size field to uintmax_t. This should work an any
platform for which git currently compiles.
In ui-plain.c, the size parameter of sha1_object_info() and
read_sha1_file() is defined to be "unsigned long *" not "size_t *".
So, to supress the warning, simply declare size with the correct type.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Ramsay Jones | 2008-11-06 | 1 | -1/+1 |
| * | ui-plain: handle subdirectories•••The callback from read_tree_recursive just needs to check the type of
each tree entry; if it's a dir we want to continue scanning, if it's a
regular file we'll assume it's the one we requested.
And while at it, remove some stray fprintfs.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2008-09-02 | 1 | -4/+1 |
| * | Supply status description to html_status()•••Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2008-08-06 | 1 | -5/+5 |
| * | Implement plain view•••This implements a way to access plain blobs by path (similar to the
tree view) instead of by sha1.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| Lars Hjemli | 2008-08-06 | 1 | -0/+82 |