git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] make git push --dry-run --porcelain exit with status 0 even if updates will be rejected

From
Jeff King <peff@peff.net>
Date
Feb 5, 2010, 20:13 UTC
Message-ID
<20100205201325.GA25697@coredump.intra.peff.net>
In-Reply-To
<20100205200524.GA24027@cthulhu>
On Fri, Feb 05, 2010 at 03:05:24PM -0500, Larry D'Anna wrote:
Show 11 quoted lines
> > So shouldn't it just be:
> > 
> >   if (args->porcelain && args->dry_run)
> >           return 0;
> > 
> > after we check for transport errors but before the loop that you are
> > modifying.
> 
> I don't know what the deal is with REF_STATUS_EXPECTING_REPORT, so I
> didn't want to modify the behavior in the case that ref->status was
> that.  What does expecting report mean?

It means we told the other side we wanted to push that ref, and we expect it to give us a status report. Most refs are in that state for a short period, and then moved to their final state in builtin-send-pack.c:receive_status. But if we never get a status for that ref for some reason, then that could be the final state.

But more to the point, I don't think this bit of code should _have_ to care what it means. If there is a per-ref error with "push --dry-run --porcelain", it will be shown on that ref's output line. So I think your proposal should simply be "if dry-run and porcelain, don't bother looking at per-ref errors at all". You don't care what the per-ref error is; they are all in the same class from the perspective of this change.

-Peff
Previous: Larry D'AnnaNext: Larry D'Anna
Message 10 of 14 in “fix an error message in git-push so it goes to stderr”
  1. fix an error message in git-push so it goes to stderrLarry D'Anna, Feb 5, 2010
  2. Jeff KingFeb 5, 2010
  3. 1/3 fix an error message in git-push so it goes to stderrLarry D'Anna, Feb 5, 2010
  4. 2/3 silence human readable info messages going to stderr from git push --porcelainLarry D'Anna, Feb 5, 2010
  5. Junio C HamanoFeb 5, 2010
  6. Larry D'AnnaFeb 5, 2010
  7. 3/3 make git push --dry-run --porcelain exit with status 0 even if updates will be rejectedLarry D'Anna, Feb 5, 2010
  8. Jeff KingFeb 5, 2010
  9. Larry D'AnnaFeb 5, 2010
  10. Jeff KingFeb 5, 2010
  11. Larry D'AnnaFeb 5, 2010
  12. Jeff KingFeb 5, 2010
  13. Larry D'AnnaFeb 5, 2010
  14. Jeff KingFeb 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.