[Ohrrpgce] recommended workflow for merging a git feature branch before dcommit

Ralph Versteegen teeemcee at gmail.com
Tue Sep 5 08:19:10 PDT 2017


The only experience I have with mixing merges with git-svn is when you did
so recently, which caused some of your commits to get squashed. Basically,
it doesn't work and you shouldn't use them together, since git-svn doesn't
create any merge commits in svn*. And git-svn works by creating some svn
commits (in that case I guess it followed the wrong parent of the merge
commit) and then throwing away your git commits and replacing them with
commits copied back again from svn.

*But svn does support merges... I don't know how git-svn handles those.

Also, you don't need to do git svn fetch before rebase because rebase
fetches anyway. But it seems git svn fetch fetches all svn branches, and
git svn rebase fetches just the relevant branch before rebasing onto it.

On 6 September 2017 at 02:36, James Paige <Bob at hamsterrepublic.com> wrote:

> Okay, I think that makes sense!
>
> So I could use git rebase branchname wip to use rebase as an alternative
> to merge, or I could do my git svn dcommit from the branch, which does the
> same thing, and then I return to wip and do get svn fetch ; git svn rebase
>
> That seems to make sense to me, thank you.
>
> Out of curiosity, what breaks if I do a merge?
>
> ---
> James
>
> On Tue, Sep 5, 2017 at 5:04 AM, Ralph Versteegen <teeemcee at gmail.com>
> wrote:
>
>> Suppose you're on branch A and have some extra commits there. The natural
>> option would be rebase master on top of A, delete A, and dcommit from
>> master to svn:
>> git rebase A master  # any commits to master will follow after those in A
>> git branch -d A
>> git svn dcommit  # pushing any commits on A or on master to svn
>>
>> But it's not necessary to be on the master branch when you use git svn
>> dcommit; unlike git push and git pull, for which each of your branches may
>> have a remote git branch which it tracks (meaning, which push and pull act
>> on), git svn dcommit/rebase appears to just default to the 'wip' svn
>> trunk/branch if you're on some git branch that doesn't have an svn branch
>> of the same name (eg "web" or "dwimmercrafty" git branches).
>> So "git svn dcommit" will 1) fetch any new svn wip commits you don't have
>> yet, 2) rebase the current branch on top of svn/wip, 3) make commits to svn
>> (and update svn/wip). Well, actually I think the real order is 3, 1, 2?
>> Since IIRC svn lets you make commits without updating first, as long as
>> none of the same files have been modified? Making an svn commit without
>> even having the latest svn revision so that you can verify it compiles
>> seems fairly harmless as long as you at least test it immediately
>> afterwards. But it happens to me by accident all the time when you've made
>> a commit I wasn't aware of, and I've not once had a problem result from it.
>>
>> So anyway, if you're on branch A, you can just do:
>> git svn dcommit
>> git checkout master
>> git svn rebase  # If there were no extra commits to master, master and A
>> should now be identical
>> git branch -d A
>>
>>
>>
>> On 5 September 2017 at 11:06, James Paige <Bob at hamsterrepublic.com>
>> wrote:
>>
>>> Hey, TMC, what workflow do you use when you want to merge a feature
>>> branch before you "git svn dcommit" it?
>>>
>>> I remember being warned that ordinary merges are a source of problems.
>>>
>>> ---
>>> James
>>>
>>> _______________________________________________
>>> Ohrrpgce mailing list
>>> ohrrpgce at lists.motherhamster.org
>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>
>>>
>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
>>
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170906/fb1e28b9/attachment-0001.html>


More information about the Ohrrpgce mailing list