From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id DC43E1F5AE for ; Wed, 5 May 2021 20:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233798AbhEEUIz convert rfc822-to-8bit (ORCPT ); Wed, 5 May 2021 16:08:55 -0400 Received: from elephants.elehost.com ([216.66.27.132]:64852 "EHLO elephants.elehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbhEEUIz (ORCPT ); Wed, 5 May 2021 16:08:55 -0400 X-Virus-Scanned: amavisd-new at elehost.com Received: from gnash (cpe00fc8d49d843-cm00fc8d49d840.cpe.net.cable.rogers.com [173.33.197.34]) (authenticated bits=0) by elephants.elehost.com (8.15.2/8.15.2) with ESMTPSA id 145K7m7F049496 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 5 May 2021 16:07:49 -0400 (EDT) (envelope-from rsbecker@nexbridge.com) From: "Randall S. Becker" To: "'Yuri'" , "'Git Mailing List'" References: In-Reply-To: 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 Message-ID: <000401d741ea$5227c610$f6775230$@nexbridge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: AQMxqwy0zF/LN/3zoRDHLW3YwxXN66ggfG0A Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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