From: Nguyen Thai Ngoc Duy Date: Tue, 09 Nov 2010 14:15:02 GMT Subject: Re: [PATCH] checkout: do not switch branch during a rebase unless -f is given Message-ID: In-Reply-To: <20101109140615.GA18960@burratino> 2010/11/9 Jonathan Nieder : > 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