#571050 git-core: warn on checkout while rebasing/bisecting

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Frédéric Brière
Date:
2010-05-15 21:21:30 UTC
Severity:
wishlist
#571050#5
Date:
2010-02-23 01:16:41 UTC
From:
To:
It would be nice if git would serve a big fat (optional?) warning when
switching branches while in the middle of a rebase or bisect run.  I've
made this dumb mistake a few times, and got bitten by a rebase --abort
or bisect reset that ended up sending me back several days/weeks/months
into the past.

#571050#10
Date:
2010-02-23 15:50:32 UTC
From:
To:
tags 571050 + upstream
thanks

Frédéric Brière wrote:

One related thread:
http://thread.gmane.org/gmane.comp.version-control.git/82990/focus=83049

I could swear there was an earlier discussion where your suggestion
was actually mentioned, but I couldn’t find it/not sure what came of
it.

AFAICT heavy rebasers tend to use the $PS1 support from
/etc/bash_completion.d/git or similar.  But that’s underadvertised and
fairly tool-specific.

#    3) Consider changing your PS1 to also show the current branch:
#        PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '

Yes, that sounds obnoxious.  Note that at least you can recover a new
spot to rebase on top of/a few recent bisection points by looking at
the HEAD reflog with a command like ‘git log -g HEAD@{yesterday}’.

Anyway, work on this would be welcome.  It is tricky because despite
read-tree + checkout-index + update-ref being the “plumbing” way for
scripts to get something like the effect of a checkout, many scripts
use ‘git checkout’ directly, even within git.  Sometimes it is hard to
help humans without breaking robots.

Cheers,
Jonathan

#571050#15
Date:
2010-02-23 15:57:28 UTC
From:
To:
Jonathan Nieder wrote:
[...]

which is not to say it is impossible.  For example, maybe a checkout -i
option (mimicking mv -i) would do the trick.  Someone just needs to come
up with a good UI and mock something up.