git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: "Martin Ågren" <martin.agren@gmail.com>,
	"Phillip Wood" <phillip.wood@dunelm.org.uk>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v3 0/2] stash: fix and improve "git stash -p <pathspec>"
Date: Mon, 9 Jun 2025 10:42:17 +0100	[thread overview]
Message-ID: <a66483fb-5bc4-42b5-b361-c900a69015ed@gmail.com> (raw)
In-Reply-To: <CAN0heSotWpNmqd905aknVTfk6WEcYifAwbXBKYfAWkhzxua3ZA@mail.gmail.com>

Hi Martin

On 07/06/2025 13:56, Martin Ågren wrote:
> Hi Phillip,
> 
> On Sat, 7 Jun 2025 at 11:45, Phillip Wood <phillip.wood123@gmail.com> wrote:
> [...]
> This range-diff matches what I'd expect. Now this test makes sure we
> really pick up the `-p`. On that note ... I just realized that all of
> these would keep the test passing:
> 
>   test_write_lines s y n | git stash -p file # what you have
>   test_write_lines s y n | git stash -p file otherfile
>   test_write_lines s y n | git stash -p .
>   test_write_lines s y n | git stash -p
> 
> So the implementation under test could bungle the pathspec, query the
> user for both `file` and `otherfile` (in that order!), get EOF from
> stdin while handling `otherfile`, leave it out of the stash, and end up
> passing the test. We could try to protect against this by providing
> another "y": if git wants to read something after our "s y n" sequence,
> we'll give it a "y" in the hopes that it will trip things up. We do want
> to test the handling of pathspecs here, so maybe tighten this?

Junio has merged this to next now. I was hoping that we would already 
have coverage for this with other tests but I couldn't see anything so 
I'll look at improving the coverage for "git stash push -p <pathspec>" 
in the next release cycle.

Thanks

Phillip


  reply	other threads:[~2025-06-09  9:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 14:58 [PATCH] stash: allow "git stash -p <pathspec>" to assume push again Phillip Wood
2025-05-16 19:10 ` Junio C Hamano
2025-05-20  9:21   ` Phillip Wood
2025-05-20  9:26 ` [PATCH v2 0/2] stash: fix and improve "git stash -p <pathspec>" Phillip Wood
2025-05-20  9:26   ` [PATCH v2 1/2] stash: allow "git stash -p <pathspec>" to assume push again Phillip Wood
2025-06-06 11:31     ` Martin Ågren
2025-06-06 15:26       ` Phillip Wood
2025-05-20  9:27   ` [PATCH v2 2/2] stash: allow "git stash [<options>] --patch <pathspec>" to assume push Phillip Wood
2025-06-06 11:32     ` Martin Ågren
2025-05-21 13:04   ` [PATCH v2 0/2] stash: fix and improve "git stash -p <pathspec>" Junio C Hamano
2025-06-03 22:11   ` Junio C Hamano
2025-06-06 11:39     ` Martin Ågren
2025-06-07  9:45 ` [PATCH v3 " Phillip Wood
2025-06-07  9:45   ` [PATCH v3 1/2] stash: allow "git stash -p <pathspec>" to assume push again Phillip Wood
2025-06-07  9:45   ` [PATCH v3 2/2] stash: allow "git stash [<options>] --patch <pathspec>" to assume push Phillip Wood
2025-06-07 12:56   ` [PATCH v3 0/2] stash: fix and improve "git stash -p <pathspec>" Martin Ågren
2025-06-09  9:42     ` Phillip Wood [this message]
2025-06-10  9:56       ` Martin Ågren

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=a66483fb-5bc4-42b5-b361-c900a69015ed@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.agren@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).