All of lore.kernel.org
 help / color / mirror / Atom feed
* 'git rebase' silently drops changes?
@ 2015-02-06 21:28 Sergey Organov
  2015-02-07 21:32 ` Sebastian Schuberth
  0 siblings, 1 reply; 7+ messages in thread
From: Sergey Organov @ 2015-02-06 21:28 UTC (permalink / raw)
  To: git

Hello,

I recently ran into an annoying problem: 'git rebase' apparently
silently drops changes in non-conflicting paths of merge commits
(git version 1.9.3). 

Is it a bug or feature? Is there a way to flatten history using rebase,
yet preserve manual changes found in merge commits?

Here is simplified reproduction of what I've encountered:

<SCRIPT>
git init t
cd t
git config rerere.enabled true

echo "I" > a; git add a
echo "I" > b; git add b
git commit -am "I"

git checkout -b test

echo "B" >> b; git commit -m "B" -a

git checkout master

echo "A" >> a
git commit -am "A"

git merge --no-edit test

# Clean merge, but result didn't compile, so I fixed it and
# amended the merge:
echo "Precious!" >> a # [!] This is modification that gets lost
git commit --amend --no-edit -a
cat a

# Now rebase my work.
git rebase -f HEAD~1

# What? Where is my "Precious" change in "a"???
cat a
</SCRIPT>

I.e., the modification marked [!] was silently lost during rebase!

-- 
Sergey.

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

end of thread, other threads:[~2015-02-10 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 21:28 'git rebase' silently drops changes? Sergey Organov
2015-02-07 21:32 ` Sebastian Schuberth
2015-02-08 13:49   ` Johannes Sixt
2015-02-09 12:53     ` Sergey Organov
2015-02-09 19:03       ` Johannes Sixt
2015-02-10 11:46         ` Sergey Organov
2015-02-10 18:26           ` Johannes Sixt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.