git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Rafael Ascensão <rafa.almas@gmail.com>
Date
Nov 8, 2018, 04:36 UTC
Message-ID
<20181108043621.izmneiyjvgzd22uc@rigel>
In-Reply-To
<xmqqa7mk9xw9.fsf@gitster-ct.c.googlers.com>

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:
Show 11 quoted lines
> 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.

Show 8 quoted lines
> >  
> >  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

Previous: Junio C Hamano
Message 8 of 8 in “branch: introduce --show-current display option”
  1. branch: introduce --show-current display optionDaniels Umanovskis, Oct 25, 2018
  2. Eric SunshineOct 25, 2018
  3. Junio C HamanoOct 26, 2018
  4. Jeff KingNov 1, 2018
  5. Junio C HamanoOct 26, 2018
  6. branch: make --show-current use already resolved HEADRafael Ascensão, Nov 7, 2018
  7. Junio C HamanoNov 8, 2018
  8. Rafael AscensãoNov 8, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.