Re: :/regex syntax picks stash entries over regular commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 31, 2024, 23:06 UTC
- Message-ID
- <xmqqy19ydmro.fsf@gitster.g>
- In-Reply-To
- <CAOSCdbFg8jY1_0JE0+xf8oxrJjx-Kj0Cb0pPg3oUAXMN5q=kzw@mail.gmail.com>
"Nude F. Ninja" <nudefninja@gmail.com> writes:
> What did you do before the bug happened? (Steps to reproduce your issue) > I ran git stash push, which created the stash entry "On main: dark > mode". Then I committed changes before noticing an oversight with the > previous commit. I wrote the fix and ran git commit --fixup :/dark
It is natural that there are multiple commits that match the pattern you give in your repository.
One trick I learned that is effective is to explicitly state where to start searches, e.g. "--fixup 'HEAD^{/dark mode}'", which would be very much in line to what --fixup wants to do. The commit to be fixed up in a later rebase session by definition must be an ancestor of the current HEAD.