Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git commit --amend #20

Open
professor opened this issue Jun 5, 2017 · 7 comments · May be fixed by #46
Open

git commit --amend #20

professor opened this issue Jun 5, 2017 · 7 comments · May be fixed by #46

Comments

@professor
Copy link
Contributor

professor commented Jun 5, 2017

It appears that amend is adding multiple sign-offs.

commit 1a9462c67aa33c012727241759d31f0b8c36dcb6
Author: Larry Hamel <[email protected]>
Date:   Mon Jun 5 09:40:05 2017 -0700

    add Gogland ide prefs

    includes templates for ginkgo

    Signed-off-by: Todd Sedano <[email protected]>
    Signed-off-by: Larry Hamel <[email protected]>

Maybe this is due to the auto-rotation of the author and committer. We like the auto-rotation of the author and committer.

@kejadlen
Copy link
Owner

kejadlen commented Jun 6, 2017

This happens because git-together passes the --signoff command to commit and merge. (That's what adds the Signed-off-by text in the commit message.) A possible (and probably pretty safe) fix would be to not pass --signoff when --amend is in the argument list.

@professor
Copy link
Contributor Author

That is cool. I'm told that git-duet does the same thing. It is annoying for both tools =)

@khuddlefish
Copy link

In addition to adding multiple "Signed-off-by" lines, it also resets the committer variable. In the above commit, this would say something like "Larry committed with Larry" when it gets pushed to github and Todd would actually not be referenced. This seems like less than ideal to me.

@khuddlefish
Copy link

@kejadlen Would it be possible to go ahead and remove the --signoff when amend is in the argument list? Having it there is definitely causing us some pain.

@kejadlen
Copy link
Owner

Yup, totally - this is high up on my todo list, but I haven't gotten around to working on git-together in a while. Next thing I do, I promise! :)

@khuddlefish
Copy link

Awesome, thank you :)

@xinzweb
Copy link

xinzweb commented Dec 8, 2017

Just a suggestion, if we don't alias the git with git-together, then git commit --amend will work. In most scenarios, only the first commit should use the git-together commit to rotate the author and committers. Thanks.

ipsi added a commit to ipsi/git-together that referenced this issue Dec 19, 2019
Add a config option, git-together.co-authored, which will switch
git-together from using Signed-off-by to Co-authored-by.

This makes it easier to support mobbing, as all authors are included in
the commit message, and this is supported by GitHub (c.f.
https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors
). This is mutually exlusive with signing off commits - you have to
choose one or the other. This is mostly because it doesn't make sense to
include a single extra committer as the one who signed it off, but it
also means that, in the event that a commit _must_ be signed off, e.g.,
when committing to the Linux Kernel, you don't lose information.

This is a little fragile, as we are parsing multiple git options, and
potentially reading from stdin, as there are at least six different ways
to create a commit message in Git, four of which we care about, and two
of which we should at least acknowledge, even though we don't modify
them in any way.

This also fixes kejadlen#20 by excluding --signoff from the list of args when
using --amend.
ipsi added a commit to ipsi/git-together that referenced this issue May 21, 2020
Add a config option, git-together.co-authored, which will switch
git-together from using Signed-off-by to Co-authored-by.

This makes it easier to support mobbing, as all authors are included in
the commit message, and this is supported by GitHub (c.f.
https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors
). This is mutually exlusive with signing off commits - you have to
choose one or the other. This is mostly because it doesn't make sense to
include a single extra committer as the one who signed it off, but it
also means that, in the event that a commit _must_ be signed off, e.g.,
when committing to the Linux Kernel, you don't lose information.

This is a little fragile, as we are parsing multiple git options, and
potentially reading from stdin, as there are at least six different ways
to create a commit message in Git, four of which we care about, and two
of which we should at least acknowledge, even though we don't modify
them in any way.

This also fixes kejadlen#20 by excluding --signoff from the list of args when
using --amend.
@ipsi ipsi linked a pull request May 21, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants