{"thread":{"id":"30524","subject":"git svn rebase following a merge causes duplicate commits","startedAt":"2012-05-13T09:19:21Z","lastAt":"2012-05-13T09:19:21Z","messageCount":1,"participants":["Avishay Lavie"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"191465","messageId":"CAHkK2brTtW2XLm=dwfPiSfjNWNBiS_dcbKX4K+h9dmxqj4P5Dw@mail.gmail.com","threadId":"30524","inReplyTo":null,"subject":"git svn rebase following a merge causes duplicate commits","fromName":"Avishay Lavie","fromEmail":"avishay.lavie@gmail.com","sentAt":"2012-05-13T09:19:21Z","receivedAt":"2012-05-13T09:19:21Z","isPatch":false,"sender":{"key":"avishay.lavie@gmail.com","avatar":"https://avatars.githubusercontent.com/u/557935?v=4"},"body":"Hi,\n\nWith the introduction of the svn.pushmergeinfo flag, merging SVN\nbranches using git-svn has become possible and streamlined, with git\nsvn rebase acting as the usual method to get up to date with remote\nchanges.\nHowever, when git svn rebase is performed after an unpushed merge, the\nrebase operation follows both parents and replays both the user's\nlocal commits and those from the merged branch.\n\nAs a concrete example, suppose I branch from master (tracking\nsvn/trunk) to a new branch called 'topic'. I commit a few commits on\ntopic and then merge from svn/trunk. Meanwhile someone else has also\ncommitted and dcommitted to topic, which requires me to svn rebase.\nUpon svn rebase, my local 'topic' branch is reset to the updated\nsvn/topic, and then both my commits *and the ones I merged from trunk*\nare replayed -- essentially duplicating them.\n\nWhat should have happened is for the merge commit to be replayed as a\nmerge (instead of each of its commits individually replayed on the\ncurrent branch). Incidentally, this is exactly what --preserve-merges\nis supposed to do; however despite the git svn docs claiming that git\nsvn rebase accepts all the options git rebase does, this particular\nflag is not recognized.\n\nSo, at the very least, I think git svn rebase should honor the -p /\n--preserve-merges flag.\n\nAdditionally, I propose that -p should be made the default for git svn\nrebase, or it should at least warn or abort when it encounters merges\nabout to be rebased, or otherwise find a way to avoid the current\nbehavior which is rarely the desired outcome (unless I'm missing\nsomething obvious?).\n\nThoughts?\n\nAvish\n"}]}