From: Jeff King <peff@peff.net>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Charles Bailey <charles@hashpling.org>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH 2/2] (resend) stash: Don't overwrite files that have gone from the index
Date: Thu, 15 Apr 2010 03:38:56 -0400 [thread overview]
Message-ID: <20100415073856.GC27542@coredump.intra.peff.net> (raw)
In-Reply-To: <201004150933.41330.trast@student.ethz.ch>
On Thu, Apr 15, 2010 at 09:33:40AM +0200, Thomas Rast wrote:
> Charles Bailey wrote:
> > diff --git a/git-stash.sh b/git-stash.sh
> > index 908aab2..9efc544 100755
> > --- a/git-stash.sh
> > +++ b/git-stash.sh
> > @@ -87,6 +87,8 @@ create_stash () {
> > export GIT_INDEX_FILE &&
> > git read-tree -m $i_tree &&
> > git add -u &&
> > + { git diff --quiet --diff-filter=D --cached ||
> > + git diff -z --name-only --diff-filter=D --cached | xargs -0 git add --ignore-errors; } &&
>
> I think you'll also have to turn it into an 'add -f' invocation since
> the file in question could conceivably have been ignored-but-tracked,
> and straight 'add' would refuse to re-track it.
>
> (No, I don't have any good ideas on how to get rid of xargs short of
> some shell loop...)
It should probably use update-index, which has a --stdin mode, and which
doesn't care about ignores.
-Peff
PS I have not looked carefully into this issue yet, so I don't know if
the patch actually does the right thing or not.
prev parent reply other threads:[~2010-04-15 7:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 0:24 [PATCH 1/2] (resend) stash bug: stash can lose data in a file removed from the index Charles Bailey
2010-04-15 0:24 ` [PATCH 2/2] (resend) stash: Don't overwrite files that have gone " Charles Bailey
2010-04-15 7:33 ` Thomas Rast
2010-04-15 7:38 ` Jeff King [this message]
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=20100415073856.GC27542@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=charles@hashpling.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/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).