Re: [PATCH v2 12/21] bisect: replace clear_distance() by unique markers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephan Beyer <s-beyer@xxxxxxx> writes:

> @@ -43,15 +43,17 @@ static int count_distance(struct commit_list *entry)
>  	int nr = 0;
>  	struct commit_list *todo = NULL;
>  	commit_list_append(entry->item, &todo);
> +	marker++;
>  
>  	while (todo) {
>  		struct commit *commit = pop_commit(&todo);
>  
> -		if (!(commit->object.flags & (UNINTERESTING | COUNTED))) {
> +		if (!(commit->object.flags & UNINTERESTING)
> +		 && node_data(commit)->marked != marker) {

Makes sense.

> @@ -123,10 +116,9 @@ static void show_list(const char *debug, int counted, int nr,
>  		const char *subject_start;
>  		int subject_len;
>  
> -		fprintf(stderr, "%c%c%c ",
> +		fprintf(stderr, "%c%c ",
>  			(flags & TREESAME) ? ' ' : 'T',
> -			(flags & UNINTERESTING) ? 'U' : ' ',
> -			(flags & COUNTED) ? 'C' : ' ');
> +			(flags & UNINTERESTING) ? 'U' : ' ');

As this one is for debugging, could we keep the output of 'C'
intact?

It is equivalent to

	commit->util && node_data(commit)->marked == marker ? 'C' : ' '

right?

This makes me wonder if node_data(commit) should return NULL instead
of asserting on commit->util in [11/21], by the way.  That would
make the above

	node_data(commit) && node_data(commit)->marked == marker
        ? 'C' : ' '

which may be easier to read.

Another small thing I overlooked in [11/21] is that the parameter to
node_data() helper should not be called "elem", which is typically
the name used to point at an element on a linked list structure such
as commit_list.  Call it "commit" instead, as that is typically the
way we call a single parameter/variable that appears in a function
that is "struct commit".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]