git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git <git@vger.kernel.org>, "Junio C Hamano" <gitster@pobox.com>,
	"Frédéric Brière" <fbriere@fbriere.net>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [PATCH] checkout: do not switch branch during a rebase unless -f is given
Date: Tue, 28 Sep 2010 15:47:50 +1000	[thread overview]
Message-ID: <AANLkTin19PREB3B68s+ejsgtXwe3CBxZF-caCvRp4UXv@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinUudOXmhKW-+rkcpzb-VNnSBLZwGZcjrS6UdMu@mail.gmail.com>

2010/9/28 Jonathan Nieder <jrnieder@gmail.com>:
> (+cc: Frédéric, Dscho, Christian)
>
> Nguyễn Thái Ngọc Duy wrote:
>
>> 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.

Right. I used git-rebase from my installation, the new "git checkout"
from worktree and missed that as a result.

> 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?

No. But I don't like the idea of making scripts use "checkout -f". My
intention was to stop users from doing that, not scripts. Putting "-f"
everywhere might have more negative side effects.

Maybe adding "--porcelain" to checkout first, updating scripts to use
it, then only check for rebase/bisect/am when --porcelain is missing.
-- 
Duy

  reply	other threads:[~2010-09-28  5:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  4:52 [PATCH] commit: do not switch branch during a rebase unless -f is given Nguyễn Thái Ngọc Duy
2010-09-28  4:55 ` [PATCH] checkout: " Nguyễn Thái Ngọc Duy
2010-09-28  5:33   ` Jonathan Nieder
2010-09-28  5:47     ` Nguyen Thai Ngoc Duy [this message]
2010-11-09 13:40       ` Nguyen Thai Ngoc Duy
2010-11-09 14:06         ` Jonathan Nieder
2010-11-09 14:11           ` Sverre Rabbelier
2010-11-09 14:36             ` Jonathan Nieder
2010-11-09 14:15           ` Nguyen Thai Ngoc Duy
2010-11-09 14:38             ` Jonathan Nieder
2010-09-28  5:38 ` [PATCH] commit: " Junio C Hamano
2010-09-28 11:24 ` Sverre Rabbelier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTin19PREB3B68s+ejsgtXwe3CBxZF-caCvRp4UXv@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=fbriere@fbriere.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).