git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-checkout sometimes silently fails

From
Jeff King <peff@peff.net>
Date
May 7, 2008, 00:19 UTC
Message-ID
<20080507001919.GA8633@sigill.intra.peff.net>
In-Reply-To
<20080506171052.340d643e.akpm@linux-foundation.org>
On Tue, May 06, 2008 at 05:10:52PM -0700, Andrew Morton wrote:
Show 15 quoted lines
> > > 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'.

But you don't show us that in your example. There is nothing in your example to indicate that they are not simply pointing at the same commit...

Show 5 quoted lines
> > 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.

And if these all come up empty, then they _are_ pointing to the same commit. When you say "but there is a 12.4MB diff..." do you mean "there _should_ be such a diff?" In that case, it seems that your linux-next ref is pointing to an unexpected commit.

So the problem is not with git-checkout, but rather that you are not checking out what you think you are checking out. And so we need to figure out how you got into that state.

What command did you use to create the linux-next branch? Have you used git-reset to move the branch tip around?

-Peff
Previous: J. Bruce FieldsNext: Andrew Morton
Message 7 of 10 in “git-checkout sometimes silently fails”
  1. Andrew MortonMay 6, 2008
  2. Alex RiesenMay 6, 2008
  3. Andrew MortonMay 7, 2008
  4. Junio C HamanoMay 7, 2008
  5. Andrew MortonMay 7, 2008
  6. J. Bruce FieldsMay 7, 2008
  7. Jeff KingMay 7, 2008
  8. Andrew MortonMay 7, 2008
  9. Björn SteinbrinkMay 7, 2008
  10. Johannes SixtMay 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.