From: Larry D'Anna Date: Wed, 10 Feb 2010 04:13:13 GMT Subject: Re: [PATCH v3 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected Message-ID: <20100210041313.GA21516@cthulhu> In-Reply-To: <7vtytqyrlk.fsf@alter.siamese.dyndns.org> * Junio C Hamano (gitster@pobox.com) [100209 17:25]: > Larry D'Anna writes: > > > @@ -1052,7 +1053,7 @@ int transport_push(struct transport *transport, > > flags & TRANSPORT_PUSH_FORCE); > > > > ret = transport->push_refs(transport, remote_refs, flags); > > - err = push_had_errors(remote_refs); > > + err = (pretend && porcelain) ? 0 : push_had_errors(remote_refs); > > Hmph, you are doing (rewritten in an easier to follow format) > > if (--dry-run && --porcelain) > err = 0; > else > err = push_add_errors(remote_refs); > > here, which I think changes the semantics of what follows immediately > after this hunk, namely: > > if (!quiet || err) > print_push_status(transport->url, remote_refs, > verbose | porcelain, porcelain, > nonfastforward); > > Earlier, the logic said "even if you asked for --quiet, we would report if > there is an error" but now you are changing the rule to "under --dry-run > and --porcelain, --quiet means don't ever report the status, even when > there are errors". > > I don't necessarily think it is a bad change, but in any case the semantic > change is worth documenting. Now that you point it out, I can't really think of any reason why this patch ought to mess with the semantics of --quiet. --larry