git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: "fatal: Untracked working tree file 'so-and-so' would be overwritten by merge"
Date: Sun, 8 Oct 2006 17:11:01 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610081657400.3952@g5.osdl.org> (raw)


Hmm. I'm getting this message annoyingly often, simply because a few files 
that used to be tracked are now generated, and so they exist in my tree 
but are no longer tracked.

However, they may be tracked in an older tree that I pull, because in that 
older tree they _do_ exist, and we get the

	fatal: Untracked working tree file 'so-and-so' would be overwritten by merge.

which is actually incorrect, because the merge result will not even 
_contain_ that untracked file any more.

So the message is misleading - we should only consider this a fatal thing 
if we actually do generate that file as part of a git-read-tree, but if a 
merge won't touch a file, it shouldn't be "overwritten".

It's true that if the _other_ end actually removed a file that we used to 
have (ie the file _disappears_ as part of the merge), then we should 
verify that that file matched what we're going to remove, but if the old 
index didn't contain the file at all, and the new index won't contain it 
either, it really should be a no-op.

IOW, I think there is one "verify_absent()" too many somewhere, where we 
check this unnecessarily. I think it's the one in "deleted_entry()" in 
unpack-trees.c, but I'm not sure.

		Linus

             reply	other threads:[~2006-10-09  0:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09  0:11 Linus Torvalds [this message]
2006-10-09  4:48 ` "fatal: Untracked working tree file 'so-and-so' would be overwritten by merge" Junio C Hamano
2006-10-09  5:20   ` Junio C Hamano
2006-10-09  5:48     ` [RFC/PATCH] merge: loosen overcautious "working file will be lost" check Junio C Hamano
2006-10-09 17:20       ` Luben Tuikov
2006-10-09 22:47         ` Junio C Hamano
2006-10-10  0:01           ` Luben Tuikov
2006-10-10  0:19             ` Junio C Hamano
2006-10-10  0:59               ` Luben Tuikov
2006-10-09 16:03     ` "fatal: Untracked working tree file 'so-and-so' would be overwritten by merge" Linus Torvalds
2006-10-09 16:55       ` Junio C Hamano
2006-10-10  6:32       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0610081657400.3952@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).