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

Re: Question about the revision walking API

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2015, 10:24 UTC
Message-ID
<xmqq4ms4qk91.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150106020230.GA28274@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 8 quoted lines
> I would like to know if the revision walking API works as one would
> expect with a calling sequence like the following:
>
> - init_revisions
> - add_pending_object/setup_revisions
> - prepare_revision_walk
> - get_revision (repeated)
> - reset_revision_walk (I guess)

Around here you would need to clear flag bits left on the objects by your previous traversal. After "git log A..B", commits in that range would have various combinations of SEEN, ADDED and SHOWN flags, and also some commits reachable from A would be marked as UNINTERESTING. You do not want these to interfere with your next traversal which may not have anything to do with what you computed with the previous round.

> - add_pending_object
> - prepare_revision_walk
> - get_revision (repeated)
Previous: Mike HommeyNext: Mike Hommey
Message 2 of 5 in “Question about the revision walking API”
  1. Mike HommeyJan 6, 2015
  2. Junio C HamanoJan 6, 2015
  3. Mike HommeyJan 6, 2015
  4. Christian CouderJan 6, 2015
  5. Junio C HamanoJan 6, 2015

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.