git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] fixup commit is dropped during rebase if subject = branch name
@ 2022-09-17 14:45 Erik Cervin Edin
  2022-09-17 18:04 ` Junio C Hamano
  2022-09-17 23:19 ` Johannes Altmanninger
  0 siblings, 2 replies; 19+ messages in thread
From: Erik Cervin Edin @ 2022-09-17 14:45 UTC (permalink / raw)
  To: Git Mailing List

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
  dir=rebase-fixup-subject-equals-branch-name
  mkdir $dir
  cd $dir
  git init --initial-branch=main
  git commit -m init --allow-empty
  git tag init

  # failure
  seq 1 3 >> bar && git add bar && git commit -m main
  git tag -f x
  seq 4 6 >> bar && git add bar && git commit -m bar
  seq 7 9 >> bar && git add bar && git commit --fixup :/main
  git -c sequence.editor=: rebase --autosquash --interactive x
  git diff ORIG_HEAD


What did you expect to happen? (Expected behavior)
Identical results as
  # normal
  git reset --hard init
  seq 1 3 >> bar && git add bar && git commit -m main
  git tag -f x
  seq 4 6 >> bar && git add bar && git commit --fixup :/main
  seq 7 9 >> bar && git add bar && git commit -m bar
  git -c sequence.editor=: rebase --autosquash --interactive x
  git diff ORIG_HEAD
except for the order of the commits.

What happened instead? (Actual behavior)
The fixup commit was dropped from the rebase-todo.

What's different between what you expected and what actually happened?
The HEAD is a fixup of a commit with the same subject as the branch
name. It is being rebased on top of the commit it is intended to
fixup, so it should be *picked*. Instead, it is dropped from the
rebase-todo. I expected the autosquash feature to work equally,
independently of the subject and the current branch name.

Anything else you want to add:
This appears to only occur if the subject is equal to the branch being
rebased. I didn't check if this occurs if there is simply 'a'
reference with an identical name in the repository (I'm guessing no).

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.37.3.windows.1
cpu: x86_64
built from commit: c4992d4fecabd7d111726ecb37e33a3ccb51d6f1
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 12.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Users\erik\Git\usr\bin\bash.exe


[Enabled Hooks]


-- 
Erik Cervin-Edin

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-09-24 22:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 14:45 [BUG] fixup commit is dropped during rebase if subject = branch name Erik Cervin Edin
2022-09-17 18:04 ` Junio C Hamano
2022-09-18 14:55   ` Erik Cervin Edin
2022-09-17 23:19 ` Johannes Altmanninger
2022-09-18 12:10   ` [PATCH] sequencer: avoid dropping fixup commit that targets self via commit-ish Johannes Altmanninger
2022-09-18 15:05     ` Erik Cervin Edin
2022-09-18 17:54       ` Johannes Altmanninger
2022-09-19  1:11     ` Junio C Hamano
2022-09-19 16:07       ` Junio C Hamano
2022-09-20  3:20         ` Johannes Altmanninger
2022-09-19 16:23       ` Junio C Hamano
2022-09-20  3:11         ` [PATCH v2] " Johannes Altmanninger
2022-09-20  8:26           ` Phillip Wood
2022-09-21 18:47           ` Junio C Hamano
2022-09-22  4:00             ` Johannes Altmanninger
2022-09-22 19:32               ` Junio C Hamano
2022-09-24 22:29                 ` [PATCH v3] " Johannes Altmanninger
2022-09-19 23:09     ` [PATCH] " Junio C Hamano
2022-09-20  3:27       ` Johannes Altmanninger

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).