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

Re: Question about the revision walking API

From
Christian Couder <christian.couder@gmail.com>
Date
Jan 6, 2015, 13:37 UTC
Message-ID
<CAP8UFD0mZ4tSF-ZkZh8Z=GdkW4LNQAWuKJYyhyiA4RTGPLX_+g@mail.gmail.com>
In-Reply-To
<20150106020230.GA28274@glandium.org>
Hi,
On Tue, Jan 6, 2015 at 3:02 AM, Mike Hommey <mh@glandium.org> wrote:
Show 23 quoted lines
> Hi,
>
> 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)
> - add_pending_object
> - prepare_revision_walk
> - get_revision (repeated)
>
> That is, do a first revision walk based on a given rev_info, then reuse that
> rev_info with additional commit objects (in my case, I want to add more
> UNINTERESTING commits) and redo a revision walk based on the modified
> rev_info (so, avoid reinitializing a rev_info and filling it from
> scratch again with the additional UNINTERESTING commits).
>
> I guess I could try and see if that works, but I'd rather have an
> informed answer than to derive my own from the fact my testcase would
> happen to work by chance.

I am not sure what you describe above would work, but something like what is done in bisect.c should work, see check_ancestors() and bisect_next_all(). It might not be the most efficient solution though, so I am interested if you find something more efficient.

Best, Christian.

Previous: Mike HommeyNext: Junio C Hamano
Message 4 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.