Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects

4 messages, 3 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects

From: Matthieu Moy <hidden>
Date: 2016-06-16 02:19:49

Jeff King [off-list ref] writes:
quoted hunk
--- a/send-pack.c
+++ b/send-pack.c
@@ -36,18 +36,15 @@ int option_parse_push_signed(const struct option *opt,
 	die("bad %s argument: %s", opt->long_name, arg);
 }
 
-static int feed_object(const unsigned char *sha1, int fd, int negative)
+static void feed_object(const unsigned char *sha1, FILE *fh, int negative)
 {
-	char buf[42];
-
 	if (negative && !has_sha1_file(sha1))
-		return 1;
+		return;
[...]
quoted hunk
@@ -97,21 +95,22 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
[...]
 	for (i = 0; i < extra->nr; i++)
-		if (!feed_object(extra->sha1[i], po.in, 1))
-			break;
+		feed_object(extra->sha1[i], po_in, 1);
I may have missed the obvious, but doesn't this change the behavior when
"negative && !has_sha1_file(sha1)" happens? I understand that you don't
need write_or_whine anymore, but don't understand how you get rid of the
"return 1" here.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects

From: Ramsay Jones <hidden>
Date: 2016-06-16 02:19:49


On 09/06/16 13:10, Matthieu Moy wrote:
Jeff King [off-list ref] writes:
quoted
--- a/send-pack.c
+++ b/send-pack.c
@@ -36,18 +36,15 @@ int option_parse_push_signed(const struct option *opt,
 	die("bad %s argument: %s", opt->long_name, arg);
 }
 
-static int feed_object(const unsigned char *sha1, int fd, int negative)
+static void feed_object(const unsigned char *sha1, FILE *fh, int negative)
 {
-	char buf[42];
-
 	if (negative && !has_sha1_file(sha1))
-		return 1;
+		return;
[...]
quoted
@@ -97,21 +95,22 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
[...]
quoted
 	for (i = 0; i < extra->nr; i++)
-		if (!feed_object(extra->sha1[i], po.in, 1))
-			break;
+		feed_object(extra->sha1[i], po_in, 1);
I may have missed the obvious, but doesn't this change the behavior when
"negative && !has_sha1_file(sha1)" happens? I understand that you don't
need write_or_whine anymore, but don't understand how you get rid of the
"return 1" here.
Just FYI, this patch removes the last use of write_or_whine() - should it
be removed?

ATB,
Ramsay Jones

Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects

From: Jeff King <hidden>
Date: 2016-06-16 02:19:50

On Thu, Jun 09, 2016 at 03:34:59PM +0100, Ramsay Jones wrote:
Just FYI, this patch removes the last use of write_or_whine() - should it
be removed?
That sounds reasonable. Want to do a patch on top?

-Peff

Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects

From: Ramsay Jones <hidden>
Date: 2016-06-16 02:19:50


On 09/06/16 18:12, Jeff King wrote:
On Thu, Jun 09, 2016 at 03:34:59PM +0100, Ramsay Jones wrote:
quoted
Just FYI, this patch removes the last use of write_or_whine() - should it
be removed?
That sounds reasonable. Want to do a patch on top?
OK, will do.

ATB,
Ramsay Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help