Package: ikiwiki
Version: 2.9
Severity: wishlist
Tags: patch

This is the second part of my "submit changes from fd.org that might be
suitable for upstream" quest.

The following patch is currently being used on cairographics.org.
See also http://ikiwiki.info/todo/git_attribution/ .

>From: Carl Worth <[EMAIL PROTECTED]>
Date: Tue, 3 Jul 2007 15:32:45 -0700
Subject: [PATCH] Put username and email address into git's author field instead 
of the commit message

---
 Rcs/git.pm |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/Rcs/git.pm b/Rcs/git.pm
index 7f33148..fb4e2da 100644
--- a/Rcs/git.pm
+++ b/Rcs/git.pm
@@ -304,15 +304,6 @@ sub rcs_commit ($$$;$$) { #{{{
 
        my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
 
-       if (defined $user) {
-               $message = "web commit by $user" .
-                   (length $message ? ": $message" : "");
-       }
-       elsif (defined $ipaddr) {
-               $message = "web commit from $ipaddr" .
-                   (length $message ? ": $message" : "");
-       }
-
        # XXX: Wiki directory is in the unlocked state when starting this
        # action.  But it takes time for a Git process to finish its job
        # (especially if a merge required), so we must re-lock to prevent
@@ -330,10 +321,12 @@ sub rcs_commit ($$$;$$) { #{{{
                return $conflict if defined $conflict;
        }
 
+       my $author = "$user <" . userinfo_get($user, "email") . ">";
+
        # 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', "--author='$author'", '-m', $message, 
'-i', $file)) {
                unlockwiki();
                run_or_cry('git-push', $config{gitorigin_branch});
        }



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to