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

[PATCH 1/3] builtin/am: obey --signoff also when --rebasing

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Apr 15, 2017, 14:41 UTC
Message-ID
<20170415144103.11986-2-giuseppe.bilotta@gmail.com>
In-Reply-To
<20170415144103.11986-1-giuseppe.bilotta@gmail.com>

Signoff is handled in parse_mail(), but not in parse_mail_rebasing(), since the latter is only used when git-rebase calls git-am with the --rebasing option, and --signoff is never passed in this case.

In order to introduce (in the upcoming commits) support for `git-rebase --signoff`, we must make gi-am obey it also in the rebase case. This is trivially fixed by moving the conditional addition of the signoff from parse_mail() to the caller am_run(), after either of the parse_mail*() functions were called.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 builtin/am.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/am.c b/builtin/am.c
index f7a7a971fb..d072027b5a 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1321,9 +1321,6 @@ static int parse_mail(struct am_state *state, const char *mail)
 	strbuf_addbuf(&msg, &mi.log_message);
 	strbuf_stripspace(&msg, 0);
 
-	if (state->signoff)
-		am_signoff(&msg);
-
 	assert(!state->author_name);
 	state->author_name = strbuf_detach(&author_name, NULL);
 
@@ -1848,6 +1845,9 @@ static void am_run(struct am_state *state, int resume)
 			if (skip)
 				goto next; /* mail should be skipped */
 
+			if (state->signoff)
+				am_append_signoff(state);
+
 			write_author_script(state);
 			write_commit_msg(state);
 		}
-- 
2.12.2.765.g2bf946761b
Previous: Giuseppe BilottaNext: Giuseppe Bilotta
Message 2 of 10 in “rebase --signoff”
  1. 0/3 rebase --signoffGiuseppe Bilotta, Apr 15, 2017
  2. 1/3 builtin/am: obey --signoff also when --rebasingGiuseppe Bilotta, Apr 15, 2017
  3. 2/3 builtin/am: fold am_signoff() into am_append_signoff()Giuseppe Bilotta, Apr 15, 2017
  4. 3/3 rebase: pass --[no-]signoff option to git amGiuseppe Bilotta, Apr 15, 2017
  5. Giuseppe BilottaApr 15, 2017
  6. Junio C HamanoApr 17, 2017
  7. Junio C HamanoApr 17, 2017
  8. Giuseppe BilottaApr 17, 2017
  9. Junio C HamanoApr 18, 2017
  10. Giuseppe BilottaApr 18, 2017

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.