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

Re: rev-list --ancestry-path with arg - bug or undocumented requirement

From
Elijah Newren <newren@gmail.com>
Date
Nov 20, 2024, 03:22 UTC
Message-ID
<CABPp-BE1C2izp1a0Xm8_0KU+kas8XKejDyix+AzXqbCOeVp2Dg@mail.gmail.com>
In-Reply-To
<CADYQcGpXm=RTEYyxqdSowQ4Vg9jmXuCzOOpd-TgDX8U814BReg@mail.gmail.com>
On Tue, Nov 19, 2024 at 1:53 PM Kai Koponen <kaikoponen@google.com> wrote:
Show 19 quoted lines
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> Create a toy repo with commits in the following structure:
> A - B - C
>      \
>       D
>
> Run `git rev-list --ancestry-path=D A..C`.
>
> What did you expect to happen? (Expected behavior)
> Commits A and B should be listed.
>
> What happened instead? (Actual behavior)
> No commits listed.
>
> What's different between what you expected and what actually happened?
> --ancestry-path with a commit arg seems to return 0 results unless the
> specified commit is itself part of the range. The rev-list documentation
> does not mention that this is a requirement.

Yeah, the commit message that introduced --ancestry-path=COMMIT did document this in its commit message (see 257418c59040c13bfa839e01922e21833cda6a52257418c59040 (revision: allow --ancestry-path to take an argument, 2022-08-19)), and I think my original documentation patch was a little clearer on this point, but when Jonathan suggested an alternative for the documentation (https://lore.kernel.org/git/20220818222416.3567602-1-jonathantanmy@google.com/), I didn't think about someone attempting a commit outside the ancestry-path as the argument. My bad.

Based on the references above, would you like to suggest a documentation patch to ensure this requirement is documented?

Previous: Kai KoponenNext: Kai Koponen
Message 2 of 12 in “rev-list --ancestry-path with arg - bug or undocumented requirement”
  1. Kai KoponenNov 19, 2024
  2. Elijah NewrenNov 20, 2024
  3. Kai KoponenDec 2, 2024
  4. Elijah NewrenDec 2, 2024
  5. Junio C HamanoDec 3, 2024
  6. doc: mention rev-list --ancestry-path restrictionsKai Koponen, Dec 3, 2024
  7. Kristoffer HaugsbakkDec 3, 2024
  8. Kai KoponenDec 3, 2024
  9. Kai KoponenDec 3, 2024
  10. Junio C HamanoDec 3, 2024
  11. Kai KoponenDec 3, 2024
  12. Junio C HamanoDec 3, 2024

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.