All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artur Skawina <art.08.09@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: git failing to create new branches, depending on the name
Date: Sat, 08 Aug 2009 17:32:55 +0200	[thread overview]
Message-ID: <4A7D9AA7.1030709@gmail.com> (raw)

One of my build scripts, which takes a 'work' git tree, clones it to
make a build tree, then creates an unique branch there and goes on
to do the rest of the work, started mysteriously failing recently
.
Turns out git doesn't like the branch names that my script is
choosing and git-checkout fails with a misleading fatal error.
I don't remember changing the script recently and it used to work
for months, something must have changed.

This is what i did while trying to find why the checkout is failing:

+ git --version
git version 1.6.4
+ rm -rf /tmp/build-tree
+ git clone -l -s -n -o askern --reference /tmp/work-tree /tmp/work-tree /tmp/build-tree
Initialized empty Git repository in /tmp/build-tree/.git/
+ cd /tmp/build-tree
+ git branch -a | grep g90bc1a6 
+ git checkout -f -b branch-g90bc1a6 askern/release
fatal: git checkout: branch branch-g90bc1a6 already exists
# WTF?
+ (
+  cd /tmp/work-tree
+  git branch -a | grep g90bc1a6
+ )
# nothing in parent repo either.
+ git checkout -f branch-g90bc1a6 
Checking out files: 100% (29109/29109), done.
Note: moving to 'branch-g90bc1a6' which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 90bc1a6... Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
# so where is coming from?
+ git branch -a | grep g90bc1a6
+ git status
# Not currently on any branch.
nothing to commit (working directory clean)
+  git show --pretty=short 90bc1a6 | cat
commit 90bc1a658a53f8832ee799685703977a450e5af9
Merge: 6ce90c4 54822de
Author: Linus Torvalds <torvalds@linux-foundation.org>

    Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
# Aha

So what appears to be happening is that the script picks up the
90bc1a6 suffix (it gets it from git-describe), uses it as part
of the branch name and then git misinterprets it.
(the actual names used by the script are much longer, i used
"branch-g90bc1a6" only to figure what was going on)

artur

             reply	other threads:[~2009-08-08 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08 15:32 Artur Skawina [this message]
2009-08-08 17:04 ` git failing to create new branches, depending on the name Thomas Rast
2009-08-08 17:33   ` Artur Skawina
2009-08-08 17:35 ` Daniel Barkalow

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=4A7D9AA7.1030709@gmail.com \
    --to=art.08.09@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 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.