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

Re: Suggestion on git-push --porcelain

From
Larry D'Anna <larry@elder-gods.org>
Date
Feb 10, 2010, 03:35 UTC
Message-ID
<20100210033557.GB5205@cthulhu>
In-Reply-To
<be6fef0d1002091834i1c4b202cp5afacc326bd1a4d6@mail.gmail.com>
* Tay Ray Chuan (rctay89@gmail.com) [100209 21:34]:
Show 19 quoted lines
> Hi,
> 
> this is regarding the recent patch series from Larry. (I thought
> replying to any of the patch messages was appropriate, I couldn't find
> a cover-letter, so I'm starting a new thread.)
> 
> Around June last year, a patch from Larry was made to add the
> --porcelain option, so as to produce machine-readable output regarding
> ref status.
> 
> The latest patch series goes a step further, and tries to change
> output - for example, suppressing user-friendly advice and giving "To:
> <destination>".
> 
> I think this is an untenable path - adding/suppressing output of
> certain messages for porcelain writers, while trying to keep things
> fixed enough for porcelain writers to depend on. We will also have to
> keep and eye out for future patches from adding fprintfs to stdout and
> stderr that may break porcelain scripts.

While I agree with you in principle, I'm still advocating that we make these two changes. *Especially* suppressing the advice. That advice did not exist last June, so the output format has already been changed. Also, the advice never should have gone to the standard output in the first place. All the other instances of output like that go to standard error.

As for the "To: " lines, unfortunately the lack of them was a pretty serious design flaw in the original patch :(

Show 11 quoted lines
> I believe a better approach would be to prefix messages intended for
> porcelain writers. For example, a push session might look like this:
> 
>   $ git push --porcelain
>   PORCELAIN To git://foo.com/git/myrepo.git
>   PORCELAIN uptodate refs/heads/baz:refs/heads/baz 1234ab ba4321
>   PORCELAIN nonff refs/heads/bar:refs/heads/bar 2345cd 3456de
> 
> This is an "positive" approach, in the sense that we don't remove
> anything from the current output; we just add more printf("PORCELAIN")
> lines to wherever is appropriate.

Actually, What I'm proposing is something very similar to this: I think that the output for the porcelain writer and *only* the output for the porcelain writer should go to standard output, and everything else should go to standard error.

       --larry
Previous: Junio C Hamano
Message 7 of 7 in “Suggestion on git-push --porcelain”
  1. Tay Ray ChuanFeb 10, 2010
  2. Junio C HamanoFeb 10, 2010
  3. Jeff KingFeb 10, 2010
  4. Tay Ray ChuanFeb 10, 2010
  5. Tay Ray ChuanFeb 10, 2010
  6. Junio C HamanoFeb 10, 2010
  7. Larry D'AnnaFeb 10, 2010

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.