2008-10-27 05:44:34 +01:00
|
|
|
This [[patch]] allows for `\[[sha1]]` substitution in the `diffurl`
|
|
|
|
for git repositories. This is useful for use with [cgit][] which has
|
|
|
|
diffurls of the following form:
|
|
|
|
|
2008-10-28 01:20:50 +01:00
|
|
|
/project.git/diff/\[[file]]?id=\[[sha1_commit]]
|
2008-10-27 05:44:34 +01:00
|
|
|
|
|
|
|
[cgit]: http://hjemli.net/git/cgit/
|
|
|
|
|
|
|
|
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
|
|
|
|
index 5bef928..164210d 100644
|
|
|
|
--- a/IkiWiki/Plugin/git.pm
|
|
|
|
+++ b/IkiWiki/Plugin/git.pm
|
2008-12-17 21:22:16 +01:00
|
|
|
@@ -518,6 +518,7 @@ sub rcs_recentchanges ($) {
|
2008-10-27 05:44:34 +01:00
|
|
|
|
|
|
|
my $diffurl = defined $config{'diffurl'} ? $config{'diffurl'} : "";
|
|
|
|
$diffurl =~ s/\[\[file\]\]/$file/go;
|
|
|
|
+ $diffurl =~ s/\[\[sha1\]\]/$sha1/go;
|
|
|
|
$diffurl =~ s/\[\[sha1_parent\]\]/$ci->{'parent'}/go;
|
|
|
|
$diffurl =~ s/\[\[sha1_from\]\]/$detail->{'sha1_from'}/go;
|
|
|
|
$diffurl =~ s/\[\[sha1_to\]\]/$detail->{'sha1_to'}/go;
|
2008-10-27 19:45:54 +01:00
|
|
|
|
|
|
|
> [[done]], but I called it `sha1_commit` since I think that's what it's
|
|
|
|
> actually a sha1 of. --[[Joey]]
|
2008-10-28 01:20:50 +01:00
|
|
|
|
|
|
|
>> I was at a loss for something more descriptive...I like that much
|
|
|
|
>> better :) Thanks! --[[JasonBlevins]]
|