Re: [PATCH] checkout -f: do not leave untracked working tree files.

From: Carl Worth <cworth@cworth.org>
Date: 2006-06-21 00:07:11
On Tue, 20 Jun 2006 02:50:08 -0700, Junio C Hamano wrote:
> 
> Earlier we did not consider untracked working tree files
> "precious", but we have always considered them fair game to
> clobber.  These days, branch switching by read-tree is more
> careful and tries to protect untracked working tree files.  This
> caused the following workflow to stop working:
> 
> 	git checkout one-branch-with-file-F
> 	git checkout -f another-without-file-F
> 	git pull . one-branch-with-file-F

Another one that a colleague of mine hit is:

	git checkout -b branch-without-file branch-with-file
	git rm some-file
	# Allow for some external changes on branch-with-file
	git pull . branch-with-file

One possibility for fixing this case is to make git-rm delete the file
by default, (that is, act as if the current -f option is
passed). There's no real safety concern unless the file is dirty,
(could require -f again for that case).

>                 If this works out for Jeff, I can simply drop
>    the "core.oktoclobber = ask" patch from my topics -- although
>    I kind of liked that one ;-).

Fixing the behavior instead of adding configuration is definitely a
good plan.

-Carl

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Wed Jun 21 00:12:36 2006

This archive was generated by hypermail 2.1.8 : 2006-06-21 00:12:58 EST