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

Strange behavior of git rev-list --first-parent --ancesty-path

From
Василий Макаров <einmalfel@gmail.com>
Date
Sep 30, 2014, 05:25 UTC
Message-ID
<CABEtfDGwtMTSP5xxme-p60iU1gMXBwCXA0cGHxLuZS+j-KwhGQ@mail.gmail.com>
Hello!
Imagine following tree:
A--B--C
 \      /
  D--E
B is parent #1 of C.

git rev-list --first-parent --ancestry-path D..C returns zero commits. This is correct, since one cannot find any commits between D and C traversing tree by first parent. git rev-list --first-parent --ancestry-path E..C returns SHA of C. This is strange, because --ancestry-path should restrict output to commits being both ancestors of C and descendants of E.

Git did not return me any errors or warnings so I'm assuming that --first-parent and --ancestry-path are OK to be used together.

So, is it a git bug or I'm doing smth wrong?
Message 1 of 1 in “Strange behavior of git rev-list --first-parent --ancesty-path”
  1. Василий МакаровSep 30, 2014

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.