All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Larry D'Anna <larry@elder-gods.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v4] add --summary option to git-push and git-fetch
Date: Fri, 29 Jan 2010 17:17:06 -0800	[thread overview]
Message-ID: <7vzl3w9yst.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20100130005948.GA14938@cthulhu> (Larry D'Anna's message of "Fri\, 29 Jan 2010 19\:59\:48 -0500")

Larry D'Anna <larry@elder-gods.org> writes:

Please don't use M-F-T to deflect a direct response meant to you away from
you.  I also do not want people wasting _my_ time by following your M-F-T
and sending their comments meant to _you_ coming to me with my address on
To: line, as I prioritize incoming messages based on where my address is
in the header, and do not want you waste _other's_ time by making them
correct their "To:" like to avoid wasting my time.

>> > @@ -373,12 +379,15 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
>> >  				fputc(url[i], fp);
>> >  		fputc('\n', fp);
>> >  
>> > -		if (ref)
>> > -			rc |= update_local_ref(ref, what, note);
>> > -		else
>> > +		if (ref) {
>> > +			*quickref = 0;
>> > +			rc |= update_local_ref(ref, what, note, quickref);
>> 
>> Makes me wonder why update_local_ref() does not put that NUL upon entry.
>
> I'm not sure what you mean.  Could you elaborate?

Why is it necessary for the caller to do "*quickref = '\0'" before calling
update_local_ref()?  Shouldn't your updated u-l-r be doing that clearing,
so that the callers don't have to worry about it?

>> > +	init_revisions(&rev, NULL);
>> > +	rev.prune = 0;
>> > +	assert(!handle_revision_arg(quickref, &rev, 0, 1));
>> > +	assert(!prepare_revision_walk(&rev));
>> > +
>> > +	while ((commit = get_revision(&rev)) != NULL) {
>> > +		struct strbuf buf = STRBUF_INIT;
>> > +		if (limit == 0) {
>> > +			fprintf(stderr, "    ...\n");
>> 
>> How would you know, when you asked 20 and you showed 20 here, that there
>> is no more to come?
>
> If there's more it will print the "...", if there isn't then it won't.

If your limit is 20 and if you unconditionally say "..." after pulling 20
from the pool, the consumer of your output would think "Ah, I see 20 but
that is only I asked for 20, and the ... means there are more".  But that
is incorrect because your 21st call to get_revision() might have yielded
NULL in which case you had only 20 after all.

You cannot do "..." correctly without pulling one more than the limit from
the pool.

>> > +test_expect_success 'fetch --summary forced update' '
>> > +	mk_empty &&
>> > +	(
>> > ...
>> > +	)
>> > +
>> > +'
>> 
>> There are at least two missing combinations. (1) "fetch --summary" to
>> fetch a new branch, and (2) "fetch --summary" does not try segfaulting by
>> accessing unavailable information after a failed fetch.
>> 
>> The same comment applies to the push side of the tests.
>
> What would be a good way to induce a failed fetch for this test?

Not having a valid ref or repo, perhaps.  I dunno---it's been quite a
while since I saw the patch.

  reply	other threads:[~2010-01-30  1:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-03  4:48 [PATCH] add --summary option to git-push and git-fetch Larry D'Anna
2009-07-03  9:20 ` Junio C Hamano
2009-07-07  1:59   ` [PATCH v3] " Larry D'Anna
2009-07-09 18:03     ` Larry D'Anna
2009-07-10  2:24       ` [PATCH v4] " Larry D'Anna
2009-07-10  7:33         ` Stephen Boyd
2009-07-11 17:41           ` Larry D'Anna
2009-07-11 19:05             ` Junio C Hamano
2010-01-30  0:59               ` Larry D'Anna
2010-01-30  1:17                 ` Junio C Hamano [this message]
2010-01-30  1:25                   ` Junio C Hamano
2010-01-30  1:19                 ` Junio C Hamano
2010-01-30  1:10               ` [PATCH v5] " Larry D'Anna
2010-01-30  2:05                 ` [PATCH v6] " Larry D'Anna
2010-01-31 12:04                   ` Tay Ray Chuan
     [not found]                   ` <7vsk9oysds.fsf@alter.siamese.dyndns.org>
2010-01-30  7:51                     ` Ilari Liusvaara
2010-01-30  8:04                       ` Junio C Hamano
2010-01-30  8:57                         ` Ilari Liusvaara
2010-02-01  0:34                     ` Daniel Barkalow
2010-02-01  0:57                     ` Larry D'Anna
2010-02-04 17:16                       ` Larry D'Anna
2010-02-04 17:25                         ` Junio C Hamano
2010-02-04 17:55                           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vzl3w9yst.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=larry@elder-gods.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.