Re: [PATCH] checkout: do not switch branch during a rebase unless -f is given
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 28, 2010, 05:33 UTC
- Message-ID
- <AANLkTinUudOXmhKW-+rkcpzb-VNnSBLZwGZcjrS6UdMu@mail.gmail.com>
- In-Reply-To
- <1285649702-24773-1-git-send-email-pclouds@gmail.com>
(+cc: Frédéric, Dscho, Christian)
Nguyễn Thái Ngọc Duy wrote:
Show 6 quoted lines
> It does not make much sense to switch branch when you are in a middle > of a rebase. Sometimes you might want to switch away for a moment then > back with "git checkout - ". But I find myself so many times switching > away then forget that I was rebasing something. > > Avoid doing that by default. Users can use -f if they really want to.
Nice! But I worry is that scripts that use "git checkout" porcelain during a rebase would be broken.
Even rebase --interactive uses checkout from time to time:
- for preserving merges - to move to the correct branch in response to "git rebase -i <upstream> <branch>" - to move to the target in "git rebase -i --onto <new base> <upstream>"
Unfortunately I do not have any good advice. Would it make sense to
- first, change these call sites in git to use checkout -f - teach checkout to warn (without erroring out) to give people time to change their scripts - warn loudly about the upcoming change in the release notes - later, change checkout to error out when -f is not supplied
or am I being too paranoid?
> I know there are other commands like rebase ("git am" comes to mind)
> but I don't use those. Feel free to put some more on top if somebody
> finds it a good thing to do.Another interesting one is "git bisect".