From: Jeff King Date: Sat, 14 Feb 2009 03:43:45 GMT Subject: Re: [PATCH 4/4] builtin-remote: add set-head verb Message-ID: <20090214034345.GB24545@coredump.intra.peff.net> In-Reply-To: <76718490902131859u4645dc62h79632cb20ee90d69@mail.gmail.com> 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