Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org,  Michael Montalbo <mmontalbo@gmail.com>,
	 Denton Liu <liu.denton@gmail.com>
Subject: Re: [PATCH] t3420-rebase-autostash: don't try to grep non-existing files
Date: Sat, 27 Jun 2026 18:45:29 -0700	[thread overview]
Message-ID: <xmqqcxxb4eva.fsf@gitster.g> (raw)
In-Reply-To: <aj90x3DsER5HASUS@szeder.dev> ("SZEDER Gábor"'s message of "Sat, 27 Jun 2026 08:59:19 +0200")

SZEDER Gábor <szeder.dev@gmail.com> writes:

> On Sun, Oct 10, 2021 at 07:28:09PM +0200, SZEDER Gábor wrote:
>> Several tests in 't3420-rebase-autostash.sh' start various rebase
>> processes that are expected to fail because of merge conflicts.  The
>> tests [1] checking that 'git rebase --quit' and autostash work
>> together as expected after such a failure then run '! grep ...' to
>> ensure that the dirty contents of the file is gone.  However, due to
>> the test repo's history and the choice of upstream branch that file
>> shouldn't exist in the conflicted state at all, and thus it shouldn't
>> exist after the subsequent 'git rebase --quit' either.  Consequently,
>> this 'grep' doesn't fail as expected, i.e. because it can't find the
>> dirty content, but instead it fails, because it can't open the file.
>> 
>> Thighten this check by using 'test_path_is_missing' instead, thereby
>> avoiding unexpected errors from 'grep' as well.
>> 
>> Previously 2745817028 (t3420-rebase-autostash: don't try to grep
>> non-existing files, 2018-08-22) fixed a couple of similar issues; this
>> one was added later in 9b2df3e8d0 (rebase: save autostash entry into
>> stash reflog on --quit, 2020-04-28).
>> 
>> [1] This patch modifies only a single test, but that test is run
>>     several times with different strategies ('--apply', '--merge', and
>>     '--interactive'), hence the plural "tests".
>> 
>> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
>> ---
>>  t/t3420-rebase-autostash.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
>> index 43fcb68f27..bbe82d2c0c 100755
>> --- a/t/t3420-rebase-autostash.sh
>> +++ b/t/t3420-rebase-autostash.sh
>> @@ -200,7 +200,7 @@ testrebase () {
>>  		git rebase --quit &&
>>  		test_when_finished git stash drop &&
>>  		test_path_is_missing $dotest/autostash &&
>> -		! grep dirty file3 &&
>> +		test_path_is_missing file3 &&
>>  		git stash show -p >actual &&
>>  		test_cmp expect actual &&
>>  		git reset --hard &&
>> -- 
>> 2.33.0.1279.g1a260bf8c2
>
> It appears that this patch might have fallen quite deep through the
> cracks... ;)

Yeah, that indeed seems to be the case.  It is surprising that
nobody even had any comment on it back then.

> But the issue this patch is addressing is still there, and the patch
> still applies cleanly after almost 5 years.

Will take a look and queue.  Thanks.

      parent reply	other threads:[~2026-06-28  1:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 17:28 [PATCH] t3420-rebase-autostash: don't try to grep non-existing files SZEDER Gábor
2026-06-27  6:59 ` SZEDER Gábor
2026-06-27  9:03   ` Phillip Wood
2026-06-27 14:27   ` Todd Zullinger
2026-06-28  1:45   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqcxxb4eva.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=mmontalbo@gmail.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox