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

Question: How to find the commits in the ancestry path of seen down to _and_ including a given topic?

From
Elijah Newren <newren@gmail.com>
Date
Jul 21, 2022, 07:23 UTC
Message-ID
<CABPp-BEK+SJh2uF=rrM-f1u9diMQJ7D3H0fJLdzWpyOww=ys+w@mail.gmail.com>

A simple question that I'm spinning out of [1]: How can I get `git log` to show the commits in the ancestry path from seen, back to *and including* a given topic (but not commits from unrelated topics)?

   git log --ancestry-path $TOPIC..seen

doesn't work, because that excludes $TOPIC. (It does get me the merge of $TOPIC into seen, as well as all merges into seen following that merge, which I want, but it's missing the topic itself.)

  git log --ancestry-path $BASE_OF_TOPIC..seen

usually doesn't work, because $BASE_OF_TOPIC is usually a commit from "main" or "master", and this results in pulling in hundreds of commits from unrelated topics that also happen to be based on a version of "main" or "master" at or after $BASE_OF_TOPIC.

Is there some magic that does what I want, or is this just not possible currently?

Thanks, Elijah

[1] https://lore.kernel.org/git/CABPp-BHARfYcsEM7Daeb7+vYxeB9Awo8=qbrOMXG6BQ0gX1RiA@mail.gmail.com/
Next: Junio C Hamano
Message 1 of 6 in “Question: How to find the commits in the ancestry path of seen down to _and_ including a given topic?”
  1. Elijah NewrenJul 21, 2022
  2. Junio C HamanoJul 21, 2022
  3. Derrick StoleeJul 21, 2022
  4. Elijah NewrenJul 21, 2022
  5. Derrick StoleeJul 22, 2022
  6. Elijah NewrenJul 22, 2022

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.