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

Re: [PATCH] checkout: do not switch branch during a rebase unless -f is given

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 9, 2010, 14:15 UTC
Message-ID
<AANLkTi=VtP=T7PwY-PcZ9sHy0FjU8Nj=Fe1eWc44Q+OE@mail.gmail.com>
In-Reply-To
<20101109140615.GA18960@burratino>
2010/11/9 Jonathan Nieder <jrnieder@gmail.com>:
Show 21 quoted lines
> Nguyen Thai Ngoc Duy wrote:
>
>> Another approach is to let checkout work as usual, but refuse update refs:
>>
>>  - after rebase starts, HEAD can only be updated either by rebase, or
>> any commands that keep HEAD a headless ref.
>>  - the branch being rebased is locked. No commands but rebase can update it.
>>
>> I think the second point is good for all interactive commands like
>> rebase. Create a .lock file with a signature inside (e.g. command
>> name). If update_ref() callers do not give correct signature, refuse
>> to update.
>
> I like it.  Would it be possible to make sure the (widespread?) practice
> of using
>
>        rm -fr .git/rebase-merge
>
> to terminate a rebase without going back to the original branch
> still works?  I think it should be.
>

I don't know. If we can place the branch lock inside .git/rebase-merge, then yes removing that directory will also remove the lock. But how does git find the locks if they are everywhere in .git?

-- 
Duy
Previous: Jonathan NiederNext: Jonathan Nieder
Message 9 of 12 in “commit: do not switch branch during a rebase unless -f is given”
  1. commit: do not switch branch during a rebase unless -f is givenNguyễn Thái Ngọc Duy, Sep 28, 2010
  2. checkout: do not switch branch during a rebase unless -f is givenNguyễn Thái Ngọc Duy, Sep 28, 2010
  3. Jonathan NiederSep 28, 2010
  4. Nguyen Thai Ngoc DuySep 28, 2010
  5. Nguyen Thai Ngoc DuyNov 9, 2010
  6. Jonathan NiederNov 9, 2010
  7. Sverre RabbelierNov 9, 2010
  8. Jonathan NiederNov 9, 2010
  9. Nguyen Thai Ngoc DuyNov 9, 2010
  10. Jonathan NiederNov 9, 2010
  11. Junio C HamanoSep 28, 2010
  12. Sverre RabbelierSep 28, 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.