Re: Subject: [RFC] stash: let the stash stack live in a configurable ref
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 24, 2026, 14:58 UTC
- Message-ID
- <xmqqfr03sgyu.fsf@gitster.g>
- In-Reply-To
- <91feddb6-0d1b-42af-9942-307b98aa747d@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> On a related note I've been meaning to add an option to specify an > alternative branch name when creating a stash, so that "git checkout -m" > and "git rebase --autostash <upstream> <branch>" can record the branch > that we're switching to, rather than the one that's currently checked > out when creating stashes.
Interesting. I think we have seen ideas floated to allow per-branch and per-worktree stashes in the past. I am not sure how much we should rely on the stash message, though. The more heavily we rely on it, the more restricted the end-user messages supplied via the '-m' option would become. If we were to officially support per-branch stashes, we may have to adopt a more structured format (which could be something simple like "at the end of the message after the last ':' is the name of the branch the stash entry targets", alongside a tweak to the '-m' option to always append ': target-branch' after whatever the user gives as the message).