mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: "Randall S. Becker" <>
Cc: "'Yuri'" <>, "'Git Mailing List'" <>
Subject: Re: [feature suggestion] Add 'git stash export', 'git stash import' commands to allow to backup stash externally
Date: Thu, 06 May 2021 11:22:56 +0900	[thread overview]
Message-ID: <xmqq1rak1tz3.fsf@gitster.g> (raw)
In-Reply-To: <000401d741ea$5227c610$f6775230$> (Randall S. Becker's message of "Wed, 5 May 2021 16:07:42 -0400")

"Randall S. Becker" <> writes:

> I would like to suggest another option: Teach clone and fetch to
> transfer stash commits. They are filtered out normally. It might
> be straightforward to preserve the stashed commits. A mirror
> approach is probably not appropriate since that needs the repo to
> be bare and Yuri's situation is unlikely to support that. So
> something like --include-stashes, which would be off by default.

It would unfortunately not work, since stash is not implemented as a
set of regular refs.  Instead its entries are kept in reflogs.  And
because the reflog is treated as an entierly local matter, reflog
entries are not transfered across fetches and clones.

If stash are redesigned so that each of its entry becomes a separate
ref (e.g. refs/stash/0 refs/stash/1 refs/stash/2 ...), then

    git bundle stash.bndl $(git for-each-ref --format='%(refname)' refs/stash/\*)

might become the beginning of a viable implementation of "stash
export" (but note that the above does not list any stopping point of
the history traversal, so it is just the beginning and does not make
a practical solution).

  parent reply	other threads:[~2021-05-06  2:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 19:51 [feature suggestion] Add 'git stash export', 'git stash import' commands to allow to backup stash externally Yuri
2021-05-05 20:07 ` Randall S. Becker
2021-05-05 20:11   ` Yuri
2021-05-06  2:22   ` Junio C Hamano [this message]
2021-05-06  6:07 ` Johannes Sixt
2021-05-06  6:12   ` Yuri
2021-05-06  6:43     ` Johannes Sixt
2021-05-06  6:58       ` Yuri
2021-05-06  8:38         ` Junio C Hamano
2021-05-06  8:41           ` Yuri
2021-05-06  9:09             ` Junio C Hamano
2021-05-06 10:23             ` Felipe Contreras
2021-05-06  8:40         ` Felipe Contreras
2021-05-06  8:45           ` Yuri
2021-05-06 10:45             ` Felipe Contreras
2021-05-06 14:10             ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1rak1tz3.fsf@gitster.g \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).