From: Jacob Helwig <jacob.helwig@gmail.com>
To: git@vger.kernel.org
Subject: Re: PEBKAC or bug: unable to create path-like branch names
Date: Sat, 14 Nov 2009 23:55:11 -0800 [thread overview]
Message-ID: <8c9a060911142355i1e722f50uf21446524fe9cb9c@mail.gmail.com> (raw)
In-Reply-To: <20091115073628.GE5934@penguin.codegnome.org>
On Sat, Nov 14, 2009 at 23:36, Todd A. Jacobs <nospam@codegnome.org> wrote:
> On Sat, Nov 14, 2009 at 09:36:47PM -0800, Jacob Helwig wrote:
>
>> What version of git are you using? git checkout -b foo/bar/baz works
>
> I'm using 1.6.5.2 as well. Okay, try this in a temp directory, and
> you'll see what I mean:
>
> git init
> echo foo > foo
> git add foo
> git commit -m testing foo
> git checkout -b dev
> git checkout -b dev/feature/foobar
>
> The first branch works fine, but after attempting the nested branch the
> message reappears:
>
> error: unable to resolve reference refs/heads/dev/feature/foobar: Not a directory
> fatal: Failed to lock ref for update: Not a directory
>
> I can recreate this behavior at any time; it isn't just a problem with
> an existing repository.
>
> --
> "Oh, look: rocks!"
> -- Doctor Who, "Destiny of the Daleks"
>
The problem is that you have a branch dev. You can't have both a
file, and a directory with the same name.
You're trying to get git to do basically this:
% cd .git/refs/heads
% ls -l
total 0
-rw-rw-r-- 1 jhe jhe 41 2009-11-14 23:51 dev
-rw-rw-r-- 1 jhe jhe 41 2009-11-14 23:51 master
% mkdir dev
mkdir: cannot create directory `dev': File exists
You're getting the equivalent of the "cannot create directory" error.
When you have a branch with slashes in it, it gets stored as a
directory hierarchy under .git/refs/heads.
-Jacob
next prev parent reply other threads:[~2009-11-15 7:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-15 2:06 Preserving empty directories when doing a git-svn clone/rebase Steven J. Murdoch
2009-11-15 5:02 ` PEBKAC or bug: unable to create path-like branch names Todd A. Jacobs
2009-11-15 5:36 ` Jacob Helwig
2009-11-15 7:36 ` Todd A. Jacobs
2009-11-15 7:55 ` Jacob Helwig [this message]
2009-11-15 7:16 ` Daniel Barkalow
2009-11-16 3:32 ` Preserving empty directories when doing a git-svn clone/rebase Eric Wong
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=8c9a060911142355i1e722f50uf21446524fe9cb9c@mail.gmail.com \
--to=jacob.helwig@gmail.com \
--cc=git@vger.kernel.org \
/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).