Re: [PATCH v8 4/5] rebase -i: support --ignore-date
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Aug 19, 2020, 10:22 UTC
- Message-ID
- <88535175-0540-c96d-24b5-c4d407422a8c@gmail.com>
- In-Reply-To
- <20200817174004.92455-5-phillip.wood123@gmail.com>
On 17/08/2020 18:40, Phillip Wood wrote:
Show 41 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> Rebase is implemented with two different backends - 'apply' and
> 'merge' each of which support a different set of options. In
> particular the apply backend supports a number of options implemented
> by 'git am' that are not implemented in the merge backend. This means
> that the available options are different depending on which backend is
> used which is confusing. This patch adds support for the --ignore-date
> option to the merge backend. This option uses the current time as the
> author date rather than reusing the original author date when
> rewriting commits. We take care to handle the combination of
> --ignore-date and --committer-date-is-author-date in the same way as
> the apply backend.
>
> Original-patch-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> Documentation/git-rebase.txt | 7 ++--
> builtin/rebase.c | 13 ++++---
> sequencer.c | 66 +++++++++++++++++++++++++++-------
> sequencer.h | 1 +
> t/t3436-rebase-more-options.sh | 56 +++++++++++++++++++++++++++++
> 5 files changed, 123 insertions(+), 20 deletions(-)
>
> [...]
> diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
> index 50a63d8ebe..0ede2b8900 100755
> --- a/t/t3436-rebase-more-options.sh
> +++ b/t/t3436-rebase-more-options.sh
> @@ -108,6 +108,62 @@ test_expect_success '--committer-date-is-author-date works when committing confl
> test_ctime_is_atime -1
> '
>
> +# Checking for +0000 in the author date is sufficient since the
> +# default timezone is UTC but the timezone used while committing is
> +# +0530. The inverted logic in the grep is necessary to check all the
> +# author dates in the file.
> +test_ctime_is_ignored () {
> + git log $1 --format=%ai >authortime &&
> + ! grep -v +0000 authortime
> +}I don't know what I was thinking when I wrote that - it should be called test_atime_is_ignored() as it's testing the author date
Best Wishes
Phillip