Volume XXII, number 279Tuesday, October 6, 2026Latest message 36 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

[RFC] git stash: add porcelain for sharing stashes through remotes

3 messages between Oct 1, 2026 and Oct 1, 2026, from Hanan Arshad, D. Ben Knoble, Junio C Hamano.

Plain Markdown or JSON for tools and agents.

Hanan ArshadOct 1, 2026, 08:53 UTC on lore
Hi,

I'd like to propose adding a small porcelain workflow for sharing stashes through a Git remote.

git stash export and git stash import already provide a transportable representation of stashes. I tested the following workflow using existing commands:

Alice:
  git stash export --print stash@{0}
  git push origin <export-tip>:refs/stashes/alice/wip
Bob:
  git fetch origin refs/stashes/alice/wip:refs/shared-stashes/origin/alice/wip
  git stash import refs/shared-stashes/origin/alice/wip

The imported stash is a normal local stash and retains the original stash object ID. Removing the remote ref afterward does not affect Bob's imported stash.

I'd like to add porcelain around this existing mechanism for four operations:
1. publish a selected stash to a remote
2. list available shared stashes
3. get a shared stash as a normal local stash
4. remove a shared stash from the remote
This would not introduce a new stash object format, server-side
service, or synchronization model. It would essentially compose the
existing export/import mechanism with normal push/fetch operations.
Before working on an implementation, I'd appreciate feedback on a few
design points:
1. What remote ref namespace would be appropriate?
2. Should shared stashes use an explicit user-provided name or an object-derived identifier?
3. Should listing only inspect remote refs, or fetch the export commits so stash messages can also be displayed?
4. What command naming would fit best with the existing git stash interface?

If the general direction seems reasonable, I can follow up with a more concrete interface and implementation.

Thanks, Hanan Arshad

D. Ben KnobleOct 1, 2026, 22:02 UTC in reply to Hanan Arshad on lore

Re: [RFC] git stash: add porcelain for sharing stashes through remotes

On Thu, Oct 1, 2026 at 5:37 AM Hanan Arshad <hananarshad619@gmail.com> wrote:
>
> Hi,

Hi Hanan, did you mean to send a copy of your prior thread (https://lore.kernel.org/git/CAKPibBw2XxjGpE_DZrWLZmMHs7kAyvOaP8504kfoh61c4UkGyg@mail.gmail.com/) ?

-- 
D. Ben Knoble
Junio C HamanoOct 1, 2026, 22:16 UTC in reply to D. Ben Knoble on lore

Re: [RFC] git stash: add porcelain for sharing stashes through remotes

"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 7 quoted lines
> On Thu, Oct 1, 2026 at 5:37 AM Hanan Arshad <hananarshad619@gmail.com> wrote:
>>
>> Hi,
>
> Hi Hanan, did you mean to send a copy of your prior thread
> (https://lore.kernel.org/git/CAKPibBw2XxjGpE_DZrWLZmMHs7kAyvOaP8504kfoh61c4UkGyg@mail.gmail.com/)
> ?

Perhaps they sent a wrong message after they composed a message to respond to the excellent idea-review made by Brian?

Back to recent threads