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

Re: Problems switching branches

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 5, 2010, 08:41 UTC
Message-ID
<AANLkTinN7xE5eR7ncyr+mVhyNbz1r5Au=LFCJQgh8fMr@mail.gmail.com>
In-Reply-To
<4CD3A5D9.6070802@seznam.cz>
On Fri, Nov 5, 2010 at 1:36 PM, Maaartin-1 <grajcar1@seznam.cz> wrote:
Show 12 quoted lines
>> But your approach may be better. Yes, I think it's possible. Any
>> suggestion for checkout's new argument? --no-overwrite-untracked seems
>> too long.
>
> I would go even further: a switch called "ignorant" or "lenient"
> allowing to always switch branches in a non-destructible way. All files
> normally causing abort would be left unmodified, so you could do
> git checkout --ignorant forth; git checkout back
> and would (assuming you started in branch "back") land in the original
> state without loosing anything. Of course, this means, that the ignorant
> checkout doesn't lead you into a clean state, but that's why I'd like to
> use a switch instead of making it the default. :)

One thing to consider. If there are conflicts, I don't think we should allow this "ignorant" mode. That would mess up work tree in a bad way. And because it would leave worktree in a dirty state, maybe --dirty-worktree is suggestive.

-- 
Duy
Previous: Maaartin-1Next: Neal Kreitzinger
Message 5 of 6 in “Problems switching branches”
  1. MaaartinNov 3, 2010
  2. MaaartinNov 4, 2010
  3. Nguyen Thai Ngoc DuyNov 4, 2010
  4. Maaartin-1Nov 5, 2010
  5. Nguyen Thai Ngoc DuyNov 5, 2010
  6. Neal KreitzingerNov 24, 2010

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.