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

Re: [PATCH v2 6/8] status: print branch info with --porcelain=v2 --branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 25, 2016, 20:30 UTC
Message-ID
<xmqqshux4g0p.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1469474750-49075-7-git-send-email-jeffhost@microsoft.com>
Jeff Hostetler <jeffhost@microsoft.com> writes:
Show 5 quoted lines
>  /*
> + * Print branch and tracking header for porcelain v2 output.
> + * This is printed when the '--branch' parameter is given.
> + *
> + *    "## branch: <commit> <head>[ <upstream>[ +<ahead> -<behind>]]<eol>"

Just FYI, the only reason why the original "short" output gives this information on a single line with ## is because it was added as an afterthought to then-existing short/porcelain format that used two letter prefix and one-line-per-path format, and the expectation was that the existing parsers for the output would ignore unknown status letters (namely "##"). Because you are inventing a new format that needs to be parsed by a brand new parser _anyway_, you do not have to mimic that old convention which was a workaround, and use a notation that mixes better with the other lines you show under the --porcelain=v2 option.

Of course if you like "## branch:" output and think it is pleasing to see, that is fine as well.

Previous: Jeff HostetlerNext: Jeff Hostetler
Message 17 of 20 in “status: V2 porcelain status”
  1. 0/8 status: V2 porcelain statusJeff Hostetler, Jul 25, 2016
  2. 1/8 status: rename long-format print routinesJeff Hostetler, Jul 25, 2016
  3. 2/8 status: cleanup API to wt_status_printJeff Hostetler, Jul 25, 2016
  4. Junio C HamanoJul 25, 2016
  5. 3/8 status: support --porcelain[=<version>]Jeff Hostetler, Jul 25, 2016
  6. Jakub NarębskiJul 25, 2016
  7. 5/8 status: print per-file porcelain v2 status dataJeff Hostetler, Jul 25, 2016
  8. Junio C HamanoJul 25, 2016
  9. Jeff HostetlerJul 26, 2016
  10. 7/8 status: update git-status.txt for --porcelain=v2Jeff Hostetler, Jul 25, 2016
  11. Jakub NarębskiJul 25, 2016
  12. Johannes SchindelinJul 26, 2016
  13. Jeff HostetlerJul 26, 2016
  14. 8/8 status: tests for --porcelain=v2Jeff Hostetler, Jul 25, 2016
  15. Johannes SchindelinJul 26, 2016
  16. 6/8 status: print branch info with --porcelain=v2 --branchJeff Hostetler, Jul 25, 2016
  17. Junio C HamanoJul 25, 2016
  18. 4/8 status: per-file data collection for --porcelain=v2Jeff Hostetler, Jul 25, 2016
  19. Junio C HamanoJul 25, 2016
  20. Jeff HostetlerJul 26, 2016

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.