git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Larry D'Anna <larry@elder-gods.org>, git@vger.kernel.org
Subject: Re: [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain
Date: Wed, 10 Feb 2010 00:39:37 -0500	[thread overview]
Message-ID: <20100210053937.GF28526@coredump.intra.peff.net> (raw)
In-Reply-To: <7viqa7cqs9.fsf@alter.siamese.dyndns.org>

On Mon, Feb 08, 2010 at 02:21:26PM -0800, Junio C Hamano wrote:

> I think the purpose of the patches that started this thread was to admit
> that 1965ff7 (add --porcelain option to git-push, 2009-06-22) was not well
> thought out, and to break compatibility to fix it.

I thought it was simply to remove stdout cruft that had crept in, and at
the same time to remove some stderr cruft that was simply noise on the
terminal. That being said, I am in favor of fixing it even if it means a
slight compatibility breakage.

> Having said that, I would say that what 1965ff7 specified was only these
> two:
> 
>     = TAB refs/heads/master:refs/heads/master TAB [up to date]
>     - TAB :refs/heads/foobar TAB [deleted]
> 
> so everything else that do not match this pattern is a fair game, most
> importantly, the line that begins with "To" would not be mistaken with
> this pattern, I think.

It depends on the parser. If the parser was something like:

  switch (line[0]) {
    case '=': ...; break;
    case '-': ...; break;
    default: die("wtf: %s", line);
  }

then we are not introducing any ambiguity, but we are causing a
breakage. The problem is that we did not specify the format anywhere, so
it is hard to say whether we are breaking any promises we made.

> > This one, on the other hand, seems to me to be just noise. What does a
> > --porcelain caller learn by seeing "Everything up-to-date" that it did
> > not already know from seeing the list of refs?
> 
> I do not care too much about this hunk either way.  We could leave it as
> is, as we will be giving some other stuff to the standard error stream
> without squelching anyway, even with the three-patch series.  We could
> squelch only this message, but it is dubious what it is buying us.  If you
> forced me to decide, I would probably say "let's just drop this hunk and
> keep the code as-is".

I have not actually been running these patches, just reading them, but
my impression was the goal _was_ to squelch all of the stderr cruft. But
if we are not even close, then probably we should just give up and
callers should "2>/dev/null".

> As to the exit status, do you have any thoughts, by the way?
> 
> I am not convinced that it would be necessary nor even a good idea to make
> it behave inconsistently between the normal case and Porcelain case, only
> to make it easier to special case the "remote side would reject due to
> non-fast-forward" failure mode (iow, even if the calling script knows that
> it would fail due to non-fast-forward but otherwise everything else would
> be fine, what good would it do?)

I had initially endorsed it, but now I am having second thoughts.
Especially if the "usual" calling convention is to redirect stderr as
above, then we are probably missing out on any useful error messages
that accompany a failure return, anyway.  So maybe the sane thing to do
is to leave the exit code alone, and include a --porcelain output line
that either says "Everything was OK, see individual ref status" or "We
couldn't even talk to the other side". Then the status code is
irrelevant, and stdout contains all of the useful information (and if
you don't get an error or OK message, you know there was some
serious error like a broken git installation).

