git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] revision traversal: retire BOUNDARY_SHOW

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 6, 2007, 02:05 UTC
Message-ID
<Pine.LNX.4.63.0703060253140.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vzm6rurst.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 5 Mar 2007, Junio C Hamano wrote:
Show 6 quoted lines
> This removes the flag internally used by revision traversal to
> decide which commits are indeed boundaries and renames it to
> CHILD_SHOWN.  builtin-bundle uses the symbol for its
> verification, but I think the logic it uses it is wrong.  The
> flag is still useful but it is local to the git-bundle, so it is
> renamed to PREREQ_MARK.

The idea was to bail out of revision walking when that prerequisite was found, _even_ if it happened to be uninteresting.

Just marking the parents uninteresting unless they are prerequisites would be better, probably.

Show 6 quoted lines
>  
>  	i = req_nr;
>  	while (i && (commit = get_revision(&revs)))
> -		if (commit->object.flags & BOUNDARY_SHOW)
> +		if (commit->object.flags & PREREQ_MARK)
>  			i--;
The above-mentioned idea, then would be: instead of just i--; do
		{
			struct commit_list *parent = commit->parents;
			i--;
			for (; parent; parent = parent->next)
				if (!(parent->item->object.flag & 
						PREREQ_MARK))
					parent->item->object.flag |=
						UNINTERESTING;
		}

This should help performance, as not all reachable commits are traversed any more.

Show 11 quoted lines
>  
>  	for (i = 0; i < req_nr; i++)
> diff --git a/revision.c b/revision.c
> index 5d137ea..2d27ccf 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1285,17 +1285,21 @@ struct commit *get_revision(struct rev_info *revs)
>  			commit_list_insert(c, &l);
>  		revs->commits = l;
>  		revs->reverse = 0;
> +		c = NULL;
Why? It gets assigned here anyway:
Show 8 quoted lines
>  	}
>  
>  	/*
>  	 * Now pick up what they want to give us
>  	 */
> -	c = get_revision_1(revs);
> +	if (!(c = get_revision_1(revs)))
> +		return NULL;
Show 7 quoted lines
>  	while (0 < revs->skip_count) {
>  		revs->skip_count--;
>  		c = get_revision_1(revs);
>  		if (!c)
>  			break;
> +		/* Although we grabbed it, it is not shown. */
> +		c->object.flags &= ~SHOWN;

Wasn't --skip meant for something like gitweb, where you just want to skip the first <n> commits from the list, but do not want to change the list otherwise?

Show 8 quoted lines
> @@ -1305,6 +1309,9 @@ struct commit *get_revision(struct rev_info *revs)
>  	case -1:
>  		break;
>  	case 0:
> +		/* Although we grabbed it, it is not shown. */
> +		if (c)
> +			c->object.flags &= ~SHOWN;
>  		c = NULL;
Is this really relevant in practice?

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 26 in “[BUG] git-rev-list: --topo-order --boundary and --max-count”
  1. Santi BéjarMar 5, 2007
  2. Junio C HamanoMar 5, 2007
  3. Junio C HamanoMar 5, 2007
  4. Linus TorvaldsMar 5, 2007
  5. revision walker: Fix --boundary when limitedJohannes Schindelin, Mar 5, 2007
  6. Johannes SchindelinMar 5, 2007
  7. Linus TorvaldsMar 5, 2007
  8. Linus TorvaldsMar 5, 2007
  9. Junio C HamanoMar 5, 2007
  10. Johannes SchindelinMar 6, 2007
  11. Junio C HamanoMar 6, 2007
  12. Johannes SchindelinMar 6, 2007
  13. Junio C HamanoMar 6, 2007
  14. Johannes SchindelinMar 5, 2007
  15. Junio C HamanoMar 6, 2007
  16. 2/4 revision traversal: retire BOUNDARY_SHOWJunio C Hamano, Mar 6, 2007
  17. Johannes SchindelinMar 6, 2007
  18. Junio C HamanoMar 6, 2007
  19. SHOWN means shownJunio C Hamano, Mar 6, 2007
  20. Johannes SchindelinMar 6, 2007
  21. Junio C HamanoMar 6, 2007
  22. Johannes SchindelinMar 6, 2007
  23. 3/4 git-bundle: various fixupsJunio C Hamano, Mar 6, 2007
  24. Johannes SchindelinMar 6, 2007
  25. 4/4 git-bundle: --list-prereqsJunio C Hamano, Mar 6, 2007
  26. Junio C HamanoMar 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.