X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/eec289e281c86fcaf290a5e22073a010d9c5a208..2a6e353c205a6c2c8b8e2eaf85fe9c585c1af0cd:/IkiWiki/Rcs/git.pm diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index 38581ba67..84e7d74e5 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -180,7 +180,7 @@ sub _parse_diff_tree ($@) { #{{{ $ci{ "${who}_epoch" } = $epoch; $ci{ "${who}_tz" } = $tz; - if ($name =~ m/^([^<]+) <([^@]+)/) { + if ($name =~ m/^([^<]+) <([^@>]+)/) { my ($fullname, $username) = ($1, $2); $ci{"${who}_fullname"} = $fullname; $ci{"${who}_username"} = $username; @@ -254,8 +254,9 @@ sub git_commit_info ($;$) { #{{{ $num ||= 1; - my @raw_lines = - run_or_die('git-log', "--max-count=$num", '--pretty=raw', '--raw', '--abbrev=40', '--always', '-m', '-r', $sha1, '--', '.'); + my @raw_lines = run_or_die('git-log', "--max-count=$num", + '--pretty=raw', '--raw', '--abbrev=40', '--always', '-m', + '-r', $sha1, '--', '.'); my ($prefix) = run_or_die('git-rev-parse', '--show-prefix'); my @ci; @@ -284,7 +285,9 @@ sub git_sha1 (;$) { #{{{ sub rcs_update () { #{{{ # Update working directory. - run_or_cry('git-pull', $config{gitorigin_branch}); + if (length $config{gitorigin_branch}) { + run_or_cry('git-pull', $config{gitorigin_branch}); + } } #}}} sub rcs_prepedit ($) { #{{{ @@ -332,9 +335,11 @@ sub rcs_commit ($$$;$$) { #{{{ # git-commit(1) returns non-zero if file has not been really changed. # so we should ignore its exit status (hence run_or_non). $message = possibly_foolish_untaint($message); - if (run_or_non('git-commit', '-m', $message, '-i', $file)) { + if (run_or_non('git-commit', '-q', '-m', $message, '-i', $file)) { unlockwiki(); - run_or_cry('git-push', $config{gitorigin_branch}); + if (length $config{gitorigin_branch}) { + run_or_cry('git-push', $config{gitorigin_branch}); + } } return undef; # success @@ -370,9 +375,9 @@ sub rcs_recentchanges ($) { #{{{ my (@pages, @messages); foreach my $detail (@{ $ci->{'details'} }) { - my $diffurl = $config{'diffurl'}; - my $file = $detail->{'file'}; + my $file = $detail->{'file'}; + my $diffurl = $config{'diffurl'}; $diffurl =~ s/\[\[file\]\]/$file/go; $diffurl =~ s/\[\[sha1_parent\]\]/$ci->{'parent'}/go; $diffurl =~ s/\[\[sha1_from\]\]/$detail->{'sha1_from'}/go;