git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Yuri'" <yuri@rawbw.com>, "'Git Mailing List'" <git@vger.kernel.org>
Subject: RE: [feature suggestion] Add 'git stash export', 'git stash import' commands to allow to backup stash externally
Date: Wed, 5 May 2021 16:07:42 -0400	[thread overview]
Message-ID: <000401d741ea$5227c610$f6775230$@nexbridge.com> (raw)
In-Reply-To: <d8aef355-0718-8b3d-7e9f-614673dd250f@rawbw.com>

On May 5, 2021 3:52 PM, Yuri wrote:
>Subject: [feature suggestion] Add 'git stash export', 'git stash import' commands
>to allow to backup stash externally
>
>I work in a very large repository, but all of it except for my stashed items can be
>re-downloaded from the remote URL.
>
>
>Stash though is much smaller in size and is especially valuable. Its
>loss would be very expensive.
>
>
>Could you please consider adding 'git stash export', 'git stash import'
>commands so that in case of an accidental repository loss stash can be
>imported from the external backup?

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.

As a side potential defect/bug, if you fetch refs/stash, git is happy to comply and reports the HEAD update and then loses it. git show-refs does not show the stash. What I saw on the fetch was (I only had untracked files in my stash to make things more painful) as follows in 2.29.1:

$ git fetch origin refs/stash
From /path-to-repo
 * branch              refs/stash -> FETCH_HEAD

-Randall


  reply	other threads:[~2021-05-05 20:08 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 [this message]
2021-05-05 20:11   ` Yuri
2021-05-06  2:22   ` Junio C Hamano
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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='000401d741ea$5227c610$f6775230$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=yuri@rawbw.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://80x24.org/mirrors/git.git

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).