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
Currently, this seems to be somewhat intentional as the code for amending a commit passes None for committer which results in the committer being unchanged. I suggest we change that and override the committer with the current user, that is whatever is returned by signature_allow_undefined_name (which usually is git config --get user.name/email). I’ll prepare a PR soon!
seems to be somewhat intentional [..] results in the committer being unchanged
isnt that exactly the opposite of what the bug report states?
You’re absolutely right! Then I can’t seem to reproduce as the author is not overwritten if I do an amend using gitui. (This observation made me think we should probably change the committer if we amend, but now I’m not so sure anymore.) I can also try and check on a different machine to see whether I’m missing anything.
My understanding is that the committer should change, yeah
But your bug report says:
Observe that you are now listed as the commit author
So what is it ? 🙈
"Committer" and "Author" are two different things. The "Author" is supposed to be the original author of the commit. The "Committer" is the last person who modified the commit in some way (amend, rebase, etc).
(I meant to have that first line be git config set user.name me for clarity; setting log.showSignature is irrelevant)
Screenshot demonstrating the incorrect behavior
These commands were performed immediately after the previous screenshot was taken. When I ran gitui, I amended the commit and did nothing else. The author has erroneously been changed.
In case you're looking at email notifications, I've edited my last comment to have screenshots that demonstrate both the correct git behavior and the incorrect gitui behavior (it does reproduce for me).
changed the title [-]Amending a commit overwrites the author[/-][+]Amending a commit does not handle the author and committer fields correctly[/+]on Nov 27, 2025
Oh interesting. Makes sense. the signed amend is a hack because there is no such thing in libgit2. so we undo the last commit and commit again but then it overwrite both author and committer. So we need to preserve the original author explicitly here. The other issue is the committer not being set in the actual amend call.
Actually it does, kind-a :D. The code is currently (and originated) in GitButler. It's a very faithful and by now proven implementation, but I didn't get around to porting it over yet.
If that was the case, signing commits in general is easy, and the same is true for amends.
There’s also this addition to gitoxideGitoxideLabs/gitoxide@aacc326 that does a subset of what GitButler does. I’m interested in adding more comprehensive signing support to gitoxide, but I don’t know whether it’s on anyone else’s TODO list already. :-)
changed the title [-]Amending a commit does not handle the author and committer fields correctly[/-][+]Amending a signed commit overwrites author[/+]on Nov 29, 2025
I just had a brief look at the code and think it should not be too difficult to address the second part of this issue. I’ll try to create a PR over the course of the next couple of days.
Activity
cruessler commentedon Nov 22, 2025
I’ll have a look!
cruessler commentedon Nov 27, 2025
Currently, this seems to be somewhat intentional as the code for amending a commit passes
Noneforcommitterwhich results in the committer being unchanged. I suggest we change that and override the committer with the current user, that is whatever is returned bysignature_allow_undefined_name(which usually isgit config --get user.name/email). I’ll prepare a PR soon!gitui/asyncgit/src/sync/commit.rs
Lines 43 to 50 in 37d3dd2
extrawurst commentedon Nov 27, 2025
isnt that exactly the opposite of what the bug report states?
cruessler commentedon Nov 27, 2025
You’re absolutely right! Then I can’t seem to reproduce as the author is not overwritten if I do an amend using
gitui. (This observation made me think we should probably change the committer if we amend, but now I’m not so sure anymore.) I can also try and check on a different machine to see whether I’m missing anything.ItsHarper commentedon Nov 27, 2025
My understanding is that the committer should change, yeah
Let me double-check I can reproduce myself.
extrawurst commentedon Nov 27, 2025
@ItsHarper
But your bug report says:
So what is it ? 🙈
ItsHarper commentedon Nov 27, 2025
"Committer" and "Author" are two different things. The "Author" is supposed to be the original author of the commit. The "Committer" is the last person who modified the commit in some way (amend, rebase, etc).
ItsHarper commentedon Nov 27, 2025
Screenshot demonstrating the correct behavior
The committer changes, but the author does not
(I meant to have that first line be
git config set user.name mefor clarity; settinglog.showSignatureis irrelevant)Screenshot demonstrating the incorrect behavior
These commands were performed immediately after the previous screenshot was taken. When I ran
gitui, I amended the commit and did nothing else. The author has erroneously been changed.ItsHarper commentedon Nov 27, 2025
In case you're looking at email notifications, I've edited my last comment to have screenshots that demonstrate both the correct
gitbehavior and the incorrectgituibehavior (it does reproduce for me).ItsHarper commentedon Nov 27, 2025
When in doubt, read the docs:You have to explicitly provide the original author toamend().ItsHarper commentedon Nov 27, 2025
Wait, I think the docs agree with you. Quite frankly, I'm not sure how I was reading it previously...
Is this a bug in my distribution's version of
libgit2? Chimera Linux packages 1.9.1, the latest stable release.[-]Amending a commit overwrites the author[/-][+]Amending a commit does not handle the author and committer fields correctly[/+]ItsHarper commentedon Nov 27, 2025
OK, I figured out why you couldn't reproduce it. The behavior is different depending on whether you're amending a signed commit.
When amending a signed commit, both author and committer are overwritten.
When amending an unsigned commit, neither author nor committer are overwritten.
Both behaviors are wrong, just in opposite directions. I've edited the issue description.
extrawurst commentedon Nov 27, 2025
Oh interesting. Makes sense. the signed amend is a hack because there is no such thing in libgit2. so we undo the last commit and commit again but then it overwrite both author and committer. So we need to preserve the original author explicitly here. The other issue is the committer not being set in the actual
amendcall.@cruessler @Byron gix support for signed amend ? :)
Byron commentedon Nov 28, 2025
Actually it does, kind-a :D. The code is currently (and originated) in GitButler. It's a very faithful and by now proven implementation, but I didn't get around to porting it over yet.
If that was the case, signing commits in general is easy, and the same is true for amends.
cruessler commentedon Nov 28, 2025
There’s also this addition to
gitoxideGitoxideLabs/gitoxide@aacc326 that does a subset of what GitButler does. I’m interested in adding more comprehensive signing support togitoxide, but I don’t know whether it’s on anyone else’s TODO list already. :-)Byron commentedon Nov 28, 2025
It's on my TODO list, but that's the case for everything
gitoxide, your help would be greatly appreciated 🙏.[-]Amending a commit does not handle the author and committer fields correctly[/-][+]Amending a signed commit overwrites author[/+]cruessler commentedon Dec 2, 2025
I just had a brief look at the code and think it should not be too difficult to address the second part of this issue. I’ll try to create a PR over the course of the next couple of days.