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

Re: Pressing Ctrl-C during 'git checkout <branch-name>' messes up the repository

From
YYuri <yuri@rawbw.com>
Date
Jul 17, 2023, 00:16 UTC
Message-ID
<9e5b5818-6107-134f-b4ce-3a6028417838@tsoft.com>
In-Reply-To
<ZLM4sTUjBQt4QMfG@tapette.crustytoothpaste.net>
On 7/15/23 17:24, brian m. carlson wrote:
> If you don't want to interrupt the operation, then don't hit Ctrl-C.
A more comprehensive way to handle this is to offer the user a choice:
Ctrl-C was pressed during a long operation. Please choose:

(1) press Ctrl-C again to stop immediately while likely leaving the repository in inconsistent state

(2) press C to continue
(3) press R to roll back the current operation

And if the user would press Ctrl-C again during the rollback - he would be presented with choices:

Ctrl-C was pressed during the roll back of a long operation. Please choose:

(1) press Ctrl-C again to stop immediately while likely leaving the repository in inconsistent state

(2) press C to continue the rollback

This would be a lot better than to just stop immediately and leave the repository damaged.

Yuri
Previous: Junio C HamanoNext: Konstantin Khomoutov
Message 4 of 6 in “Pressing Ctrl-C during 'git checkout <branch-name>' messes up the repository”
  1. YuriJul 15, 2023
  2. brian m. carlsonJul 16, 2023
  3. Junio C HamanoJul 16, 2023
  4. YuriJul 17, 2023
  5. Konstantin KhomoutovJul 17, 2023
  6. Andreas SchwabJul 17, 2023

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.