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

Re: [bug in next ?] git-fetch/git-push issue

From
Jeff King <peff@peff.net>
Date
Nov 6, 2007, 03:26 UTC
Message-ID
<20071106032648.GA11717@sigill.intra.peff.net>
In-Reply-To
<Pine.LNX.4.64.0711051803231.7357@iabervon.org>
On Mon, Nov 05, 2007 at 06:46:08PM -0500, Daniel Barkalow wrote:
Show 12 quoted lines
> -	if (!args.dry_run && remote && ret == 0) {
> +	if (!args.dry_run && remote && ret != -4) {
>  		for (ref = remote_refs; ref; ref = ref->next)
>  			update_tracking_ref(remote, ref);
>  	}
> 
> That is, -2 means that we've done less than was asked, but nothing blew 
> up; -4 means something blew up. When we skip something, we drop peer_ref 
> from it, so there's nothing to update (and it's dropped from the set of 
> mappings, in case we cared further about it with respect to reporting the 
> actions we actually took). Then we update all refs that were acted on if 
> ret isn't -4, and we return non-zero if ret is either -2 or -4.

This is OK, I guess. But it really doesn't accomplish the useful thing we might get by noting per-ref errors, which is that we _can_ update the tracking refs for those refs where it is appropriate.

We would have to parse the lines from receive_status and match them with refs. I started a patch to do this, but I wonder if it is really worth it. I would think that 99% of the time you have a failure at the sending level, it's because the connection is broken, and you have no idea _which_ refs were updated anyway, and you have to assume that none were. So perhaps it is OK to just treat the two classes of errors differently, and only cover per-ref errors for the "-2" case.

-Peff
Previous: Daniel BarkalowNext: Pierre Habouzit
Message 9 of 16 in “[bug in next ?] git-fetch/git-push issue”
  1. Pierre HabouzitNov 5, 2007
  2. Daniel BarkalowNov 5, 2007
  3. Jeff KingNov 5, 2007
  4. Daniel BarkalowNov 5, 2007
  5. Jeff KingNov 5, 2007
  6. Junio C HamanoNov 5, 2007
  7. Daniel BarkalowNov 5, 2007
  8. Daniel BarkalowNov 5, 2007
  9. Jeff KingNov 6, 2007
  10. Pierre HabouzitNov 5, 2007
  11. Pierre HabouzitNov 6, 2007
  12. Jeff KingNov 6, 2007
  13. Junio C HamanoNov 6, 2007
  14. Jeff KingNov 6, 2007
  15. Pierre HabouzitNov 6, 2007
  16. Pierre HabouzitNov 7, 2007

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.