aboutsummaryrefslogtreecommitdiffstats
path: root/cmd.c
Commit message (Expand)AuthorAgeFilesLines
* 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 Hesse2020-10-201-9/+9
* ui-tree: allow per repository override for enable-blame•••The blame operation can cause high cost in terms of CPU load for huge repositories. Let's add a per repository override for enable-blame. Signed-off-by: Christian Hesse <mail@eworm.de> Christian Hesse2019-06-251-1/+1
* ui-blame: add blame UI•••Implement a page which provides the blame view of a specified file. This feature is controlled by a new config variable, "enable-blame", which is disabled by default. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: John Keeping <john@keeping.me.uk> Jeff Smith2017-10-031-1/+11
* about: path_info might not be validJason A. Donenfeld2016-02-261-1/+2
* cmd: redirect empty about/ to homepage or summary•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Jason A. Donenfeld2016-02-221-1/+10
* cmd: fix resource leak: free allocation from cgit_currenturl and fmtalloc•••Signed-off-by: Christian Hesse <mail@eworm.de> Christian Hesse2015-10-091-3/+7
* cmd: fix command definition•••The previous commit removed the "pre" field from "struct cgit_cmd" but forgot to update this macro. Signed-off-by: John Keeping <john@keeping.me.uk> Reviewed-by: Christian Hesse <mail@eworm.de> John Keeping2015-08-141-1/+1
* cmd: no need for pre function hook now•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Jason A. Donenfeld2015-08-141-15/+9
* cmd: remove "want_layout" field•••No commands use this any more. Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-24/+24
* tree: move layout into page function•••This also allows us to return proper HTTP error codes when the requested tree is not found and display an error message in one case (invalid path inside valid commit) where we previously just displayed an empty page. Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* tag: move layout into page function•••This also allows us to return proper HTTP error codes when something goes wrong. Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* summary: move layout into page function•••Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* stats: move layout into page function•••This also allows us to return proper HTTP error codes for invalid requests. Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* refs: move layout to page function•••Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* log: move layout into page function•••Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* diff: move layout to page function•••The existing "show_ctrls" flag is used to control whether we are running in an existing page or control the page ourselves. Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* commit: move layout into page function•••This allows us to return a proper HTTP status code when an object is not found by switching from cgit_print_error() to cgit_print_error_page(). Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* about: move layout into page functions•••Signed-off-by: John Keeping <john@keeping.me.uk> John Keeping2015-08-141-1/+1
* redirect: be more careful for different cgi setupsJason A. Donenfeld2015-08-131-1/+4
* about: always ensure page has a trailing slash•••Otherwise we can't easily embed links to other /about/ pages. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Jason A. Donenfeld2015-08-121-2/+10
* Remove unused parameter from cgit_print_snapshot()Lukas Fleischer2014-02-211-1/+1
* 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 Fleischer2014-01-171-51/+51
* 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 Fleischer2014-01-081-2/+1
* Allow for creating patch series•••This allows for specifying a revision range using the id2 parameter of /patch/. The output that is produced is similar to $ git format-patch --stdout id2..id Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> Lukas Fleischer2013-08-201-1/+1
* cmd.c: Add a "rawdiff" command•••This can be used to generate raw diffs between arbitrary revisions using something like /rawdiff/?id=v0.9&id2=v0.9.1 Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> Lukas Fleischer2013-08-161-0/+6
* Allow for creating raw diffs with cgit_print_diff()•••This adds a parameter to cgit_print_diff() to create raw diffs, using the same format as `git diff <commit>`. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> Lukas Fleischer2013-08-161-1/+1
* readme: use string_list instead of space deliminations•••Now this is possible in cgitrc - readme=:README.md readme=:readme.md readme=:README.mkd readme=:readme.mkd readme=:README.rst readme=:readme.rst readme=:README.html readme=:readme.html readme=:README.htm readme=:readme.htm readme=:README.txt readme=:readme.txt readme=:README readme=:readme readme=:INSTALL.txt readme=:install.txt readme=:INSTALL readme=:install Suggested-by: John Keeping <john@keeping.me.uk> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Jason A. Donenfeld2013-05-261-1/+2
* White space around control verbs.•••Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Jason A. Donenfeld2013-03-041-1/+1
* ui-log: Add "commit-sort" option for controlling commit ordering•••This makes it possible to use strict commit date ordering or strict topological ordering by passing the corresponding flags to "git log". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Tobias Bieniek2012-10-171-1/+2
* Merge branch 'lh/panel'Lars Hjemli2011-05-231-1/+1
|\
| * ui-diff.c: create a control panel for diff options•••Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2011-03-061-1/+1
* | Merge branch 'dm/disable-clone'Lars Hjemli2011-05-141-21/+21
|\ \ | |/ |/|
| * Add is_clone flag to available commands•••This will be used to make these operations configurable via a config option. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Dan McGee2011-02-191-21/+21
* | ui-log: Line-wrap long commit subjects when showmsg is enabled•••When showmsg is disabled ui-log truncates long commit subjects. This is good. However, the same is not desirable when showmsg is enabled, since you then end up with a truncated commit subject followed by the rest of the commit message below. Instead, when showmsg is enabled (and we're using all this space to display the entire commit message, anyway), line-wrap the commit subject instead of truncating it. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Johan Herland2010-11-161-1/+2
|/
* Merge branch 'jh/path-limit'•••Conflicts: cgit.h ui-commit.c Lars Hjemli2010-06-221-23/+23
|\
| * ui-patch: Apply path limit to generated patch•••Also indicate in the comment section of the patch that a path limit was applied, too easily see when a generated patch is only partial. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Johan Herland2010-06-191-1/+1
| * ui-commit: Limit diff based on path limit in qry.path•••Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Johan Herland2010-06-191-1/+1
| * struct cgit_cmd: Differentiate between various usages of ctx.qry.path•••For many commands/pages (e.g. 'tree', 'diff', 'plain', etc.), the ctx.qry.path argument is interpreted as a path within the "virtual" project directory structure. However, for some other commands (notably 'refs', and the clone-related commands) ctx.qry.path is used in a different context (as a more or less "real" path within the '.git' directory). This patch differentiates between these two usages of ctx.qry.path, by introducing a new variable - ctx.qry.vpath - which is equal to ctx.qry.path in the former case, and NULL in the latter. This will become useful in future patches when we want various pages and the links between them to preserve existing in-project paths. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Johan Herland2010-06-191-21/+21
* | Add 'max-atom-items' config variable•••This allows one to specify the items in the RSS feeds Signed-off-by: Aaron Griffin <agriffin@datalogics.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Aaron Griffin2010-03-221-1/+1
|/
* ui-summary: enable arbitrary paths below repo.readme•••This change makes it possible to include any number of pages below the 'about' tab for a repository. The path is assumed to be located in the same directory as the 'repo.readme' file. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2009-08-091-1/+1
* Merge branch 'lh/stats'•••Conflicts: cgit.c cgit.css cgit.h ui-tree.c Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2009-01-271-0/+7
|\
| * ui-stats: replace 'enable-stats' setting with 'max-stats'•••The new 'max-stats' and 'repo.max-stats' settings makes it possible to define the maximum statistics period, both globally and per repo. Hence, it is now feasible to allow statistics on repositories with a high commit frequency, like linux-2.6, by setting repo.max-stats to e.g. 'month'. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-12-071-4/+1
| * Add a 'stats' page to each repo•••This new page, which is disabled by default, can be used to print some statistics about the number of commits per period in the repository, where period can be either weeks, months, quarters or years. The function can be activated globally by setting 'enable-stats=1' in cgitrc and disabled for individual repos by setting 'repo.enable-stats=0'. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-12-061-0/+10
* | Set prefix in snapshots when using dwimmery•••This patch sets the directory prefix in archives to be the filename, excluding the suffix (.tar.gz, .tar.bz2 etc). The patch also removes the prefix parameter in cgit_print_snapshot() as the prefix might differ. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Natanael Copa2008-11-301-2/+1
|/
* ui-snapshot: add dwimmery•••When downloading a snapshot, the snapshot name will often contain the repo name combined with a tag. This patch tries to exploit this so that the correct revision is downloaded even if no specific revision is specified. PS: this only occurs if neither 'h' nor 'id' is specified in the query- string. PPS: this also fixes a bug which occurs when trying to download a filename with an unsupported suffix: it used to try to print an error message to the user but failed since it didn't prepare the output properly. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-10-111-1/+1
* Merge branch 'lh/plain'•••* lh/plain: Supply status description to html_status() ui-tree: link to plain view instead of blob view Implement plain view Lars Hjemli2008-09-011-0/+7
|\
| * 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 Hjemli2008-08-061-0/+7
* | Merge branch 'lh/clone'•••* lh/clone: Add support for cloning over http Conflicts: cmd.c Lars Hjemli2008-09-011-0/+19
|\|
| * Add support for cloning over http•••This patch implements basic support for cloning over http, based on the work on git-http-backend by Shawn O. Pearce. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-08-061-0/+19
* | Add atom-support•••This enables a page which generates atom feeds for the current branch and path, heavily inspired by the atom-support in gitweb. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-08-011-0/+7
|/