Re: [PATCH v5 4/4] builtin/stash: provide a way to import stashes from a ref
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 12, 2025, 12:42 UTC
- Message-ID
- <xmqq5xi6xaov.fsf@gitster.g>
- In-Reply-To
- <20250510172107.GA601540@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 28 quoted lines
> On Thu, May 08, 2025 at 11:44:57PM +0000, brian m. carlson wrote:
>
>> +test_expect_success 'stash export and import round-trip stashes' '
>> [...]
>> + git stash export --to-ref refs/heads/foo &&
>
> Here we export to a name in the refs/heads/ namespace...
>
>> +test_expect_success 'stash export can accept specified stashes' '
>> [...]
>> + git stash export --to-ref bar stash@{1} stash@{0} &&
>
> ...but here we are writing to the top-level .git/bar. We do currently
> allow that, but there's been discussion of locking this down a bit
> further (requiring BAR or even BAR_HEAD at the top-level). Should this
> be refs/heads/bar?
>
>> +test_expect_success 'stash can import and export zero stashes' '
>> [...]
>> + git stash export --to-ref baz &&
>
> Ditto here.
>
> I noticed because I have a patch series from last summer tightening
> these rules (it got derailed by some conflicting work, and I've been
> meaning to pick it back up). I can certainly adjust these tests as part
> of that series, but if you're re-rolling anyway, it might be nice to do
> it now.True, and exported one is a sort-of-normal-looking isolated history, so it does not have any strong reason to be at the top level. But I am curious what your plans are to deal with .git/refs/stash itself?
Thanks.