Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 2021 16:00:55 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: cd6114d1a65c - main - git-arc: Preserve the commit author when staging commits
Message-ID:  <202102181600.11IG0tJ4086158@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=cd6114d1a65cda09410e91ed4dc220df825a8ba2

commit cd6114d1a65cda09410e91ed4dc220df825a8ba2
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-02-18 15:59:43 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-18 16:00:09 +0000

    git-arc: Preserve the commit author when staging commits
    
    Reported by:    jhb
---
 tools/tools/git/git-arc.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
index 2de7e1858c00..07b042ceb151 100644
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -452,7 +452,7 @@ gitarc::patch()
 
 gitarc::stage()
 {
-    local branch commit commits diff reviewers tmp
+    local author branch commit commits diff reviewers tmp
 
     branch=main
     while getopts b: o; do
@@ -488,12 +488,13 @@ gitarc::stage()
             fi
             printf "Differential Revision:\thttps://reviews.freebsd.org/${diff}" >> $tmp
         fi
+        author=$(git show -s --format='%an <%ae>' ${commit})
         if ! git cherry-pick --no-commit ${commit}; then
             warn "Failed to apply $(git rev-parse --short ${commit}).  Are you staging patches in the wrong order?"
             git checkout -f
             break
         fi
-        git commit --edit --file $tmp
+        git commit --edit --file $tmp --author "${author}"
     done
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102181600.11IG0tJ4086158>