You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 = nobody@nowhere.com
....
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 <alice@example.com>
Commit: Alice Abernathy <alice@example.com>
showing a bug
Signed-off-by: Billy Bobsworthy <billy@example.com>
.... 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 <alice@example.com>
Commit: DONT EVER USE ME!!! <nobody@nowhere.com>
showing a bug
Signed-off-by: Billy Bobsworthy <billy@example.com>
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
The text was updated successfully, but these errors were encountered:
Good point, that workflow is not directly compatible with git duet out-of-the-box.
You can set GIT_DUET_SET_GIT_USER_CONFIG=1 to have it also set the user git config. This is in the README, but could probably be made more prominent as I find git pull --rebase to be a pretty common workflow.
Thanks for the response. I'm not sure when it was introduced but my current version does not seem to respect the flag....
+1 on making it more prominent (I think it should default on) as there are so many git commands that have the potential of needing to make new commits, and all of them will be using the [user] entry.
Because git duet does not mess with the
user
entry in the git config it causes random users to be set as thecommitter
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:and an entry in the ~/.gitconfig
When the pair run
then they should see something like
.... 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:
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 rubygit-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
The text was updated successfully, but these errors were encountered: