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

Re: "git checkout" branch switching safety broken in 'next'

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 10, 2008, 14:38 UTC
Message-ID
<alpine.LFD.1.00.0803100735530.5896@woody.linux-foundation.org>
In-Reply-To
<7vmyp7j8ui.fsf@gitster.siamese.dyndns.org>
On Mon, 10 Mar 2008, Junio C Hamano wrote:
>
> Linus, please be careful when switching branches if you are using your
> unpack_trees() patch (in 'next') for production.  There is a breakage that
> makes switching branches with "git checkout" lose your work-in-progress.

Ouch. I've been using those patches "in production" since posting them, but since I don't generally use branches on the kernel (it happens, but it's rare), I wouldn't have noticed.

And in git, it probably wouldn't have triggered for me, since it looks like it would only trigger for changes in subdirectories, not in the top level (which is probably also why it passed all the tests!).

My bad. Your patch looks obviously correct.
			Linus
Previous: Johannes SchindelinNext: Junio C Hamano
Message 6 of 8 in “"git checkout" branch switching safety broken in 'next'”
  1. Junio C HamanoMar 10, 2008
  2. Jakub NarebskiMar 10, 2008
  3. Jay SoffianMar 10, 2008
  4. setting git-gui localeMaxim Fridental, Mar 11, 2008
  5. Johannes SchindelinMar 11, 2008
  6. Linus TorvaldsMar 10, 2008
  7. "git diff-index" broken in 'next'Junio C Hamano, Mar 11, 2008
  8. Linus TorvaldsMar 11, 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.