]> granicus.if.org Git - git/commitdiff
sequencer: reset the committer date before commits
authorJohannes Sixt <j6t@kdbg.org>
Wed, 18 Apr 2018 18:15:04 +0000 (20:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Apr 2018 22:36:32 +0000 (07:36 +0900)
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 <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c

index f9d1001dee9ad10e243aaeafc46fbdd13597fce7..f0bac903a0ddafae7498b15d9130a6953f29246b 100644 (file)
@@ -1148,6 +1148,8 @@ static int try_to_commit(struct strbuf *msg, const char *author,
                goto out;
        }
 
+       reset_ident_date();
+
        if (commit_tree_extended(msg->buf, msg->len, &tree, parents,
                                 oid, author, opts->gpg_sign, extra)) {
                res = error(_("failed to write commit object"));