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

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.

Previous: Nude F. NinjaNext: Jeff King
Message 2 of 3 in “:/regex syntax picks stash entries over regular commits”
  1. Nude F. NinjaMar 31, 2024
  2. Junio C HamanoMar 31, 2024
  3. Jeff KingApr 1, 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.