From: Thomas Rast <trast@student.ethz.ch>
To: Ori Avtalion <ori@avtalion.name>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH] git stash: Give friendlier error when there is nothing to apply
Date: Tue, 11 Aug 2009 14:09:02 +0200 [thread overview]
Message-ID: <200908111409.04506.trast@student.ethz.ch> (raw)
In-Reply-To: <4a81559c.05ae660a.591b.010b@mx.google.com>
Ori Avtalion wrote:
> apply_stash () {
> + have_stash || die 'Nothing to apply'
> +
> git update-index -q --refresh &&
> git diff-files --quiet --ignore-submodules ||
> die 'Cannot apply to a dirty working tree, please stage your changes'
>
This needs a guard against the case where the user says
git stash apply $some_sha1
but his refs/stash is empty. This could be the case, e.g., after
mistakenly blowing away the reflog with 'git stash clear' and then
going on a recovery hunt through the unreferenced commits.
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2009-08-11 12:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 11:12 [PATCH] git stash: Give friendlier error when there is nothing to apply Ori Avtalion
2009-08-11 12:09 ` Thomas Rast [this message]
2009-08-11 11:12 ` [PATCH] git stash: Give friendlier errors " Ori Avtalion
2009-08-13 7:35 ` Thomas Rast
2009-08-14 19:52 ` Junio C Hamano
2009-08-14 21:39 ` Nanako Shiraishi
2009-08-15 1:50 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908111409.04506.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=ori@avtalion.name \
/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.
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 NNTP newsgroup(s).