login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff King <peff@...>
Cc: Pierre Habouzit <madcoder@...>, Nicolas Pitre <nico@...>, Git ML <git@...>
Date: Monday, November 5, 2007 - 7:46 pm

On Mon, 5 Nov 2007, Jeff King wrote:


That's possible, but I think we currently only care about per-ref stuff 
for whether we actually did a push to that ref, and we care about whether 
we had a failure that affects all refs, and we care (for the return value) 
whether we have any errors at all.


I think it's actually very significant what commits made locally have 
or haven't been made public.


How about this, in addition to my previous dropping peer_ref:

diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 947c42b..1b7206c 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -337,8 +343,10 @@ static int do_send_pack(int in, int out, struct remote *remote, int nr_refspec,
 	}
 
 	packet_flush(out);
-	if (new_refs && !args.dry_run)
-		ret = pack_objects(out, remote_refs);
+	if (new_refs && !args.dry_run) {
+		if (pack_objects(out, remote_refs))
+			ret = -4;
+	}
 	close(out);
 
 	if (expect_status_report) {
@@ -346,7 +354,7 @@ static int do_send_pack(int in, int out, struct remote *remote, int nr_refspec,
 			ret = -4;
 	}
 
-	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.

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[bug in next ?] git-fetch/git-push issue, Pierre Habouzit, (Mon Nov 5, 1:56 pm)
Re: [bug in next ?] git-fetch/git-push issue, Pierre Habouzit, (Wed Nov 7, 11:11 am)
Re: [bug in next ?] git-fetch/git-push issue, Pierre Habouzit, (Tue Nov 6, 1:56 pm)
Re: [bug in next ?] git-fetch/git-push issue, Jeff King, (Tue Nov 6, 2:09 pm)
Re: [bug in next ?] git-fetch/git-push issue, Junio C Hamano, (Tue Nov 6, 2:23 pm)
Re: [bug in next ?] git-fetch/git-push issue, Pierre Habouzit, (Tue Nov 6, 3:37 pm)
Re: [bug in next ?] git-fetch/git-push issue, Jeff King, (Tue Nov 6, 2:41 pm)
Re: [bug in next ?] git-fetch/git-push issue, Pierre Habouzit, (Mon Nov 5, 2:19 pm)
Re: [bug in next ?] git-fetch/git-push issue, Daniel Barkalow, (Mon Nov 5, 2:17 pm)
Re: [bug in next ?] git-fetch/git-push issue, Jeff King, (Mon Nov 5, 5:07 pm)
Re: [bug in next ?] git-fetch/git-push issue, Daniel Barkalow, (Mon Nov 5, 5:41 pm)
Re: [bug in next ?] git-fetch/git-push issue, Jeff King, (Mon Nov 5, 6:55 pm)
Re: [bug in next ?] git-fetch/git-push issue, Daniel Barkalow, (Mon Nov 5, 7:46 pm)
Re: [bug in next ?] git-fetch/git-push issue, Jeff King, (Mon Nov 5, 11:26 pm)
Re: [bug in next ?] git-fetch/git-push issue, Junio C Hamano, (Mon Nov 5, 7:22 pm)
Re: [bug in next ?] git-fetch/git-push issue, Daniel Barkalow, (Mon Nov 5, 7:59 pm)
speck-geostationary