The situation
I am trying to reapply my git filters after having identified and resolved unexpected, and undesirable behavior in the previous iteration of the script. I have had to do this once before, and at no point did I get a merge conflict notice. However, now I am and can't figure out how to deal with it.
What I'm doing
I'm running $git rebase -i --root --preserve-merges
. I am aware of the caveat involving merges and rebase, and it does not apply to this situation, since I am not reordering any commits.
I then switch pick
to edit
Once editing, the process consists of running the smudge filter on each file, then applying the cleaning filter. It's very straightforward process.
The problem.
git rebase --continue
executes a merge. The next commit's files will differ considerably since the files being filtered are LaTeX files, and I'm breaking up paragraphs into multiple lines.
This is expected, and necessary, for merge commits, but it's doing this for those commits with only one parent.
Question
What can I do to prevent this behavior?
What I've tried.
So far, what I've tried has been to play with -X theirs
, -X ours
, and -s ours
. This has not worked. Reading the manual, it says that in the case of binary files, when -X ours
is specified it simply disregards the changes in the other "branch" (previous commit in this case), so I set *.* binary
in .git/info/attributes
. In case I got it backwards, I also tried this with theirs
. However, none of these attempts have produced the desired behavior.
Minimal working example
I've been testing this with a simple three commit repo where the first commit is "hello", the second is "hello\nwrld" and the third is "hello\nwrld\n." where \n
is actually a new line in the file.
I then pick the first (root) and third (last) commits and edit the middle one. The change made is "hello" to "hello\nworld" (fixing a typo in world). I then commit and continue.
So far these have produced the following outcomes:
- A warning about an empty commit
- deletion of the last commit without warning
- the last commit inherits the "fix"
All of these are undesirable.