git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin-commit.c: Not add duplicate S-o-b when commit

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 26, 2012, 16:44 UTC
Message-ID
<7vpq7i8oag.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CANYiYbH0Jfk0LLp8HXVEamD0uRzM2OGJCE8W4h_UoDLh1pMVHA@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 10 quoted lines
> 2012/7/26 Junio C Hamano <gitster@pobox.com>:
>> After stating the observation like the above, please make it a habit
>> to say "which is bad because...", if you think it is a bad behaviour
>> and the patch is about fixing it.
>
> Indead before I start, I examine git-commit and git-am, and find
> the behaviours of the two commands are different.
>
> "git commit -s" checks the last line of the footer, while "git -am"
> checks the last S-o-b.
I think "git am -s" (which I think you meant) is wrong, then.
Show 7 quoted lines
> E.g. original commit X:
>
>     commit log...
>
>     Signed-off-by: A
>     Signed-off-by: B
>     Reported-by: C

The order in this "original" is already wrong, isn't it, though? Didn't the change result by first C reporting an issue, fixes done by A and forwarded by B?

Show 17 quoted lines
> When user B amend the commit, the amended commit Y looks like:
>
>     commit log...
>
>     Signed-off-by: A
>     Signed-off-by: B
>     Reported-by: C
>     Signed-off-by: B
>
> While if the original commit X send to user B by patch, and
> user B run command "git am -s", the commit would be:
>
>     Signed-off-by: A
>     Signed-off-by: B
>     Reported-by: C
>
> So I guess duplicate S-o-b is not intentional.

I think the two commands are doing randomly different things on garbage input. The order in the input (i.e. your "original") does not make sense. C is not the person who handled the patch the last.

If you start from
	Reported-by: X
	S-o-b: A
	Reviewed-by: Y
        S-o-b: B

i.e. the last person who touched this patch is B, tweaking the patch and amending a commit will add S-o-b for the person who amends, iff that person is not B, which is what you usually want.

Show 6 quoted lines
> I use an alias for commit:
>
>     git config --global alias.ci "commit -s"
>
> And will encounter duplicate S-o-b issues frequently, especially
> format-patch/send-email workflow.
Previous: Jiang XinNext: Jiang Xin
Message 4 of 5 in “builtin-commit.c: Not add duplicate S-o-b when commit”
  1. builtin-commit.c: Not add duplicate S-o-b when commitJiang Xin, Jul 26, 2012
  2. Junio C HamanoJul 26, 2012
  3. Jiang XinJul 26, 2012
  4. Junio C HamanoJul 26, 2012
  5. Jiang XinJul 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.