git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org, Nick Edelen <sirnot@gmail.com>,
	Nicolas Pitre <nico@fluxnic.net>
Subject: Re: [PATCH] upload-pack: Remove some unused code
Date: Sun, 25 Jul 2010 22:42:47 -0700	[thread overview]
Message-ID: <7vr5iqaje0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1280002151-7527-1-git-send-email-newren@gmail.com> (Elijah Newren's message of "Sat\, 24 Jul 2010 14\:09\:11 -0600")

Elijah Newren <newren@gmail.com> writes:

> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
> I'm not sure if this is too trivial to submit, but I noticed it while
> poking around in upload-pack.
>
> Ever since f0cea83f631689331fce73b51f22707e897f7939, the
> 'create_full_pack' argument has been unused and is always false.  We
> can make it clear that this argument is currently unused and remove some
> associated code from an 'if' block.

While it is true that currently we memset(&rev_list) to always pass NULL
there, I wonder if that was an unintended behaviour change introduced by
the commit you mentioned...

>  upload-pack.c |   29 ++++++++++++-----------------
>  1 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/upload-pack.c b/upload-pack.c
> index dc464d7..c2e4eae 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -105,7 +105,7 @@ static void show_edge(struct commit *commit)
>  	fprintf(pack_pipe, "-%s\n", sha1_to_hex(commit->object.sha1));
>  }
>  
> -static int do_rev_list(int in, int out, void *create_full_pack)
> +static int do_rev_list(int in, int out, void *unused)
>  {
>  	int i;
>  	struct rev_info revs;
> @@ -118,23 +118,18 @@ static int do_rev_list(int in, int out, void *create_full_pack)
>  	if (use_thin_pack)
>  		revs.edge_hint = 1;
>  
> -	if (create_full_pack) {
> -		const char *args[] = {"rev-list", "--all", NULL};
> -		setup_revisions(2, args, &revs, NULL);
> -	} else {
> -		for (i = 0; i < want_obj.nr; i++) {
> -			struct object *o = want_obj.objects[i].item;
> -			/* why??? */
> -			o->flags &= ~UNINTERESTING;
> -			add_pending_object(&revs, o, NULL);
> -		}
> -		for (i = 0; i < have_obj.nr; i++) {
> -			struct object *o = have_obj.objects[i].item;
> -			o->flags |= UNINTERESTING;
> -			add_pending_object(&revs, o, NULL);
> -		}
> -		setup_revisions(0, NULL, &revs, NULL);
> +	for (i = 0; i < want_obj.nr; i++) {
> +		struct object *o = want_obj.objects[i].item;
> +		/* why??? */
> +		o->flags &= ~UNINTERESTING;
> +		add_pending_object(&revs, o, NULL);
> +	}
> +	for (i = 0; i < have_obj.nr; i++) {
> +		struct object *o = have_obj.objects[i].item;
> +		o->flags |= UNINTERESTING;
> +		add_pending_object(&revs, o, NULL);
>  	}
> +	setup_revisions(0, NULL, &revs, NULL);
>  	if (prepare_revision_walk(&revs))
>  		die("revision walk setup failed");
>  	mark_edges_uninteresting(revs.commits, &revs, show_edge);
> -- 
> 1.7.2.1.g83744

  reply	other threads:[~2010-07-26  5:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-24 20:09 [PATCH] upload-pack: Remove some unused code Elijah Newren
2010-07-26  5:42 ` Junio C Hamano [this message]
2010-07-26 18:29   ` Nicolas Pitre

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=7vr5iqaje0.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=nico@fluxnic.net \
    --cc=sirnot@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).