Reputation: 9062
For the project I work on, we use --signoff
as the way to approve each other's commits. I know that this isn't the way most projects work, but the model we have is that someone writes a patch, someone else reviews it and --signoff
's it, and the original author pushes it into the mainline.
The problem we have is that the original author of the commit goes away after the signoff. When someone does the command to signoff, it usually looks something like this:
git commit --amend --signoff
This of course updates the author field in addition to appending the signoff at the end of the commit message.
Is there a way to achieve the same thing without actually changing the author field? The only option I can see is to go look at the original author field and pass that in with:
--author "John Smith <[email protected]>"
which seems rather clunky and a pain to do every time you want to signoff a commit.
Update:
By popular demand, my .gitconfig
:
[user]
name = Wesley Bland
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
ui = auto
[color "status"]
added = green
changed = red
untracked = magenta
[core]
whitespace = trailing-space,space-before-tab,indent-with-tab
abbrev = 8
excludesfile = /Users/wbland/.gitignore_global
[alias]
graph = log --graph --decorate --abbrev-commit --pretty=oneline
[push]
default = simple
Upvotes: 3
Views: 1305
Reputation: 311308
git commit
(including git commit --ammed --signoff
), by default, does not change the author of a commit.
In fact, in order to do so, you'd need to explicitly specify you'd like to do so:
git commit --amend --signoff --reset-author
Upvotes: 2