git-rbr icon indicating copy to clipboard operation
git-rbr copied to clipboard

Ignore, or warn softer, when a ref that'll be left behind is a remote-tracking branch

Open gnprice opened this issue 7 years ago • 0 comments

In general we're super careful not to do anything where we don't 100% understand what we're doing and what the user might expect, and in particular we balk when the relationships between the ref we're operating on and all the other related refs are in a situation we don't explicitly understand.

One situation that we currently don't have a provision for -- so we safely refuse to do anything -- but probably should support is when a ref we're going to leave behind is a remote-tracking branch refs/remotes/.... Example error message:

$ git rbr
Warning: Some refs based on branch 'docs' are not its descendants in the
Git "upstream" metadata!  This means that a recursive rebase won't touch them,
and will leave them behind atop the old version of the commits we rewrite.

Specifically:
  These refs are not branches:
    refs/remotes/me/docs

Fix with 'git branch -u' aka '--set-upstream-to', and examine the situation
with 'git branch -vv'.

Or to proceed anyway, pass '--orphan' to 'git rbr' to skip this check.

I think it'd be fine to just proceed in this situation. Maybe print a one-line warning, preferably at the end so the user is most likely to see it.

gnprice avatar Jun 08 '17 20:06 gnprice