Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflict when squashing linear commit history

Tags:

git

git-rebase

How is it possible that when trying to squash/fixup a linear branch I still have to do manual merges? The repo has been converted from Subversion. Every conflict is either "Automatic cherry-pick failed" or "Aborting commit due to empty commit message". The latter I could understand, but a --fixup-empty or something would be useful.

Typical output:

user@machine:/path (master|REBASE-i)$ git add * && git rebase --continue 
[detached HEAD c536940] fixup!
 Author: John Doe <[email protected]>
 2 files changed, 57 insertions(+), 4 deletions(-)
Automatic cherry-pick failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>', and
run 'git rebase --continue'
Could not apply 8854a54... >6d5f180 foo
user@machine:/path (master|REBASE-i)$ git st
# Not currently on any branch.
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#   both modified:      filename.ics
#
no changes added to commit (use "git add" and/or "git commit -a")
like image 635
l0b0 Avatar asked Oct 14 '22 02:10

l0b0


2 Answers

These work:

git mergetool
git rebase --continue
like image 169
l0b0 Avatar answered Oct 17 '22 01:10

l0b0


Here's my suggestion for achieving your idea of having some kind of --fixup-empty functionality:

git filter-branch --msg-filter "sed 's/^$/Unknown/'"

This replaces empty commit messages with 'Unknown' and is particularly useful if you want to do a rebase after using git-svn to convert a Subversion repository that had some empty commit messages but can't because it fails with "Aborting commit due to empty commit message".

like image 26
Beau Avatar answered Oct 16 '22 23:10

Beau