]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/todo/provide_sha1_for_git_diffurl.mdwn
Added a comment
[git.ikiwiki.info.git] / doc / todo / provide_sha1_for_git_diffurl.mdwn
1 This [[patch]] allows for `\[[sha1]]` substitution in the `diffurl`
2 for git repositories.  This is useful for use with [cgit][] which has
3 diffurls of the following form:
5     /project.git/diff/\[[file]]?id=\[[sha1_commit]]
7  [cgit]: http://hjemli.net/git/cgit/
9     diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
10     index 5bef928..164210d 100644
11     --- a/IkiWiki/Plugin/git.pm
12     +++ b/IkiWiki/Plugin/git.pm
13     @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) {
14      
15                         my $diffurl = defined $config{'diffurl'} ? $config{'diffurl'} : "";
16                         $diffurl =~ s/\[\[file\]\]/$file/go;
17     +                   $diffurl =~ s/\[\[sha1\]\]/$sha1/go;
18                         $diffurl =~ s/\[\[sha1_parent\]\]/$ci->{'parent'}/go;
19                         $diffurl =~ s/\[\[sha1_from\]\]/$detail->{'sha1_from'}/go;
20                         $diffurl =~ s/\[\[sha1_to\]\]/$detail->{'sha1_to'}/go;
22 > [[done]], but I called it `sha1_commit` since I think that's what it's
23 > actually a sha1 of. --[[Joey]]
25 >> I was at a loss for something more descriptive...I like that much
26 >> better :) Thanks! --[[JasonBlevins]]