|author||John Keeping <email@example.com>||2015-08-12 15:55:28 +0100|
|committer||Jason A. Donenfeld <Jason@zx2c4.com>||2015-08-12 16:57:46 +0200|
|parent||shared: make cgit_diff_tree_cb public (diff)|
log: allow users to follow a file
Teach the "log" UI to behave in the same way as "git log --follow", when given a suitable instruction by the user. The default behaviour remains to show the log without following renames, but the follow behaviour can be activated by following a link in the page header. Follow is not the default because outputting merges in follow mode is tricky ("git log --follow" will not show merges). We also disable the graph in follow mode because the commit graph is not simplified so we end up with frequent gaps in the graph and many lines that do not connect with any commits we're actually showing. We also teach the "diff" and "commit" UIs to respect the follow flag on URLs, causing the single-file version of these UIs to detect renames. This feature is needed only for commits that rename the path we're interested in. For commits before the file has been renamed (i.e. that appear later in the log list) we change the file path in the links from the log to point to the old name; this means that links to commits always limit by the path known to that commit. If we didn't do this we would need to walk down the log diff'ing every commit whenever we want to show a commit. The drawback is that the "Log" link in the top bar of such a page links to the log limited by the old name, so it will only show pre-rename commits. I consider this a reasonable trade-off since the "Back" button still works and the log matches the path displayed in the top bar. Since following renames requires running diff on every commit we consider, I've added a knob to the configuration file to globally enable/disable this feature. Note that we may consider a large number of commits the revision walking machinery no longer performs any path limitation so we have to examine every commit until we find a page full of commits that affect the target path or something related to it. Suggested-by: René Neumann <firstname.lastname@example.org> Signed-off-by: John Keeping <email@example.com>
Diffstat (limited to 'cgitrc.5.txt')
1 files changed, 4 insertions, 0 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index e21ece9..759f353 100644
@@ -150,6 +150,10 @@ enable-filter-overrides::
Flag which, when set to "1", allows all filter settings to be
overridden in repository-specific cgitrc files. Default value: none.
+ Flag which, when set to "1", allows users to follow a file in the log
+ view. Default value: "0".
If set to "1", cgit will act as an dumb HTTP endpoint for git clones.
You can add "http://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL" to clone-url