summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Blevins <jrblevin@sdf.lonestar.org>2008-10-27 00:44:34 -0400
committerJason Blevins <jrblevin@sdf.lonestar.org>2008-10-27 00:44:34 -0400
commit3439e3797389ff34d6437249d431e54720682bbf (patch)
tree586d4eb392a62411049e5fb26020dd84c4d58295
parentf0fc8d158d60822d265457c612e99710fa4c63e7 (diff)
Patch for substitution of sha1 in diffurl
-rw-r--r--doc/todo/provide_sha1_for_git_diffurl.mdwn21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/todo/provide_sha1_for_git_diffurl.mdwn b/doc/todo/provide_sha1_for_git_diffurl.mdwn
new file mode 100644
index 000000000..aac3c6307
--- /dev/null
+++ b/doc/todo/provide_sha1_for_git_diffurl.mdwn
@@ -0,0 +1,21 @@
+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:
+
+ /project.git/diff/[[file]]?id=\[[sha1]]
+
+ [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
+ @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) { #{{{
+
+ 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;
+