Web lists-archives.com

Re: [PATCH] branch: make --show-current use already resolved HEAD

I did something that resulted in the mailing list not being cc'd.
Apologies to Junio and Daniels for the double send. :(

On Thu, Nov 08, 2018 at 10:11:02AM +0900, Junio C Hamano wrote:
> I'd prefer to see scriptors avoid using "git branch", too.
> Unlike end-user facing documentation where we promise "we do X and
> will continue to do so because of Y" to the readers, the log message
> is primarily for recording the original motivation of the change, so
> that we can later learn "we did X back then because we thought Y".
> When we want to revise X, we revisit if the reason Y is still valid.
> So in that sense, the door to "break" the scriptability is still
> open.

Over at #git, commit messages are sometimes consulted to disambiguate or
clarify certain details. Often the documentation is correct but people
dispute over interpretations.

If someone came asking if `git branch` is parsable, I would advise
against and direct them to the plumbing or format alternative. But if
someone came over with a link to this commit asking the same question,
I suspect the answer would be: it's probably safe to parse the output of
this specific option because the commit says so. Thanks for clarifying
this is wrong.

> >  
> >  static const char *head;
> >  static struct object_id head_oid;
> > +static int head_flags = 0;
> You've eliminated the "now unnecessary" helper and do everything
> inside cmd_branch(), so perhaps this can be made function local, no?

I was not sure if these 3 lines were global intentionally or if it was
just an artifact from the past. Since it looks like the latter, I'll
make them local.

Rafael Ascensão