Subject: Re: [PATCH v9 4/4] checkout: -m (--merge) uses autostash when switching branches

From: Jeff King <[email-masked]>
Date: Sat, 11 Apr 2026 15:07:41 -0400

On Sat, Apr 11, 2026 at 02:38:23PM -0400, Jeff King wrote:

> Our enforcement of these rules has some holes, but I have a local series
> to fix that (which is how I noticed the problem). The entry continues to
> list some exceptions:
> 
>   There are some irregular refs in the root of the hierarchy that do not
>   match these rules. The following list is exhaustive and shall not be
>   extended in the future:
> 
>     •   AUTO_MERGE
> 
>     •   BISECT_EXPECTED_REV
> 
>     •   NOTES_MERGE_PARTIAL
> 
>     •   NOTES_MERGE_REF
> 
>     •   MERGE_AUTOSTASH
> 
> We can add CHECKOUT_AUTOSTASH to the list of exceptions, but I wonder if
> there is another name we could use that would conform to the usual
> rules.

Actually, I misread the documentation I quoted as "list is not
exhaustive". ;) So we would be violating its promise to add
CHECKOUT_AUTOSTASH to the list.

-Peff