Subject: Re: [PATCH v5 3/4] builtin/stash: provide a way to export stashes to a ref

From: Junio C Hamano <[email-masked]>
Date: Mon, 12 May 2025 08:53:52 -0700

Phillip Wood <[email-masked]> writes:

> I think the commit message would be more convincing if it concentrated
> on the need to import / export chains of stashes and the convenience of
> having a dedicated command to import a stash as one can export a single
> stash with
>
>     git push <remote> refs/stash@{<n>}:refs/exported-stash
>
> and then import it with
>
>     git pull <remote> refs/exported-stash
>     git update-ref refs/stash FETCH_HEAD

Oooh, then as long as the other side has enabled reflog, you could
even do

	for n in $(seq 0 N)
	do
		git push <remote> +refs/stash@{$n}:refs/stash
	done

and we can call it done?  ;-)

> Having said that I do agree that adding these new commands is a good
> idea.

Yeah, I do not think there is no reason to oppose having an export/import
pair.