{"thread":{"id":"62640","subject":"Bug report: \":/[text]\" revision reference no longer returns youngest commit","startedAt":"2024-12-15T11:51:52Z","lastAt":"2024-12-15T20:50:53Z","messageCount":4,"participants":["Oliver Blanthorn","Kristoffer Haugsbakk","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"509122","messageId":"CADFnu5sMEvGyGy7xH1r0NGBUZJBznCi0waJ_bJ3tSHQ5Y2yX1Q@mail.gmail.com","threadId":"62640","inReplyTo":null,"subject":"Bug report: \":/[text]\" revision reference no longer returns youngest commit","fromName":"Oliver Blanthorn","fromEmail":"freedom4cows@gmail.com","sentAt":"2024-12-15T11:51:40Z","receivedAt":"2024-12-15T11:51:52Z","isPatch":false,"sender":{"key":"freedom4cows@gmail.com","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\n`git show :/Merge` in git's git repo\n\n\n\nWhat did you expect to happen? (Expected behavior)\n\nThe most recent commit matching the text \"Merge\" should have appeared\n\n\n\nWhat happened instead? (Actual behavior)\n\nA commit from 19 years ago appeared\n\n\nWhat's different between what you expected and what actually happened?\n\n`:/[text]` should match the most recent commit matching that fragment.\nThere have been a few merges in the intervening 19 years\n\n\n\n\nAnything else you want to add:\n\nBisect log:\n\n```\n57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9 is the first bad commit\ncommit 57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9\nAuthor: Patrick Steinhardt <ps@pks.im>\nDate:   5 months ago\n\n    object-name: fix leaking commit list items\n\n    When calling `get_oid_oneline()`, we pass in a `struct commit_list` that\n    gets modified by the function. This creates a weird situation where the\n    commit list may sometimes be empty after returning, but sometimes it\n    will continue to carry additional commits. In those cases the remainder\n    of the list leaks.\n\n    Ultimately, the design where we only pass partial ownership to\n    `get_oid_oneline()` feels shoddy. Refactor the code such that we only\n    pass a constant pointer to the list, creating a local copy as needed.\n    Callers are thus always responsible for freeing the commit list, which\n    then allows us to plug a bunch of memory leaks.\n\n    Signed-off-by: Patrick Steinhardt <ps@pks.im>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nobject-name.c                | 26 ++++++++++++++++----------\nt/t1511-rev-parse-caret.sh   |  1 +\nt/t6133-pathspec-rev-dwim.sh |  2 ++\n3 files changed, 19 insertions(+), 10 deletions(-)\n\n\n\n\ngit bisect start\n# status: waiting for both good and bad commits\n# bad: [2ccc89b0c16c51561da90d21cfbb4b58cc877bf6] The sixteenth batch\ngit bisect bad 2ccc89b0c16c51561da90d21cfbb4b58cc877bf6\n# status: waiting for good commit(s), bad commit known\n# good: [fe86abd7511a9a6862d5706c6fa1d9b57a63ba09] Git 2.41\ngit bisect good fe86abd7511a9a6862d5706c6fa1d9b57a63ba09\n# good: [92e8388bd35cdddf312011a98e046706bb420fce] Merge branch\n'jc/local-extern-shell-rules'\ngit bisect good 92e8388bd35cdddf312011a98e046706bb420fce\n# bad: [39e15b789ad3c3a192f4c8abde3daff83a053aaa] setup: merge\nconfiguration of repository formats\ngit bisect bad 39e15b789ad3c3a192f4c8abde3daff83a053aaa\n# good: [22cf18fd9ede79bdfe5ac93e09986a64052e5781] Merge branch\n'gt/t-hash-unit-test'\ngit bisect good 22cf18fd9ede79bdfe5ac93e09986a64052e5781\n# good: [ecf7fc600a5218c9ee3863ee70d5a6e312164f30] Merge branch\n'tb/path-filter-fix'\ngit bisect good ecf7fc600a5218c9ee3863ee70d5a6e312164f30\n# good: [d02895ceccd3b5c5422c35671553b5aace0a6087] Merge branch\n'l10n-de-2.46' of github.com:ralfth/git\ngit bisect good d02895ceccd3b5c5422c35671553b5aace0a6087\n# good: [25673b1c476756ec0587fb0596ab3c22b96dc52a] The third batch\ngit bisect good 25673b1c476756ec0587fb0596ab3c22b96dc52a\n# bad: [0b2c4bc3ff6504467d84cb1bf6e73d877b553ce6] Merge branch\n'jk/apply-patch-mode-check-fix'\ngit bisect bad 0b2c4bc3ff6504467d84cb1bf6e73d877b553ce6\n# bad: [1f0899978109d732abe5b4825b5cfa40ef1d5885] entry: fix leaking\npathnames during delayed checkout\ngit bisect bad 1f0899978109d732abe5b4825b5cfa40ef1d5885\n# good: [fc68633352180fc2645772b5926898fee4e006e3] builtin/remote: fix\nvarious trivial memory leaks\ngit bisect good fc68633352180fc2645772b5926898fee4e006e3\n# good: [50ef4e09c386f46898886b1c3ae8bef5783b4e90] builtin/rerere: fix\nvarious trivial memory leaks\ngit bisect good 50ef4e09c386f46898886b1c3ae8bef5783b4e90\n# good: [145c9790207b9847b609d997c86c7cf8cec043b2]\nbuiltin/credential-cache: fix trivial leaks\ngit bisect good 145c9790207b9847b609d997c86c7cf8cec043b2\n# bad: [57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9] object-name: fix\nleaking commit list items\ngit bisect bad 57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9\n# good: [11f841c1cc9c7ffadf5d462d25a378fcab5bb6e1] t/test-repository:\nfix leaking repository\ngit bisect good 11f841c1cc9c7ffadf5d462d25a378fcab5bb6e1\n# first bad commit: [57fb139b5ee7dcb2ea5182bf33bcd2b07df983c9]\nobject-name: fix leaking commit list items\n```\n\nApologies if I've violated any mailing list etiquette - I've never\nfiled a bug using one before :)\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.46.0.rc2.20.g11f841c1cc\ncpu: x86_64\nbuilt from commit: 11f841c1cc9c7ffadf5d462d25a378fcab5bb6e1\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nlibcurl: 8.11.0\nOpenSSL: OpenSSL 3.4.0 22 Oct 2024\nzlib: 1.3.1\nuname: Linux 6.12.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024\n16:04:27 +0000 x86_64\ncompiler info: gnuc: 14.2\nlibc info: glibc: 2.40\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"},{"id":"509123","messageId":"ddc10a19-f8fc-4532-90b0-5485d5126bd7@app.fastmail.com","threadId":"62640","inReplyTo":"CADFnu5sMEvGyGy7xH1r0NGBUZJBznCi0waJ_bJ3tSHQ5Y2yX1Q@mail.gmail.com","subject":"Re: Bug report: \":/[text]\" revision reference no longer returns youngest commit","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2024-12-15T12:25:38Z","receivedAt":"2024-12-15T12:26:13Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"Hi\n\nOn Sun, Dec 15, 2024, at 12:51, Oliver Blanthorn wrote:\n> What did you do before the bug happened? (Steps to reproduce your issue)\n>\n> `git show :/Merge` in git's git repo\n>\n>\n>\n> What did you expect to happen? (Expected behavior)\n>\n> The most recent commit matching the text \"Merge\" should have appeared\n>\n>\n>\n> What happened instead? (Actual behavior)\n>\n> A commit from 19 years ago appeared\n\nThis has been reported here\n\nhttps://lore.kernel.org/git/CAKOEJdcPYn3O01p29rVa+xv=Qr504FQyKJeSB-Moze04ViCGGg@mail.gmail.com/\n\nThe patch is here\n\nhttps://lore.kernel.org/git/20241206-pks-rev-parse-fix-reversed-list-v3-1-d934c17db168@pks.im/\n"},{"id":"509135","messageId":"xmqqzfkw970k.fsf@gitster.g","threadId":"62640","inReplyTo":"CADFnu5sMEvGyGy7xH1r0NGBUZJBznCi0waJ_bJ3tSHQ5Y2yX1Q@mail.gmail.com","subject":"Re: Bug report: \":/[text]\" revision reference no longer returns youngest commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-12-15T17:43:23Z","receivedAt":"2024-12-15T17:43:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Oliver Blanthorn <freedom4cows@gmail.com> writes:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n>\n> `git show :/Merge` in git's git repo\n>\n>\n>\n> What did you expect to happen? (Expected behavior)\n>\n> The most recent commit matching the text \"Merge\" should have appeared\n>\n>\n>\n> What happened instead? (Actual behavior)\n>\n> A commit from 19 years ago appeared\n\nThanks for a well written report.  I think this is the same breakage\nreported in *1*, which was fixed with *2*.  Hopefully the fix will\nbe part of the upcoming Git 2.48, scheduled soon after the new year.\n\n\n[References]\n\n *1* https://lore.kernel.org/git/CAKOEJdcPYn3O01p29rVa+xv=Qr504FQyKJeSB-Moze04ViCGGg@mail.gmail.com/\n\n *2* https://lore.kernel.org/git/20241206-pks-rev-parse-fix-reversed-list-v3-1-d934c17db168@pks.im\n\n"},{"id":"509136","messageId":"xmqqv7vk8yc4.fsf@gitster.g","threadId":"62640","inReplyTo":"ddc10a19-f8fc-4532-90b0-5485d5126bd7@app.fastmail.com","subject":"Re: Bug report: \":/[text]\" revision reference no longer returns youngest commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-12-15T20:50:51Z","receivedAt":"2024-12-15T20:50:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n\n> This has been reported here\n>\n> https://lore.kernel.org/git/CAKOEJdcPYn3O01p29rVa+xv=Qr504FQyKJeSB-Moze04ViCGGg@mail.gmail.com/\n>\n> The patch is here\n>\n> https://lore.kernel.org/git/20241206-pks-rev-parse-fix-reversed-list-v3-1-d934c17db168@pks.im/\n\nThanks, I should have looked for the responses before sending my own\nversion.\n"}]}