An easy way to setup multiple authors based on git commit --template
. It
depends on git-together
https://github.com/kejadlen/git-together is required to run git-author
.
setup.sh
simply created a .git-author
file as the home directory, and also
configure the git to use that file as commit.template
.
Follow the instruction from https://github.com/kejadlen/git-together to setup
the git-together
configurations. Then, git-author
can use the initials from
the git-together
to populate the template file.
# pairing with James and Naomi
git author jh nn
# soloing
git author jh
# mobbing
git author jh nn ca
# show who are included in current ~/.git-author
git author
Then, a regular commit by git commit
can automatically include all the
authors with prefix Author:
, e.g.
# mobbing
git author jh nn ca
# commit
git commit
# the commit message is pre-populated as:
Author: James Holden <[email protected]>
Author: Naomi Nagata <[email protected]>
Author: Chrisjen Avasarala <[email protected]>
git-together
is a wonderful tool to change the author
and commit
fields
in the git commit object, and rotate the authors automaticaly to evenly
distribute the credit. However, both author
and commit
fields can be easily
updated by future merging, rebasing, cherry-picking etc.
Also, git-together
cannot put multiple authors directly into same commit,
e.g. it can only support one Signed-off-by:
message generated by git commit --signoff
.
git-author
is created to extend the git-together
capability, so that all
the authorship information will be captured as part of the commit message,
hence, it won't care about who actually tracked in the author
and commit
fields in the git log.