From patchwork Fri Oct 23 07:08:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11852337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02878C388F9 for ; Fri, 23 Oct 2020 07:08:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC2BB2168B for ; Fri, 23 Oct 2020 07:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S373884AbgJWHIo (ORCPT ); Fri, 23 Oct 2020 03:08:44 -0400 Received: from cloud.peff.net ([104.130.231.41]:40174 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S373872AbgJWHIo (ORCPT ); Fri, 23 Oct 2020 03:08:44 -0400 Received: (qmail 26426 invoked by uid 109); 23 Oct 2020 07:08:44 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 23 Oct 2020 07:08:44 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13470 invoked by uid 111); 23 Oct 2020 07:08:43 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 23 Oct 2020 03:08:43 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 23 Oct 2020 03:08:43 -0400 From: Jeff King To: VenomVendor Cc: Junio C Hamano , Phillip Wood , git@vger.kernel.org Subject: [PATCH 1/3] t3436: check --committer-date-is-author-date result more carefully Message-ID: <20201023070843.GA2913115@coredump.intra.peff.net> References: <20201023070747.GA2198273@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201023070747.GA2198273@coredump.intra.peff.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org After running "rebase --committer-date-is-author-date", we confirm that the committer date is the same as the author date. However, we don't look at any other parts of the committer ident line to make sure we didn't screw them up. And indeed, there are a few bugs here. Depending on the rebase backend in use, we may accidentally use the author email instead of the committer's, or even an empty string. Let's teach our test_ctime_is_atime helper to check the committer name and email, which reveals several failing tests. Signed-off-by: Jeff King --- t/t3436-rebase-more-options.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh index 996e82787e..6f2f49717b 100755 --- a/t/t3436-rebase-more-options.sh +++ b/t/t3436-rebase-more-options.sh @@ -65,31 +65,31 @@ test_expect_success '--ignore-whitespace is remembered when continuing' ' ' test_ctime_is_atime () { - git log $1 --format=%ai >authortime && - git log $1 --format=%ci >committertime && + git log $1 --format="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> %ai" >authortime && + git log $1 --format="%cn <%ce> %ci" >committertime && test_cmp authortime committertime } -test_expect_success '--committer-date-is-author-date works with apply backend' ' +test_expect_failure '--committer-date-is-author-date works with apply backend' ' GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author && git rebase --apply --committer-date-is-author-date HEAD^ && test_ctime_is_atime -1 ' -test_expect_success '--committer-date-is-author-date works with merge backend' ' +test_expect_failure '--committer-date-is-author-date works with merge backend' ' GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author && git rebase -m --committer-date-is-author-date HEAD^ && test_ctime_is_atime -1 ' -test_expect_success '--committer-date-is-author-date works with rebase -r' ' +test_expect_failure '--committer-date-is-author-date works with rebase -r' ' git checkout side && GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 && git rebase -r --root --committer-date-is-author-date && test_ctime_is_atime ' -test_expect_success '--committer-date-is-author-date works when forking merge' ' +test_expect_failure '--committer-date-is-author-date works when forking merge' ' git checkout side && GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 && PATH="./test-bin:$PATH" git rebase -r --root --strategy=test \ @@ -145,7 +145,7 @@ test_expect_success '--reset-author-date works with rebase -r' ' test_atime_is_ignored ' -test_expect_success '--reset-author-date with --committer-date-is-author-date works' ' +test_expect_failure '--reset-author-date with --committer-date-is-author-date works' ' test_must_fail git rebase -m --committer-date-is-author-date \ --reset-author-date --onto commit2^^ commit2^ commit3 && git checkout --theirs foo && From patchwork Fri Oct 23 07:09:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11852341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A109C388F9 for ; Fri, 23 Oct 2020 07:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11C232168B for ; Fri, 23 Oct 2020 07:09:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S373889AbgJWHJk (ORCPT ); Fri, 23 Oct 2020 03:09:40 -0400 Received: from cloud.peff.net ([104.130.231.41]:40190 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S373874AbgJWHJk (ORCPT ); Fri, 23 Oct 2020 03:09:40 -0400 Received: (qmail 26449 invoked by uid 109); 23 Oct 2020 07:09:40 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 23 Oct 2020 07:09:40 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13496 invoked by uid 111); 23 Oct 2020 07:09:39 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 23 Oct 2020 03:09:39 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 23 Oct 2020 03:09:39 -0400 From: Jeff King To: VenomVendor Cc: Junio C Hamano , Phillip Wood , git@vger.kernel.org Subject: [PATCH 2/3] am: fix broken email with --committer-date-is-author-date Message-ID: <20201023070939.GB2913115@coredump.intra.peff.net> References: <20201023070747.GA2198273@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201023070747.GA2198273@coredump.intra.peff.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Commit e8cbe2118a (am: stop exporting GIT_COMMITTER_DATE, 2020-08-17) rewrote the code for setting the committer date to use fmt_ident(), rather than setting an environment variable and letting commit_tree() handle it. But it introduced two bugs: - we use the author email string instead of the committer email - when parsing the committer ident, we used the wrong variable to compute the length of the email, resulting in it always being a zero-length string This commit fixes both, which causes our test of this option via the rebase "apply" backend to now succeed. Signed-off-by: Jeff King --- builtin/am.c | 4 ++-- t/t3436-rebase-more-options.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 2c7673f74e..4949535a7f 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -161,7 +161,7 @@ static void am_state_init(struct am_state *state) state->committer_name = xmemdupz(id.name_begin, id.name_end - id.name_begin); state->committer_email = - xmemdupz(id.mail_begin, id.mail_end - id.mail_end); + xmemdupz(id.mail_begin, id.mail_end - id.mail_begin); } /** @@ -1595,7 +1595,7 @@ static void do_commit(const struct am_state *state) if (state->committer_date_is_author_date) committer = fmt_ident(state->committer_name, - state->author_email, WANT_COMMITTER_IDENT, + state->committer_email, WANT_COMMITTER_IDENT, state->ignore_date ? NULL : state->author_date, IDENT_STRICT); diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh index 6f2f49717b..3fda2235bd 100755 --- a/t/t3436-rebase-more-options.sh +++ b/t/t3436-rebase-more-options.sh @@ -70,7 +70,7 @@ test_ctime_is_atime () { test_cmp authortime committertime } -test_expect_failure '--committer-date-is-author-date works with apply backend' ' +test_expect_success '--committer-date-is-author-date works with apply backend' ' GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author && git rebase --apply --committer-date-is-author-date HEAD^ && test_ctime_is_atime -1 From patchwork Fri Oct 23 07:10:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11852339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4BBCC388F9 for ; Fri, 23 Oct 2020 07:10:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53BC72168B for ; Fri, 23 Oct 2020 07:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S375609AbgJWHKQ (ORCPT ); Fri, 23 Oct 2020 03:10:16 -0400 Received: from cloud.peff.net ([104.130.231.41]:40198 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S373896AbgJWHKQ (ORCPT ); Fri, 23 Oct 2020 03:10:16 -0400 Received: (qmail 26467 invoked by uid 109); 23 Oct 2020 07:10:15 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 23 Oct 2020 07:10:15 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13520 invoked by uid 111); 23 Oct 2020 07:10:15 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 23 Oct 2020 03:10:15 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 23 Oct 2020 03:10:15 -0400 From: Jeff King To: VenomVendor Cc: Junio C Hamano , Phillip Wood , git@vger.kernel.org Subject: [PATCH 3/3] rebase: fix broken email with --committer-date-is-author-date Message-ID: <20201023071015.GC2913115@coredump.intra.peff.net> References: <20201023070747.GA2198273@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201023070747.GA2198273@coredump.intra.peff.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Commit 7573cec52c (rebase -i: support --committer-date-is-author-date, 2020-08-17) copied the committer ident-parsing code from builtin/am.c. And in doing so, it copied a bug in which we always set the email to an empty string. We fixed the version in git-am in the previous commit; this commit fixes the copied code. Reported-by: VenomVendor Signed-off-by: Jeff King --- sequencer.c | 2 +- t/t3436-rebase-more-options.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sequencer.c b/sequencer.c index 00acb12496..d76cbded00 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4478,7 +4478,7 @@ static int init_committer(struct replay_opts *opts) opts->committer_name = xmemdupz(id.name_begin, id.name_end - id.name_begin); opts->committer_email = - xmemdupz(id.mail_begin, id.mail_end - id.mail_end); + xmemdupz(id.mail_begin, id.mail_end - id.mail_begin); return 0; } diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh index 3fda2235bd..eaaf4c8d1d 100755 --- a/t/t3436-rebase-more-options.sh +++ b/t/t3436-rebase-more-options.sh @@ -76,20 +76,20 @@ test_expect_success '--committer-date-is-author-date works with apply backend' ' test_ctime_is_atime -1 ' -test_expect_failure '--committer-date-is-author-date works with merge backend' ' +test_expect_success '--committer-date-is-author-date works with merge backend' ' GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author && git rebase -m --committer-date-is-author-date HEAD^ && test_ctime_is_atime -1 ' -test_expect_failure '--committer-date-is-author-date works with rebase -r' ' +test_expect_success '--committer-date-is-author-date works with rebase -r' ' git checkout side && GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 && git rebase -r --root --committer-date-is-author-date && test_ctime_is_atime ' -test_expect_failure '--committer-date-is-author-date works when forking merge' ' +test_expect_success '--committer-date-is-author-date works when forking merge' ' git checkout side && GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 && PATH="./test-bin:$PATH" git rebase -r --root --strategy=test \ @@ -145,7 +145,7 @@ test_expect_success '--reset-author-date works with rebase -r' ' test_atime_is_ignored ' -test_expect_failure '--reset-author-date with --committer-date-is-author-date works' ' +test_expect_success '--reset-author-date with --committer-date-is-author-date works' ' test_must_fail git rebase -m --committer-date-is-author-date \ --reset-author-date --onto commit2^^ commit2^ commit3 && git checkout --theirs foo && From patchwork Fri Oct 23 07:26:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11852387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBE4EC388F9 for ; Fri, 23 Oct 2020 07:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E6C02177B for ; Fri, 23 Oct 2020 07:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S374239AbgJWH0c (ORCPT ); Fri, 23 Oct 2020 03:26:32 -0400 Received: from cloud.peff.net ([104.130.231.41]:40210 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368666AbgJWH0c (ORCPT ); Fri, 23 Oct 2020 03:26:32 -0400 Received: (qmail 26594 invoked by uid 109); 23 Oct 2020 07:26:30 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 23 Oct 2020 07:26:30 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13626 invoked by uid 111); 23 Oct 2020 07:26:30 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 23 Oct 2020 03:26:30 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 23 Oct 2020 03:26:30 -0400 From: Jeff King To: VenomVendor Cc: Junio C Hamano , Phillip Wood , git@vger.kernel.org Subject: [PATCH 4/3] am, sequencer: stop parsing our own committer ident Message-ID: <20201023072630.GA2918369@coredump.intra.peff.net> References: <20201023070747.GA2198273@coredump.intra.peff.net> <20201023070939.GB2913115@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201023070939.GB2913115@coredump.intra.peff.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Oct 23, 2020 at 03:09:39AM -0400, Jeff King wrote: > Commit e8cbe2118a (am: stop exporting GIT_COMMITTER_DATE, 2020-08-17) > rewrote the code for setting the committer date to use fmt_ident(), > rather than setting an environment variable and letting commit_tree() > handle it. But it introduced two bugs: > > - we use the author email string instead of the committer email > > - when parsing the committer ident, we used the wrong variable to > compute the length of the email, resulting in it always being a > zero-length string By the way, I wondered why we needed to do this parsing at all. The patch below does this in a much simpler way. It's a little bit ugly, I think, because we have to call getenv() ourselves. But that's the way fmt_ident() has always worked. We could probably improve that now that it takes a whose_ident flag (before that, it had no idea if we wanted author or committer ident). This is on top of the fixes (but we'd perhaps just want to do those on 'maint' as the minimal fix). -- >8 -- Subject: [PATCH 4/3] am, sequencer: stop parsing our own committer ident For the --committer-date-is-author-date option of git-am and git-rebase, we format the committer ident, then re-parse it to find the name and email, and then feed those back to fmt_ident(). We can simplify this by handling it all at the time of the fmt_ident() call. We pass in the appropriate getenv() results, and if they're not present, then our WANT_COMMITTER_IDENT flag tells fmt_ident() to fill in the appropriate value from the config. Which is exactly what git_committer_ident() was doing under the hood. Signed-off-by: Jeff King --- builtin/am.c | 19 +++---------------- sequencer.c | 28 ++-------------------------- sequencer.h | 2 -- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 4949535a7f..52206bc56b 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -98,8 +98,6 @@ struct am_state { char *author_name; char *author_email; char *author_date; - char *committer_name; - char *committer_email; char *msg; size_t msg_len; @@ -132,8 +130,6 @@ struct am_state { */ static void am_state_init(struct am_state *state) { - const char *committer; - struct ident_split id; int gpgsign; memset(state, 0, sizeof(*state)); @@ -154,14 +150,6 @@ static void am_state_init(struct am_state *state) if (!git_config_get_bool("commit.gpgsign", &gpgsign)) state->sign_commit = gpgsign ? "" : NULL; - - committer = git_committer_info(IDENT_STRICT); - if (split_ident_line(&id, committer, strlen(committer)) < 0) - die(_("invalid committer: %s"), committer); - state->committer_name = - xmemdupz(id.name_begin, id.name_end - id.name_begin); - state->committer_email = - xmemdupz(id.mail_begin, id.mail_end - id.mail_begin); } /** @@ -173,8 +161,6 @@ static void am_state_release(struct am_state *state) free(state->author_name); free(state->author_email); free(state->author_date); - free(state->committer_name); - free(state->committer_email); free(state->msg); strvec_clear(&state->git_apply_opts); } @@ -1594,8 +1580,9 @@ static void do_commit(const struct am_state *state) IDENT_STRICT); if (state->committer_date_is_author_date) - committer = fmt_ident(state->committer_name, - state->committer_email, WANT_COMMITTER_IDENT, + committer = fmt_ident(getenv("GIT_COMMITTER_NAME"), + getenv("GIT_COMMITTER_EMAIL"), + WANT_COMMITTER_IDENT, state->ignore_date ? NULL : state->author_date, IDENT_STRICT); diff --git a/sequencer.c b/sequencer.c index d76cbded00..07321a7d95 100644 --- a/sequencer.c +++ b/sequencer.c @@ -314,8 +314,6 @@ int sequencer_remove_state(struct replay_opts *opts) } } - free(opts->committer_name); - free(opts->committer_email); free(opts->gpg_sign); free(opts->strategy); for (i = 0; i < opts->xopts_nr; i++) @@ -1460,8 +1458,8 @@ static int try_to_commit(struct repository *r, } else { reset_ident_date(); } - committer = fmt_ident(opts->committer_name, - opts->committer_email, + committer = fmt_ident(getenv("GIT_COMMITTER_NAME"), + getenv("GIT_COMMITTER_EMAIL"), WANT_COMMITTER_IDENT, opts->ignore_date ? NULL : date.buf, IDENT_STRICT); @@ -4467,22 +4465,6 @@ static int commit_staged_changes(struct repository *r, return 0; } -static int init_committer(struct replay_opts *opts) -{ - struct ident_split id; - const char *committer; - - committer = git_committer_info(IDENT_STRICT); - if (split_ident_line(&id, committer, strlen(committer)) < 0) - return error(_("invalid committer '%s'"), committer); - opts->committer_name = - xmemdupz(id.name_begin, id.name_end - id.name_begin); - opts->committer_email = - xmemdupz(id.mail_begin, id.mail_end - id.mail_begin); - - return 0; -} - int sequencer_continue(struct repository *r, struct replay_opts *opts) { struct todo_list todo_list = TODO_LIST_INIT; @@ -4494,9 +4476,6 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts) if (read_populate_opts(opts)) return -1; if (is_rebase_i(opts)) { - if (opts->committer_date_is_author_date && init_committer(opts)) - return -1; - if ((res = read_populate_todo(r, &todo_list, opts))) goto release_todo_list; @@ -5391,9 +5370,6 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla res = -1; - if (opts->committer_date_is_author_date && init_committer(opts)) - goto cleanup; - if (checkout_onto(r, opts, onto_name, &oid, orig_head)) goto cleanup; diff --git a/sequencer.h b/sequencer.h index b2a501e445..f925e349c5 100644 --- a/sequencer.h +++ b/sequencer.h @@ -50,8 +50,6 @@ struct replay_opts { int mainline; - char *committer_name; - char *committer_email; char *gpg_sign; enum commit_msg_cleanup_mode default_msg_cleanup; int explicit_cleanup;