Subject: Re: [PATCH 2/3] revision: exclude trees/blobs given commit

From: Junio C Hamano <[email-masked]>
Date: Tue, 28 Feb 2017 13:44:14 -0800

Jonathan Tan <[email-masked]> writes:

> When the --objects argument is given to rev-list, an argument of the
> form "^$tree" can be given to exclude all blobs and trees reachable from
> that tree, but an argument of the form "^$commit" only excludes that
> commit, not any blob or tree reachable from it. Make "^$commit" behave
> consistent to "^$tree".
>
> Also, formalize this behavior in unit tests. (Some of the added tests
> would already pass even before this commit, but are included
> nevertheless for completeness.)
>
> Signed-off-by: Jonathan Tan <[email-masked]>
> ---
>  revision.c               |  2 ++
>  t/t6000-rev-list-misc.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 90 insertions(+)
>
> diff --git a/revision.c b/revision.c
> index 5e49d9e0e..e6a62da98 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -254,6 +254,8 @@ static struct commit *handle_commit(struct rev_info *revs,
>  			die("unable to parse commit %s", name);
>  		if (flags & UNINTERESTING) {
>  			mark_parents_uninteresting(commit);
> +			if (revs->tree_and_blob_objects)
> +				mark_tree_uninteresting(commit->tree);

I fear that this may end up to be quite expensive.  Can we have a
perf test?