git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* rebase - "fixup!" conflict applied at the wrong code location, why ?
@ 2020-07-08 23:03 Philippe Blain
  2020-07-08 23:07 ` Philippe Blain
  2020-07-09  4:07 ` Elijah Newren
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Blain @ 2020-07-08 23:03 UTC (permalink / raw)
  To: git

Hello,

I've been working on a branch for a while. I've been using `git commit --fixup`  and `git commit --squash`
when I noticed that I had forgotten to add something to a previous commit.
Today I did `git rebase --autosquash` to clean up my history, and the rebase failed at the
first 'fixup!' commit with a conflict. However, the conflict is not located at the right place 
in the code (it's not in the right subroutine!). This is very surprising to me, and I would 
like to understand why it happens.

Steps to reproduce:

git clone -b branch-to-be-rebased https://github.com/phil-blain/CICE.git cice
cd cice
git rebase -i --autosquash my-first-commit
# save the todo list without modifications
  Auto-merging <file> 
  CONFLICT (content): Merge conflict in <file>
  error: could not apply e8bfa55... fixup! <commit message of f4e1ae6>
# the rebase stops at f4e1ae6
git diff
# tangential question : for some reason the hunk header does not appear here, I don't know why... 
git diff -2  # but it appears here
git grep -p -e '<<<<<<< HEAD' -e '>>>>>>> e8bfa55...'  # or here
# ok, the conflict appears in subroutine 'picard_solver'
git show REBASE_HEAD -U5
# but the original "fixup!" commit only modifies the subroutine 'anderson_solver' !!

I would have expected that the conflict be created around lines 1118-1132 
(line numbers in f4e1ae6), in the 'anderson_solver' subroutine.

I don't know if this plays a part here, but commit f4e1ae6 (where the rebase stops)
is the commit where the 'anderson_solver' subroutine is added to the code...

Thanks,

Philippe.



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

end of thread, other threads:[~2020-07-14  5:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 23:03 rebase - "fixup!" conflict applied at the wrong code location, why ? Philippe Blain
2020-07-08 23:07 ` Philippe Blain
2020-07-09  4:07 ` Elijah Newren
2020-07-14  2:42   ` Philippe Blain
2020-07-14  5:45     ` Elijah Newren

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