git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nude F. Ninja" <nudefninja@gmail.com>
To: git@vger.kernel.org
Subject: :/regex syntax picks stash entries over regular commits
Date: Sun, 31 Mar 2024 23:13:03 +0100	[thread overview]
Message-ID: <CAOSCdbFg8jY1_0JE0+xf8oxrJjx-Kj0Cb0pPg3oUAXMN5q=kzw@mail.gmail.com> (raw)

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)


             reply	other threads:[~2024-03-31 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-31 22:13 Nude F. Ninja [this message]
2024-03-31 23:06 ` :/regex syntax picks stash entries over regular commits Junio C Hamano
2024-04-01  2:44   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOSCdbFg8jY1_0JE0+xf8oxrJjx-Kj0Cb0pPg3oUAXMN5q=kzw@mail.gmail.com' \
    --to=nudefninja@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).