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

rebase - "fixup!" conflict applied at the wrong code location, why ?

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Jul 8, 2020, 23:03 UTC
Message-ID
<7A30EA48-72E3-47E1-9792-136D7B96DC84@gmail.com>
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.
Next: Philippe Blain
Message 1 of 5 in “rebase - "fixup!" conflict applied at the wrong code location, why ?”
  1. Philippe BlainJul 8, 2020
  2. Philippe BlainJul 8, 2020
  3. Elijah NewrenJul 9, 2020
  4. Philippe BlainJul 14, 2020
  5. Elijah NewrenJul 14, 2020

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.