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

:/regex syntax picks stash entries over regular commits

From
NNNude F. Ninja <nudefninja@gmail.com>
Date
Mar 31, 2024, 22:13 UTC
Message-ID
<CAOSCdbFg8jY1_0JE0+xf8oxrJjx-Kj0Cb0pPg3oUAXMN5q=kzw@mail.gmail.com>

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

What did you expect to happen? (Expected behavior) The fixup commit should have referenced the previous commit.

What happened instead? (Actual behavior) It referenced the stash entry.

What's different between what you expected and what actually happened? I cannot autosquash the commit that refers to the stash entry. I suggest adding an option to prefer (older) regular commits over (newer) stash entries when specifying a commit with the :/regex syntax. In any case I think it's a bug for the --fixup option to readily produce a commit that does not work with the --autosquash option which it seems it was designed for.

[System Info] git version: git version 2.39.3 (Apple Git-146)

Next: Junio C Hamano
Message 1 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.