git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rebase -p loses amended changes
@ 2012-03-30 21:31 J Robert Ray
  2012-03-30 22:49 ` Thomas Rast
  0 siblings, 1 reply; 20+ messages in thread
From: J Robert Ray @ 2012-03-30 21:31 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

I've found that 'rebase -p' can discard changes from a merge commit
when it recreates the merge.

If a merge is amended to add changes to a file unaffected by the
merge, these changes are lost after a rebase. Attached is a script to
demonstrate the problem.

I've tested the script against git 1.7.9.5.

I'll outline the steps starting from an empty repo.

1. Create a file (a) with some contents, then create three branches
from this point, "mod-a," "mod-b," and "master-copy."

2. In "mod-a," modify a.

3. In "mod-b," create a different file (b).

4. Merge (--no-ff) "mod-a" onto master.

5. Amend the merge with a modification to a.

6. Merge (--no-ff) "mod-b" onto "master-copy."

7. Rebase -p master onto "master-copy."

Notice the change to "a" from step #5 is now gone. "a" reverts to the
pre-amended version after step #4.

I assume this isn't expected behavior and is a bug.

[-- Attachment #2: rebase-p.sh --]
[-- Type: application/x-sh, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <592E2EEC-6CBA-48D6-8D44-34A971DD78EC@gmail.com>]

end of thread, other threads:[~2012-04-10  7:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 21:31 rebase -p loses amended changes J Robert Ray
2012-03-30 22:49 ` Thomas Rast
     [not found] <592E2EEC-6CBA-48D6-8D44-34A971DD78EC@gmail.com>
2012-03-31  5:55 ` Jon Seymour
2012-03-31  9:35   ` Thomas Rast
2012-03-31  9:39     ` Jon Seymour
2012-04-03 18:55       ` J Robert Ray
2012-04-03 21:43         ` Jon Seymour
2012-04-03 22:02           ` Junio C Hamano
2012-04-03 22:09           ` Phil Hord
2012-04-04  6:30             ` Johannes Sixt
2012-04-04 17:11               ` Junio C Hamano
2012-04-04 20:26                 ` Junio C Hamano
2012-04-04 22:55                   ` Jon Seymour
2012-04-04 22:59                     ` Junio C Hamano
2012-04-04 23:05                       ` Jon Seymour
2012-04-04 23:20                         ` Junio C Hamano
2012-04-05 16:16               ` Martin von Zweigbergk
2012-04-05 16:33                 ` Jon Seymour
2012-04-05 16:43                   ` Martin von Zweigbergk
2012-04-10  7:14                 ` Johannes Sixt

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 NNTP newsgroup(s).