emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git commit/push and VC


From: Stephen J. Turnbull
Subject: Re: git commit/push and VC
Date: Sat, 22 Nov 2014 18:36:34 +0900

Eli Zaretskii writes:

 > So to do that inter-clone merge, one would need
 > 
 >   git fetch ../my-other-clone <probably some arguments here>
 >   git merge <more arguments here>
 >   # fix conflicts, if any
 >   git commit -a # only if there were conflicts
 >   git push
 > 
 > Is that right?  Sounds a bot complicated and error-prone, I agree.

Well, the first two commands can probably be reduced to "git pull
../my-other-clone".

But it seems reasonably likely that both branches exist in at least
one of the clones, because "git diff" requires that the commits being
compared be in the same repo, and referring to them via SHA1 is chancy
at best.  I *think* that the worst thing that is likely to happen is
that the user has emacs-24 checked out in this clone, does "git pull
../my-other-clone emacs-24", and gets a null update but think you've
actually merged into trunk.  The fix is trivial, check out trunk and
redo.

 > How about the following alternative instead: we do NOT recommend
 > merging from the other clone.  The other clone is to be used only for
 > committing to the release branch and, rarely (probably never)
 > branching off that release branch for doing something that is not a
 > trivial one-off fix.  To merge to master, we recommend using the clone
 > that is normally used for working on master and on feature branches
 > (a.k.a. "master clone").  Specifically, when the time comes to merge
 > the changes on the release branch to master, we recommend this
 > sequence of commands in the "master clone":
 > 
 >   git pull
 >   git merge -m <commit-message> remotes/origin/emacs-24
 >   # fix conflicts, if any
 >   # run tests, fix bugs if any
 >   git commit -a # only if there were conflicts
 >   git push
 > 
 > Is this correct?  Because if it is, it's just like the "normal" merge
 > workflow, just with the name of the merge source branch slightly
 > special.  So it's easier to remember and less error-prone, I think.

I think just "git pull -e ../emacs-24" and edit the commit message is
clearer, instead of pull and merging.  The "-e" is unnecessary in more
recent git.

 > The main point is to avoid "git checkout emacs-24" in the "master
 > clone" as much as possible, because once you switch back to master,
 > the build will most probably be annoyingly long.

With this workflow, the user should *never* need to do that.

 > > Another issue is that I find it easy to do fixes to the "wrong" branch
 > > in the current repo, and that gets confusing.
 > 
 > Does that happen with separate clones also?  I thought separate clones
 > make this less likely, since they allow you to seldom, if ever, switch
 > between master and the release branch in the same repo.

Yes -- as I say, it's possibly just me.  I often end up with buffers
from both workspaces open on the correponding files.

 > > Finally, I just find it more efficient to work in a single clone.
 > 
 > I agree, but I think the Emacs use case is special in this respect,
 > especially for people who are not proficient enough with Git.

I suppose so.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]