-Peff

  parent reply	other threads:[~2010-02-10  5:43 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  0:41 [PATCH] fix an error message in git-push so it goes to stderr Larry D'Anna
2010-02-05 15:06 ` Jeff King
2010-02-05 19:34   ` [PATCH 1/3] " Larry D'Anna
2010-02-05 19:34   ` [PATCH 2/3] silence human readable info messages going to stderr from git push --porcelain Larry D'Anna
2010-02-05 20:20     ` Junio C Hamano
2010-02-05 20:30       ` Larry D'Anna
2010-02-05 20:49       ` [PATCH v2 0/3] Larry D'Anna
2010-02-05 20:49       ` [PATCH v2 1/3] fix an error message in git-push so it goes to stderr Larry D'Anna
2010-02-05 20:49       ` [PATCH v2 2/3] clean up some of the output from git push --porcelain Larry D'Anna
2010-02-05 21:07         ` Junio C Hamano
2010-02-05 20:49       ` [PATCH v2 3/3] make git push --dry-run --porcelain exit with status 0 even if updates will be rejected Larry D'Anna
2010-02-05 23:50         ` Tay Ray Chuan
2010-02-08 20:19           ` Larry D'Anna
2010-02-08 20:31             ` [PATCH v3 1/3] git-push: fix an error message so it goes to stderr Larry D'Anna
2010-02-08 20:45               ` Junio C Hamano
2010-02-08 20:31             ` [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain Larry D'Anna
2010-02-08 20:51               ` Junio C Hamano
2010-02-08 21:13                 ` Junio C Hamano
2010-02-08 21:32                   ` Jeff King
2010-02-08 22:15                     ` Larry D'Anna
2010-02-08 22:21                     ` Junio C Hamano
2010-02-08 22:31                       ` Larry D'Anna
2010-02-08 22:33                         ` [PATCH] git-push: clean up some of the output from git push Larry D'Anna
2010-02-08 22:48                         ` [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain Junio C Hamano
2010-02-08 23:10                           ` Larry D'Anna
2010-02-08 23:11                             ` Junio C Hamano
2010-02-08 23:44                               ` [PATCH] git-push: fix the documentation to explain all the status flags Larry D'Anna
2010-02-09  0:23                                 ` Junio C Hamano
2010-02-09  0:30                                   ` Junio C Hamano
2010-02-09  0:45                                     ` Junio C Hamano
2010-02-09  0:56                                       ` Larry D'Anna
2010-02-09  1:00                                         ` Junio C Hamano
2010-02-09  0:54                                   ` Larry D'Anna
2010-02-09  4:54                           ` [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain Larry D'Anna
2010-02-09  7:31                             ` Junio C Hamano
2010-02-09 16:21                               ` Larry D'Anna
2010-02-09 17:51                               ` t5401-update-hooks test failure Shawn O. Pearce
2010-02-09 19:20                                 ` Nicolas Pitre
2010-02-09 19:26                                   ` Shawn O. Pearce
2010-02-09 22:44                                     ` Junio C Hamano
2010-02-09 23:16                                       ` Junio C Hamano
2010-02-10  1:29                                       ` Shawn O. Pearce
2010-02-09  5:48                           ` [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain Larry D'Anna
2010-02-09  5:53                             ` [PATCH 1/4] git-push: fix an error message so it goes to stderr Larry D'Anna
2010-02-09  5:54                             ` [PATCH 2/4] git-push: squelch advice message if in --porcelain mode Larry D'Anna
2010-02-09  5:54                             ` [PATCH 3/4] git-push: send "To <remoteurl>" messages to the standard output " Larry D'Anna
2010-02-11 22:54                               ` Tay Ray Chuan
2010-02-11 23:19                                 ` Junio C Hamano
2010-02-09  5:54                             ` [PATCH 4/4] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected Larry D'Anna
2010-02-10  5:39                       ` Jeff King [this message]
2010-02-10  5:55                         ` [PATCH v3 2/3] git-push: clean up some of the output from git push --porcelain Larry D'Anna
2010-02-10 10:43                           ` Tay Ray Chuan
2010-02-08 22:59                     ` Junio C Hamano
2010-02-10  5:49                       ` Jeff King
2010-02-11 23:23                         ` Junio C Hamano
2010-02-12  0:03                           ` Jeff King
2010-02-08 20:31             ` [PATCH v3 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected Larry D'Anna
2010-02-08 20:59               ` Junio C Hamano
2010-02-08 21:49                 ` Larry D'Anna
2010-02-09 22:25               ` Junio C Hamano
2010-02-10  4:13                 ` Larry D'Anna
2010-02-10  4:51                   ` [PATCH 4/4] " Larry D'Anna
2010-02-15 17:40                 ` [PATCH v3 3/3] " Larry D'Anna
2010-02-15 20:42                   ` Junio C Hamano
2010-02-05 19:34   ` [PATCH 3/3] " Larry D'Anna
2010-02-05 19:56     ` Jeff King
2010-02-05 20:05       ` Larry D'Anna
2010-02-05 20:13         ` Jeff King
2010-02-05 19:39   ` [PATCH] fix an error message in git-push so it goes to stderr Larry D'Anna
2010-02-05 19:48     ` Jeff King
2010-02-05 19:50       ` Larry D'Anna
2010-02-05 19:50       ` Jeff King

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

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

  git send-email \
    --in-reply-to=20100210053937.GF28526@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larry@elder-gods.org \
    /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.
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 NNTP newsgroup(s).