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 8, 2010, 20:59 UTC
- Message-ID
- <7vpr4figv3.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <032264a40d15cb9f4a86885947ffa23a603bfb0e.1265661033.git.larry@elder-gods.org>
Larry D'Anna <larry@elder-gods.org> writes:
> The script calling git push --dry-run --porcelain can see clearly from the > output that the updates will be rejected. However, it will probably need to > distinguish this condition from the push failing for other reasons, such as the > remote not being reachable.
I am not sure about this reasoning. If you are telling the script writers to decide what happened by reading from the output, shouldn't the program say "I fail because I cannot reach the other side" to its standard output so that the script can read it as well?
Having said that, I don't think it matters either way. If a script wants to know if push would fully succeed or not, it will run without --porcelain (perhaps while discarding the standard error) and check the status. Even without this patch, if a script runs with --porcelain and gets non-zero status, it can inspect the output and if it got rejection, that is a sure sign that it at least reached the other end to get enough information to decide that it will be rejected, no?