{"thread":{"id":"66007","subject":"Git 2.55.0 breaks revision path filtering with --no-walk","startedAt":"2026-07-15T18:49:00Z","lastAt":"2026-07-15T21:09:20Z","messageCount":2,"participants":["Peter Colberg","Kristofer Karlsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"548315","messageId":"alfWF9cBPESuLBgS@earendel","threadId":"66007","inReplyTo":null,"subject":"Git 2.55.0 breaks revision path filtering with --no-walk","fromName":"Peter Colberg","fromEmail":"pcolberg@redhat.com","sentAt":"2026-07-15T18:48:55Z","receivedAt":"2026-07-15T18:49:00Z","isPatch":false,"body":"Hi,\n\nSince commit dd4bc01c0a8f (\"revision: use priority queue for\nnon-limited streaming walks\") in Git 2.55.0, git rev-list\n--no-walk no longer considers optional <path>... arguments.\n\nhttps://lore.kernel.org/git/pull.2127.git.1779897003.gitgitgadget@gmail.com/\n\nThe following example lists all commits between two Linux kernel\nreleases that modify paths within a given directory and further\nmodified paths outside of that directory, too.\n\nWith Git 2.54.0, the second rev-list correctly filters by paths:\n\n% git rev-list --topo-order v7.0..v7.1 -- drivers/gpu/drm/ | wc -l\n2026\n% git rev-list --topo-order v7.0..v7.1 -- drivers/gpu/drm/ | git rev-list --stdin --no-walk=unsorted -- ':!drivers/gpu/drm/' | wc -l\n146\n\nWith Git 2.55.0, the second rev-list passes through all commits:\n\n% git rev-list --topo-order v7.0..v7.1 -- drivers/gpu/drm/ | wc -l\n2026\n% git rev-list --topo-order v7.0..v7.1 -- drivers/gpu/drm/ | git rev-list --stdin --no-walk=unsorted -- ':!drivers/gpu/drm/' | wc -l\n2026\n\nReverting commit dd4bc01c0a8f (\"revision: use priority queue for\nnon-limited streaming walks\") on top of Git 2.55.0 restores the\nprevious behaviour. Specifically, the following hunk that no longer\ninvokes process_parents() in the no_walk case causes the regression.\n\n@@ -4390,12 +4394,13 @@ static struct commit *get_revision_1(struct rev_info *revs)\n \t\t\tbreak;\n \t\tcase REV_WALK_STREAMING:\n \t\t\tif (process_parents(revs, commit,\n-\t\t\t\t\t    &revs->commits, NULL) < 0) {\n+\t\t\t\t\t    &revs->commit_queue) < 0) {\n \t\t\t\tif (!revs->ignore_missing_links)\n \t\t\t\t\tdie(\"Failed to traverse parents of commit %s\",\n \t\t\t\t\t    oid_to_hex(&commit->object.oid));\n \t\t\t}\n \t\t\tbreak;\n+\t\tcase REV_WALK_NO_WALK:\n \t\tcase REV_WALK_LIMITED:\n \t\t\tbreak;\n \t\t}\n\nIs the behaviour in Git 2.55.0 intentional, i.e., was --no-walk never\nintended to support path filtering, or is this indeed a regression?\n\nThanks,\nPeter\n\n"},{"id":"548335","messageId":"CAL71e4NjDTHbKR8z7pSrPpzDrX19JOTR04sArm7P=m5ivqkskA@mail.gmail.com","threadId":"66007","inReplyTo":"alfWF9cBPESuLBgS@earendel","subject":"Re: Git 2.55.0 breaks revision path filtering with --no-walk","fromName":"Kristofer Karlsson","fromEmail":"krka@spotify.com","sentAt":"2026-07-15T21:09:06Z","receivedAt":"2026-07-15T21:09:20Z","isPatch":false,"body":"On Wed, 15 Jul 2026 at 20:48, Peter Colberg <pcolberg@redhat.com> wrote:\n>\n> Is the behaviour in Git 2.55.0 intentional, i.e., was --no-walk never\n> intended to support path filtering, or is this indeed a regression?\n\nOuch, this definitely seems like a regression and it can be\nreproduced with a very simple scenario:\n\n  git init repo && cd repo\n  echo a >file-a && git add file-a && git commit -m \"add file-a\"\n  echo b >file-b && git add file-b && git commit -m \"add file-b\"\n  git rev-list --no-walk HEAD -- file-a\n\nThis should produce no output since HEAD only touches file-b,\nbut with 2.55.0 it incorrectly outputs the commit.\n\nI think you correctly identified the problematic change too,\nmy refactoring indeed has a bug where process_parents() is skipped.\n\nI think I can fix it, and also add test cases for this,\nbut I am not sure what the immediate appropriate action is --\nrevert the entire patch or apply a bugfix?\nI think I can also try to check if there are other affected\ncode paths that need additional test cases.\n\nFor what it's worth, I suspect the bugfix would look something\nlike this, but I have not fully verified it yet.\n\nin revision.c:\n     case REV_WALK_NO_WALK:\n    +        try_to_simplify_commit(revs, commit);\n    +        break;\n     case REV_WALK_LIMITED:\n\nThanks for the report, I will try to contribute a fix if possible,\nKristofer\n"}]}