From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: david@lang.hm, Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Untracked working tree files
Date: Wed, 15 Oct 2008 13:23:50 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.0810151311210.3288@nehalem.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0810151256410.3288@nehalem.linux-foundation.org>
On Wed, 15 Oct 2008, Linus Torvalds wrote:
>
> - a merge goes south with a data conflict, and since it's all automated,
> you just want to throw it away.
Actually, with your filename, I suspect the conflict would be not a real
file content, but more of a "delete" conflicting with a modification to
that file. IOW, I'm guessing that the thing you hit with
arch/x86/kernel/apic.c was that some branch you pulled:
- created that file
- deleted arch/x86/kernel/apic_[32|64].c
- the old file got marked as a rename source for the new apic.c and
there was a data conflict when trying to apply the changes.
as a result, your working tree would have that "apic.c" file in it, but
with conflict markers, and marked as unmerged.
When you then do "git reset --hard", it will just ignore unmerged entries,
and since the original tree (and the destination tree) match, and neither
of them contain apic.c either, git will totally ignore that file and not
even try to remove it (since it wasn't there originally).
> So you do "git reset --force" to do that.
It's "--hard", not "--force". Yeah, the git reset flags are insane. As is
the default action, for that matter. It's one of the earliest interfaces,
and it's stupid and reflects git internal implementations rather than what
we ended up learning about using git later. Oh, well.
But 'git checkout -f' (which is nicer from a user interface standpoint)
has the exact same logic and I think shares all the implementation. I
think they both end up just calling "git read-tree --reset -u".
It's quite possible that we should remove unmerged entries. Except that's
not how our internal 'read_cache_unmerged()' function works. It really
just ignores them, and throws them on the floor. We _could_ try to just
turn them into a (since) stage-0 entry.
Junio?
Linus
next prev parent reply other threads:[~2008-10-15 20:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-15 18:56 Untracked working tree files Andrew Morton
2008-10-15 19:09 ` david
2008-10-15 19:14 ` david
2008-10-15 19:24 ` Andrew Morton
2008-10-15 19:26 ` Andrew Morton
2008-10-15 19:32 ` Nicolas Pitre
2008-10-15 19:34 ` Nicolas Pitre
2008-10-15 19:31 ` Linus Torvalds
2008-10-15 19:42 ` david
2008-10-15 19:56 ` Linus Torvalds
2008-10-15 20:17 ` david
2008-10-15 19:49 ` Andrew Morton
2008-10-15 20:08 ` Linus Torvalds
2008-10-15 20:23 ` Andrew Morton
2008-10-16 8:42 ` Paolo Ciarrocchi
2008-10-16 9:32 ` Andrew Morton
2008-10-15 20:23 ` Linus Torvalds [this message]
2008-10-15 20:30 ` Andrew Morton
2008-10-15 22:06 ` Junio C Hamano
2008-10-15 23:00 ` [PATCH] reset --hard/read-tree --reset -u: remove unmerged new paths Junio C Hamano
2008-10-15 23:16 ` Linus Torvalds
2008-10-16 6:27 ` Junio C Hamano
2008-10-16 7:20 ` Ingo Molnar
2008-10-16 14:49 ` 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=alpine.LFD.2.00.0810151311210.3288@nehalem.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=david@lang.hm \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.