Thread (25 messages) flat view 25 messages, 4 authors, 2016-06-15

Re: [PATCH 4/4] builtin-remote: add set-head verb

From: Jeff King <hidden>
Date: 2016-06-15 22:46:10

Possibly related (same subject, not in this thread)

On Fri, Feb 13, 2009 at 09:59:06PM -0500, Jay Soffian wrote:
What should we show in the output of "git remote show origin" next to
the HEAD line? master, or frotz? If we show master, then user might
wonder why "git remote set-head origin --auto" leaves
refs/remotes/origin/HEAD set to frotz. If we show frotz, then user
might wonder why when they cloned the repo in the first place they
ended up with HEAD set to master.

I'm bothered by that inconsistency, which is why I didn't follow-up
with another patch immediately.
Hrm. Yeah, I think to avoid surprising the user, "--auto" has to use
whatever we showed in "git remote show".
But I will propose an alternative. In the output of "get remote show
origin", we show all matching branches. If the user does a set-head
--auto and we cannot determine HEAD unambiguously, we do something
like:

$ git remote set-head origin --auto
error: Multiple branches match HEAD. Please choose one explicitly with:
   git remote set-head origin master
   git remote set-head origin frotz
I like that proposal. It doesn't hide from the user that we are doing a
matching guess, which means we are less likely to surprise them in the
long run.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help