Re: [PATCH 2/2] status: print stash info with --porcelain=v2 --show-stash

2 messages, 2 authors, 2021-10-22 · open the first message on its own page

Re: [PATCH 2/2] status: print stash info with --porcelain=v2 --show-stash

From: Junio C Hamano <hidden>
Date: 2021-10-22 00:29:52

Eric Sunshine [off-list ref] writes:
quoted
+       test_when_finished "git stash pop && git stash pop" &&
If it's indeed important to clean up the stashes when the test
finishes, then the test_when_finished() invocation should probably be
a bit more robust...
quoted
+       git stash -- file_x &&
+       git stash &&
... since, as it is now, if an error occurs between these two
git-stash invocations or before them, then there will only be zero or
one stashes, so the double stash-pop by test_when_finished() will
itself errout out. Better, perhaps to do this:

    test_when_finished "git stash pop && git stash pop || :" &&
quoted
+       git status --porcelain=v2 --branch --show-stash --untracked-files=no >actual &&
+       test_cmp expect actual
+'
There is no "I do not care what is in the stash right now, just
clear all"?

Re: [PATCH 2/2] status: print stash info with --porcelain=v2 --show-stash

From: Eric Sunshine <hidden>
Date: 2021-10-22 01:19:48

On Thu, Oct 21, 2021 at 8:30 PM Junio C Hamano [off-list ref] wrote:
Eric Sunshine [off-list ref] writes:
quoted
quoted
+       test_when_finished "git stash pop && git stash pop" &&
If it's indeed important to clean up the stashes when the test
finishes, then the test_when_finished() invocation should probably be
a bit more robust...
quoted
+       git stash -- file_x &&
+       git stash &&
... since, as it is now, if an error occurs between these two
git-stash invocations or before them, then there will only be zero or
one stashes, so the double stash-pop by test_when_finished() will
itself errout out. Better, perhaps to do this:

    test_when_finished "git stash pop && git stash pop || :" &&
There is no "I do not care what is in the stash right now, just
clear all"?
Indeed, I wondered that too but was too lazy to look and I had
forgotten about `git stash clear`, which makes this much simpler:

    test_when_finished "git stash clear" &&
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help