-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Because git duet does not mess with the user entry in the git config it causes random users to be set as the committer on git commits that are being rebased.
To fix this git duet needs to set/change the actual user entry, allowing all other git commands to respect the 'pair/mob' that is attempting to make the commits.
steps to reproduce
GIVEN:
a ~/.git-authors file:
authors
aa: Alice Abernathy:alice
bb: Billy Bobsworthy:billy
email:
example.com
and an entry in the ~/.gitconfig
....
[user]
name = DONT EVER USE ME!!!!
initials = nn
email = [email protected]
....
When the pair run
git duet aa bb
echo "some new stuff" > foo.txt
git add foo.txt
git duet-commit -m 'showing a bug'
git log --pretty=full -1
then they should see something like
commit 11122223334444555666aaaabbbccccddddeeefff
Author: Alice Abernathy <[email protected]>
Commit: Alice Abernathy <[email protected]>
showing a bug
Signed-off-by: Billy Bobsworthy <[email protected]>
.... Great works as expected
But now some other team member has pushed a commit, and before I can push mine I need to rebase it ontop of some other persons commit
git pull -r
but now if we run
git log --pretty=full -1
we get something like:
commit 22223334444555666aaaabbbccccddddeeefffwhatever
Author: Alice Abernathy <[email protected]>
Commit: DONT EVER USE ME!!! <[email protected]>
showing a bug
Signed-off-by: Billy Bobsworthy <[email protected]>
Essentially git is using the built in git rebase which knows nothing about the [duet "env"] entry in the git config and only knows how to use the [user] entry in the config.
To fix this I think git duet should always rotate one of the duet users into the [user] entry of the git config (similar to what the old ruby git-authors project did.
On a decent size teams that uses rebases to keep a sane commit history, this is an ever present problem and causes a majority of our git history to have undesired (and entirely wrong) users associated to the commits