git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Hanan Arshad <hananarshad619@gmail.com>
Date
Oct 5, 2026, 09:06 UTC
Message-ID
<CAKPibBwjRSb5cXd2iWo8bbYby1odcXNazEg-D9hcqbehrR6g3w@mail.gmail.com>
In-Reply-To
<7012706b-516b-4cd9-abf3-0144093e0779@kdbg.org>
Hi Hannes,

Thanks, I agree with your point after looking more closely at the existing behavior.

I had overstated what a git stash publish command would add. For a single stash, Git already handles the essential operation directly:

    git push origin stash@{0}:refs/stashes/hanan/fix-login

So I agree that adding git stash publish would mostly duplicate functionality that already exists in one command, and I do not plan to pursue it.

The narrower proposal I am considering now is only around the parts of the temporary handoff workflow that are less convenient today:

- discovering available remote stash refs,
- fetching one and storing it as a normal local stash entry,
- removing the remote ref when it is no longer needed.
Publishing would remain ordinary git push.
For example, conceptually:
    git stash list --remote <remote> <ref-pattern>
    git stash get <remote> <remote-ref>
    git stash remove <remote> <remote-ref>

These would only be porcelain around existing ls-remote, fetch/stash store, and remote ref deletion. There would still be no new stash representation, server-side mechanism, tracking relationship, or mandatory namespace.

I think this is a more accurate scope for the original shelf-like workflow I had in mind.

Thanks, Hanan

On Mon, 5 Oct 2026 10:21:03 +0200, Johannes Sixt <j6t@kdbg.org> wrote:
Show 26 quoted lines
> Am 05.10.26 um 10:03 schrieb Hanan Arshad:
> > The use case I have in mind is narrower: temporarily handing off an
> > unfinished working state to another clone or developer, without first
> > turning that state into a normal branch workflow.
>
> Understood. But you don't do this ten times a day, so...
>
> > The question I am trying to answer is therefore not really "should
> > stashes become collaborative objects?", but rather:
> >
> > Is there value in providing a small convenience command around an
> > already-supported stash transport workflow, so users do not have to
> > understand and manually compose the lower-level ref/export/import
> > steps?
>
> ... why do you need convenience? A simple export plus a push or even
> just a single push command are all that is required today.
>
> So, IMHO, there is zero reason to upgrade stashes so that they can
> achieve the exact same thing that we can already do with branches.
>
> (Hence, if indeed you do share your half-finsihed work ten times a day,
> then, please, by all means, use the right tool for the task: put your
> work on a branch, not in a stash.)
>
> -- Hannes
Previous: Johannes SixtNext: Junio C Hamano
Message 7 of 10 in “[RFC] git stash: add porcelain for sharing stashes through remotes”
  1. Hanan ArshadSep 28, 2026
  2. brian m. carlsonSep 29, 2026
  3. Hanan ArshadOct 5, 2026
  4. Johannes SixtOct 5, 2026
  5. Hanan ArshadOct 5, 2026
  6. Johannes SixtOct 5, 2026
  7. Hanan ArshadOct 5, 2026
  8. Junio C HamanoOct 5, 2026
  9. Hanan ArshadOct 7, 2026
  10. Johannes SixtOct 7, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.