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

Re: git-checkout changes the index but not the checked out files?

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Apr 23, 2007, 20:16 UTC
Message-ID
<46a038f90704231316r3a94c46cl8e1dd2a9dbccbea@mail.gmail.com>
In-Reply-To
<alpine.LFD.0.98.0704230747110.9964@woody.linux-foundation.org>
On 4/24/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 6 quoted lines
> On Mon, 23 Apr 2007, Martin Langhoff wrote:
> > The _really_ strange bit is that it was attempting to merge 2 heads of
> > the same name. It'd probably be something to block...
>
> No, "git-read-tree -m A B" is not a "merge" in the sense you're thinking,
> it's a "fast-forward merge", ie just a "move from A to B"
...
> So when we move from one head to another, we do that two-way thing. And if
> A and B are the same, doesn't really do anything, but there's also no
> point to try to avoid doing it.

Yup - except that the logic in git-commit wasn't expecting this at all, so it never said "fast-forwarding" and most importantly, it changed the index, and the checked out files, but didn't update the head it was aiming for.

There is definitely a bug when heads are ambiguous. Will try and find some time to fix it up in the coming days but I'm quite cornered with work here so if anyone wants to have a look at it...

cheers,
martin
Previous: Linus TorvaldsNext: Uwe Kleine-König
Message 7 of 8 in “git-checkout changes the index but not the checked out files?”
  1. Martin LanghoffApr 22, 2007
  2. Junio C HamanoApr 22, 2007
  3. Martin LanghoffApr 23, 2007
  4. Junio C HamanoApr 23, 2007
  5. Martin LanghoffApr 23, 2007
  6. Linus TorvaldsApr 23, 2007
  7. Martin LanghoffApr 23, 2007
  8. Uwe Kleine-KönigApr 23, 2007

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.