git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Emily Shaffer <emilyshaffer@google.com>
Cc: Bryan Turner <bturner@atlassian.com>,
	jim.cromie@gmail.com, Git Users <git@vger.kernel.org>
Subject: Re: $> git branch splat response considered harmful
Date: Thu, 08 Aug 2019 14:46:37 -0700	[thread overview]
Message-ID: <xmqqo90ze3eq.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAJoAoZ=K0LhCmnEUk1rsan2J5APzcye7+RryjBG+mKgjGf6qzA@mail.gmail.com> (Emily Shaffer's message of "Thu, 8 Aug 2019 14:28:05 -0700")

Emily Shaffer <emilyshaffer@google.com> writes:

> More generally, I think you should take a look at `git help git` and
> check out the difference between "porcelain" and "plumbing" commands.
> The former, of which `git branch` is one, are intended for interactive
> use and not really meant for scripting or piping. You can usually come
> up with an equivalent from the plumbing commands, which Bryan has
> suggested for you with `git for-each-ref`.  Git project tries very
> hard to maintain output format of the plumbing commands so as to not
> break folks' scripts, but such promises aren't usually made for
> porcelain commands.

Thanks for a detailed response.

Git project promises that output format of the Porcelain commands is
subject to change, in order to support human eyeballs better.

Unless documented otherwise (e.g. "git status --porcelain"), it is
unwise to try parsing porcelain output---your script may break any
time and you get to keep both halves.

That is not the same as saying "do not script using Porcelain".
Sending the output directly to the end user (e.g. compute the
revision range in your script that finally calls "git log" using
that computed revision range) is perfectly fine.

Thanks.

  reply	other threads:[~2019-08-08 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 21:08 $> git branch splat response considered harmful jim.cromie
2019-08-08 21:20 ` Bryan Turner
2019-08-08 21:28   ` Emily Shaffer
2019-08-08 21:46     ` Junio C Hamano [this message]
2019-08-09 18:01     ` Philip Oakley
2019-08-08 21:30 ` SZEDER Gábor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo90ze3eq.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=bturner@atlassian.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=jim.cromie@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).