git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Directory in one branch, file in another = can't switch branches
@ 2007-03-16 22:17 Steven Grimm
  2007-03-16 22:59 ` Steven Grimm
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Grimm @ 2007-03-16 22:17 UTC (permalink / raw)
  To: git

We've hit this problem with a git-svn-based repository where some stuff 
got reorganized, but it happens in plain git too; if you have a branch 
with a file called, say, "foo" and another branch with a file called 
"foo/bar", you can't switch between branches even if there are no 
uncommitted edits in either branch.

To reproduce (I'm using version 1.5.0.1.74.g2470):

% git init-db
Initialized empty Git repository in .git/
% echo "this is a test file" > testing
% git add testing
% git commit -a -m "initial commit on master"
Created initial commit 1a9cb1bf3a5475f0bb05d1e7c59839ba0a388be7
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 testing
% git checkout -b with-dir
Switched to a new branch "with-dir"
% mv testing testing-
% mkdir testing
% mv testing- testing/datafile
% git add testing/datafile
% git commit -a -m "commit with subdir"      
Created commit cdcb2af2a8dae8a2c5c3c143cb00b4863291cc17
 2 files changed, 1 insertions(+), 1 deletions(-)
 delete mode 100644 testing
 create mode 100644 testing/datafile
% git checkout master
fatal: Untracked working tree file 'testing' would be overwritten by merge.

You can work around it by renaming the directory, but git should really 
blow away the directory if it doesn't contain any untracked / modified 
files.

-Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Directory in one branch, file in another = can't switch branches
  2007-03-16 22:17 Directory in one branch, file in another = can't switch branches Steven Grimm
@ 2007-03-16 22:59 ` Steven Grimm
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Grimm @ 2007-03-16 22:59 UTC (permalink / raw)
  To: git

Ah, I see someone else picked up on this from IRC already ("bug in 
read-tree -m on A -> A/A"). Sorry for the noise; please ignore this thread.

-Steve


Steven Grimm wrote:
> We've hit this problem with a git-svn-based repository where some 
> stuff got reorganized, but it happens in plain git too; if you have a 
> branch with a file called, say, "foo" and another branch with a file 
> called "foo/bar", you can't switch between branches even if there are 
> no uncommitted edits in either branch.
>
> To reproduce (I'm using version 1.5.0.1.74.g2470):
>
> % git init-db
> Initialized empty Git repository in .git/
> % echo "this is a test file" > testing
> % git add testing
> % git commit -a -m "initial commit on master"
> Created initial commit 1a9cb1bf3a5475f0bb05d1e7c59839ba0a388be7
> 1 files changed, 1 insertions(+), 0 deletions(-)
> create mode 100644 testing
> % git checkout -b with-dir
> Switched to a new branch "with-dir"
> % mv testing testing-
> % mkdir testing
> % mv testing- testing/datafile
> % git add testing/datafile
> % git commit -a -m "commit with subdir"      Created commit 
> cdcb2af2a8dae8a2c5c3c143cb00b4863291cc17
> 2 files changed, 1 insertions(+), 1 deletions(-)
> delete mode 100644 testing
> create mode 100644 testing/datafile
> % git checkout master
> fatal: Untracked working tree file 'testing' would be overwritten by 
> merge.
>
> You can work around it by renaming the directory, but git should 
> really blow away the directory if it doesn't contain any untracked / 
> modified files.
>
> -Steve
> -
> 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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-16 22:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-16 22:17 Directory in one branch, file in another = can't switch branches Steven Grimm
2007-03-16 22:59 ` Steven Grimm

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).