git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git-checkout sometimes silently fails
Date: Tue, 6 May 2008 17:10:52 -0700	[thread overview]
Message-ID: <20080506171052.340d643e.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080506215049.GC4647@steel.home>

On Tue, 6 May 2008 23:50:49 +0200 Alex Riesen <raa.lkml@gmail.com> wrote:

> Andrew Morton, Tue, May 06, 2008 21:22:56 +0200:
> > 
> > I've had this happen before and I don't know what to do to make it stop. 
> > Usually sufficient fiddling will prevent it from happening.
> > 
> > 
> > y:/usr/src/git26> cat .git/branches/linux-next 
> > git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sfr/linux-next.git
> > 
> > y:/usr/src/git26> git-checkout master
> > Switched to branch "master"
> > y:/usr/src/git26> cat kernel/*.c|sum
> > 34439  2057
> > y:/usr/src/git26> git-checkout linux-next
> > Switched to branch "linux-next"
> > y:/usr/src/git26> cat kernel/*.c|sum     
> > 34439  2057
> 
> This is not a good indication of a failed checkout (they could point
> to the same commit, for one).

How could they?  linux-next includes a directory called ./Next and a file
in that directory called ./Next/Trees, and that is not present after the
`git-checkout linux-next'.

> Try "gitk master...linux-next" (or "git
> log master..linux-next", "git diff master linux-next")

These come up empty.  But there is a 12.4MB diff between mainline and
linux-next.

> > y:/usr/src/git26> git-checkout origin 
> > Note: moving to "origin" 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 5717922... Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
> 
> This is not an error. The commit was checked out (and HEAD was
> "detached").
> 
> > y:/usr/src/git26> cat kernel/*.c|sum          
> > 34439  2057
> 
> Again, it is no indication nothing happened. "gitk HEAD...linux-next"
> 
> > y:/usr/src/git26> git --version
> > git version 1.5.5.rc1
> > 
> > help?
> 
> Look at "git branch -av" (it shows both local and remote branches and
> commits they point to).

y:/usr/src/git26> git-branch -av | grep '^\*'
* master               5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
y:/usr/src/git26> git-checkout linux-next    
Switched to branch "linux-next"
y:/usr/src/git26> git-branch -av | grep '^\*'
* linux-next           5717922 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb

y:/usr/src/git26> ls -l Next 
ls: cannot access Next: No such file or directory

> Maybe it will give you a hint. "gitk --all" is
> interesting too, seldom though (it becomes very confusing very fast if
> you have many branches with complicated history each).

hm, lots of stuff there.


Thing is, sometimes `git-checkout linux-next' works.  Sometimes it
inexplicably doesn't work and there is no indication from git that it
didn't work.

Usually my git problems are root-caused down to my lack of a PhD in
hermeneutic metaphysiology, but not this time, methinks

  reply	other threads:[~2008-05-07  0:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 19:22 git-checkout sometimes silently fails Andrew Morton
2008-05-06 21:50 ` Alex Riesen
2008-05-07  0:10   ` Andrew Morton [this message]
2008-05-07  0:19     ` Junio C Hamano
2008-05-07  0:43       ` Andrew Morton
2008-05-07 15:09       ` J. Bruce Fields
2008-05-07  0:19     ` Jeff King
2008-05-07  0:54       ` Andrew Morton
2008-05-07  1:32         ` Björn Steinbrink
2008-05-07  8:51     ` Johannes Sixt

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=20080506171052.340d643e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /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).