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

Re: Reachability lists in git

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 18, 2014, 20:22 UTC
Message-ID
<20141118202250.GK6527@google.com>
In-Reply-To
<xmqqzjbouv0y.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> --ancestry-path is my current favorite tool for walking-forward needs.
>
> Curious.  I often want to answer this question:
[...]
> And my experiments with --ancestry-path has been less than ideal.

Thanks for an example. I've found it works okay interactively, less so for scripted use (so I wish there were something better, though I haven't sketched out what that something better would look like).

>     Commit 982ac87 was reported to be faulty.  What topic was it on
>     and at which point was it merged to 'master'?
 $ git log --graph --ancestry-path 982ac87^..origin/master
[...]
 * | commit f30366b27a91dbc18328bccf3067cdfad4f0cfbc
 |/  Merge: 97fefaf efa5f82
 |   Author: Junio C Hamano <gitster@pobox.com>
 |   Date:   Wed Apr 3 09:34:04 2013 -0700
 |
 |       Merge branch 'jc/directory-attrs-regression-fix'
 |
 |       Fix 1.8.1.x regression that stopped matching "dir" (without
 |       trailing slash) to a directory "dir".
 |
 |       * jc/directory-attrs-regression-fix:
 |         t: check that a pattern without trailing slash matches a directory
 |         dir.c::match_pathname(): pay attention to the length of string parameters
 |         dir.c::match_pathname(): adjust patternlen when shifting pattern
 |         dir.c::match_basename(): pay attention to the length of string parameters
 |         attr.c::path_matches(): special case paths that end with a slash
 |         attr.c::path_matches(): the basename is part of the pathname
[...]
 |
 * commit 982ac87316a1cf5126888157bdcbfa32268ebe47
   Author: Jeff King <peff@peff.net>
   Date:   Thu Mar 28 17:47:47 2013 -0400
       dir.c::match_pathname(): adjust patternlen when shifting pattern
>      - What is the 'bottom' of the topic, that is, the commit
>        reachable from the faulty commit that was already on 'master'
>        when the faulty commit was written the first time?
 $ git tag the-merge f30366b27a91dbc18328bccf3067cdfad4f0cfbc
 $ git merge-base 982ac87 the-merge^
 9db9eecfe5c2490d17c0d4bd5452e4cb1d0948c5
>      - What is the 'top' of the topic, that is, were there more
>        commits made on top to build on the faulty commit on the
>        topic before the whole thing was merged to 'master'?
 $ git log --oneline 982ac87..the-merge^2
 efa5f82 t: check that a pattern without trailing slash matches a directory
 ab3aebc dir.c::match_pathname(): pay attention to the length of string parameters
>      - Were there follow-up fixes and enhancements on the topic
>        after the topic was merged to 'master' (this is harder)?

There's only one line coming out of the-merge^2 in the ancestry-path graph, so there were no such follow-up fixes.

Jonathan
Previous: Junio C HamanoNext: Jonathan Nieder
Message 4 of 14 in “Reachability lists in git”
  1. Alan SternNov 18, 2014
  2. Jonathan NiederNov 18, 2014
  3. Junio C HamanoNov 18, 2014
  4. Jonathan NiederNov 18, 2014
  5. Jonathan NiederNov 18, 2014
  6. Junio C HamanoNov 18, 2014
  7. Alan SternNov 18, 2014
  8. Jonathan NiederNov 18, 2014
  9. Alan SternNov 18, 2014
  10. Junio C HamanoNov 18, 2014
  11. Junio C HamanoNov 18, 2014
  12. Alan SternNov 18, 2014
  13. Junio C HamanoNov 18, 2014
  14. Alan SternNov 18, 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.