Skip to content

Commit 12f7bab

Browse files
j6tgitster
authored andcommitted
sequencer: reset the committer date before commits
Now that the sequencer commits without forking when the commit message isn't edited all the commits that are picked have the same committer date. If a commit is reworded it's committer date will be a later time as it is created by running an separate instance of 'git commit'. If the reworded commit is follow by further picks, those later commits will have an earlier committer date than the reworded one. This is caused by git caching the default date used when GIT_COMMITTER_DATE is not set. Reset the cached date before a commit is generated in-process. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 468165c commit 12f7bab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sequencer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,8 @@ static int try_to_commit(struct strbuf *msg, const char *author,
11481148
goto out;
11491149
}
11501150

1151+
reset_ident_date();
1152+
11511153
if (commit_tree_extended(msg->buf, msg->len, &tree, parents,
11521154
oid, author, opts->gpg_sign, extra)) {
11531155
res = error(_("failed to write commit object"));

0 commit comments

Comments
 (0)