Re: [PATCH v3 3/3] git-push: make git push --dry-run --porcelain exit with status 0 even if updates will be rejected
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 9, 2010, 22:25 UTC
- Message-ID
- <7vtytqyrlk.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <032264a40d15cb9f4a86885947ffa23a603bfb0e.1265661033.git.larry@elder-gods.org>
Larry D'Anna <larry@elder-gods.org> writes:
Show 6 quoted lines
> @@ -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.