From: Junio C Hamano <gitster@pobox.com>
To: Jing Xue <jingxue@digizenstudio.com>
Cc: git <git@vger.kernel.org>
Subject: Re: file deletion in index lost after checkout -b
Date: Sat, 06 Sep 2008 11:10:32 -0700 [thread overview]
Message-ID: <7vej3xrvqf.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080906171108.GA10924@jabba.hq.digizenstudio.com> (Jing Xue's message of "Sat, 6 Sep 2008 13:11:08 -0400")
Jing Xue <jingxue@digizenstudio.com> writes:
> On Thu, Sep 04, 2008 at 11:12:26PM -0700, Junio C Hamano wrote:
>> [jc: please redirect an answer _meant for you_ off to the list with M-F-T header]
>
> I changed mutt to not use M-F-T with the git list at all. Hope this one
> turns out better.
Thanks; I meant to say "please do not redirect", but you got what I wanted
to say correctly.
>> > The deletion of 2.txt appears lost during 'checkout -b foo', while the
>> > modification and addition were both brought over. Is it a bug?
>>
>> This behaviour is unchanged since early June 2005.
>>
>> http://thread.gmane.org/gmane.comp.version-control.git/4641/focus=4646
>>
>> This is exactly the case marked as *0*, which both Linus and I said "it
>> feels somewhat wrong but otherwise we cannot start from an empty index".
>>
>> We may want to do better this time around, though.
>
> I have since found out that:
>
> 1. file deletions in the working directory but not in index would not be forgotten. That
> makes "file deletions in index" case rather a corner one.
>
> 2. "checkout -b -m" would do the right thing.
Both correct. 1. does not involve case *0*; 2. does not do two-tree
switch but internally uses three-tree switch and uses different codepath.
next prev parent reply other threads:[~2008-09-06 18:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 3:44 file deletion in index lost after checkout -b Jing Xue
2008-09-05 6:12 ` Junio C Hamano
2008-09-06 17:11 ` Jing Xue
2008-09-06 18:10 ` Junio C Hamano [this message]
2008-09-08 2:49 ` Re* " Junio C Hamano
2008-09-09 2:06 ` Jing Xue
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=7vej3xrvqf.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jingxue@digizenstudio.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.
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).