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

Bug: rebase -i creates committer time inversions on 'reword'

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 13, 2018, 16:52 UTC
Message-ID
<5f5d5b88-b3ac-ed4f-ee24-6ce2cba2bd55@kdbg.org>

I just noticed that all commits in a 70-commit branch have the same committer timestamp. This is very unusual on Windows, where rebase -i of such a long branch takes more than one second (but not more than 3 or so thanks to the builtin nature of the command!).

And, in fact, if you mark some commits with 'reword' to delay the quick processing of the patches, then the reworded commits have later time stamps, but subsequent not reworded commits receive the earlier time stamp. This is clearly not intended.

Perhaps something like this below is needed.
diff --git a/ident.c b/ident.c
index 327abe557f..2c6bff7b9d 100644
--- a/ident.c
+++ b/ident.c
@@ -178,8 +178,8 @@ const char *ident_default_email(void)
 
 static const char *ident_default_date(void)
 {
-	if (!git_default_date.len)
-		datestamp(&git_default_date);
+	strbuf_reset(&git_default_date);
+	datestamp(&git_default_date);
 	return git_default_date.buf;
 }
 
Next: Phillip Wood
Message 1 of 17 in “Bug: rebase -i creates committer time inversions on 'reword'”
  1. Johannes SixtApr 13, 2018
  2. Phillip WoodApr 14, 2018
  3. Johannes SchindelinApr 14, 2018
  4. Phillip WoodApr 16, 2018
  5. Phillip WoodApr 19, 2018
  6. Junio C HamanoApr 15, 2018
  7. Johannes SixtApr 16, 2018
  8. Junio C HamanoApr 17, 2018
  9. Phillip WoodApr 18, 2018
  10. ident: don't cache default datePhillip Wood, Apr 18, 2018
  11. Ævar Arnfjörð BjarmasonApr 18, 2018
  12. Phillip WoodApr 18, 2018
  13. Johannes SixtApr 18, 2018
  14. Junio C HamanoApr 18, 2018
  15. Phillip WoodApr 19, 2018
  16. Johannes SchindelinApr 20, 2018
  17. Phillip WoodApr 20, 2018

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.