* Re: git commit/push and VC
2014-11-20 20:59 ` Eli Zaretskii
@ 2014-11-21 0:31 ` Stephen J. Turnbull
2014-11-21 9:01 ` Eli Zaretskii
2014-11-21 8:23 ` martin rudalics
2014-11-21 8:49 ` Thien-Thi Nguyen
2 siblings, 1 reply; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-21 0:31 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Achim Gratz, emacs-devel
Eli Zaretskii writes:
> > > . do we want to explicitly recommend 2 different clones, one each
> > > for master and the release branch? there's nothing in the
> > > instructions about this, or about working with 2 divergent
> > > branches in general
> > Unless you're really working all the time in parallel on both branches
> > I'd say this setup is more trouble than it's worth.
> I personally am working on both branches in parallel, yes. Many
> others do, too. Bugfixes go to one branch, new features to the other,
> people report bugs on this or other, etc. Bootstrapping each time,
> which takes a couple of minutes, is annoying. And then you sometimes
> want to compare what the two binaries, one from master, the other from
> the release branch, do in the same situation.
>
> But that's me, and I already know how to solve this. I'm asking what,
> if anything, do we want to recommend.
I would say either go with *your* gut feeling, or if you prefer,
somebody else you trust. ;-) You could also present several scenarios
with expected issues (people can probably judge the merits for
themselves, but the downside of messing up a personal repo is quite
large). I can think of the following:
1) single clone, multiple out-of-tree build directories (this is what
I use). Disadvantages: IIRC Emacs uses the same "link lisp/ ->
$srcdir/lisp" strategy that XEmacs does, so bootstrap takes a long
time, and the first make after switching is likely to take a long
time even if you don't bootstrap (because checked-out files all
appear to have been touched). There will be several emacs binaries
associated with the clone, so there is potential for confusion
between the running Emacs and the checked-out version.
2) single clone, in-tree build. Disadvantages: as (1), but even more
so, except that it's easier to keep emacs in synch with the sources
as there's only one binary in existence.
3) multiple clones, build per clone (I don't think it much matters
whether it is in-tree or not, and people who use out-of-tree builds
probably have other reasons for doing that already, and they'll
know what they are doing). Disadvantages: one of the clones will
be used for "stable" -> trunk merges and reverse cherry-picking,
and you need to keep track of which one. You also need a lot more
VCS operations to keep them in synch.
4) single repo, multiple workspaces (use GITDIR variable, for
example). Disadvantages: not well-supported by git AFAIK, so the
user has to keep track of the global branch.
Maybe you shouldn't mention (4).
Steve
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 0:31 ` Stephen J. Turnbull
@ 2014-11-21 9:01 ` Eli Zaretskii
2014-11-22 5:30 ` Stephen J. Turnbull
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-21 9:01 UTC (permalink / raw)
To: Stephen J. Turnbull; +Cc: Stromeko, emacs-devel
> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Date: Fri, 21 Nov 2014 09:31:17 +0900
> Cc: Achim Gratz <Stromeko@nexgo.de>, emacs-devel@gnu.org
>
> > But that's me, and I already know how to solve this. I'm asking what,
> > if anything, do we want to recommend.
>
> I would say either go with *your* gut feeling, or if you prefer,
> somebody else you trust. ;-)
I don't yet trust my gut feeling with Git, except with features I
myself have enough experience with. This particular one is not among
them, as all the other projects where I gained my Git experience don't
present problems with several branches in the same tree.
> 1) single clone, multiple out-of-tree build directories (this is what
> I use). Disadvantages: IIRC Emacs uses the same "link lisp/ ->
> $srcdir/lisp" strategy that XEmacs does, so bootstrap takes a long
> time, and the first make after switching is likely to take a long
> time even if you don't bootstrap (because checked-out files all
> appear to have been touched). There will be several emacs binaries
> associated with the clone, so there is potential for confusion
> between the running Emacs and the checked-out version.
>
> 2) single clone, in-tree build. Disadvantages: as (1), but even more
> so, except that it's easier to keep emacs in synch with the sources
> as there's only one binary in existence.
>
> 3) multiple clones, build per clone (I don't think it much matters
> whether it is in-tree or not, and people who use out-of-tree builds
> probably have other reasons for doing that already, and they'll
> know what they are doing). Disadvantages: one of the clones will
> be used for "stable" -> trunk merges and reverse cherry-picking,
> and you need to keep track of which one. You also need a lot more
> VCS operations to keep them in synch.
>
> 4) single repo, multiple workspaces (use GITDIR variable, for
> example). Disadvantages: not well-supported by git AFAIK, so the
> user has to keep track of the global branch.
>
> Maybe you shouldn't mention (4).
I tend to recommend 3), but I don't understand the disadvantages; can
you elaborate? I thought it was possible to merge between clones, are
you saying that's not a good idea?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 9:01 ` Eli Zaretskii
@ 2014-11-22 5:30 ` Stephen J. Turnbull
2014-11-22 5:50 ` Yuri Khan
` (2 more replies)
0 siblings, 3 replies; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-22 5:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stromeko, emacs-devel
Eli Zaretskii writes:
> > From: "Stephen J. Turnbull" <stephen@xemacs.org>
> > 3) multiple clones, build per clone (I don't think it much matters
> > whether it is in-tree or not, and people who use out-of-tree builds
> > probably have other reasons for doing that already, and they'll
> > know what they are doing). Disadvantages: one of the clones will
> > be used for "stable" -> trunk merges and reverse cherry-picking,
> > and you need to keep track of which one. You also need a lot more
> > VCS operations to keep them in synch.
> I tend to recommend 3), but I don't understand the disadvantages; can
> you elaborate? I thought it was possible to merge between clones, are
> you saying that's not a good idea?
The disadvantages are relatively minor. Technically speaking, it's
not possible in git to merge between clones, you have to fetch and
then merge (== pull). But aside from this difference in terminology,
this should be familiar to bzr and Mercurial users who use multiple
workspaces. (In fact Mercurial users also use "pull", but it doesn't
update and commit.)
Another issue is that I find it easy to do fixes to the "wrong" branch
in the current repo, and that gets confusing. I also know how to
unwedge myself now, but I can remember getting confused about the
state of my repos occasionally. That might just be me, since I was
experimenting with various workflows.
Finally, I just find it more efficient to work in a single clone.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 5:30 ` Stephen J. Turnbull
@ 2014-11-22 5:50 ` Yuri Khan
2014-11-22 7:17 ` Stephen J. Turnbull
2014-11-22 6:50 ` Ivan Shmakov
2014-11-22 8:35 ` Eli Zaretskii
2 siblings, 1 reply; 41+ messages in thread
From: Yuri Khan @ 2014-11-22 5:50 UTC (permalink / raw)
To: Stephen J. Turnbull; +Cc: Eli Zaretskii, Achim Gratz, Emacs developers
On Sat, Nov 22, 2014 at 11:30 AM, Stephen J. Turnbull
<stephen@xemacs.org> wrote:
> Another issue is that I find it easy to do fixes to the "wrong" branch
> in the current repo, and that gets confusing.
You can customize your shell prompt to show you which branch you are
on, whether your working copy is dirty, and whether any interruptible
operation is currently in progress (merge, rebase, am, cherry-pick).
See the git-sh-prompt script in your git distribution.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 5:50 ` Yuri Khan
@ 2014-11-22 7:17 ` Stephen J. Turnbull
0 siblings, 0 replies; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-22 7:17 UTC (permalink / raw)
To: Yuri Khan; +Cc: Eli Zaretskii, Achim Gratz, Emacs developers
Yuri Khan writes:
> You can
You're missing the point. This thread is not about teaching users to
change their global configuration. It's about making minimal changes
to existing workflows to get them to work with git. The question is
not how to deal with any given issue, but rather whether users will
run into it.
> customize your shell prompt
And this just isn't sufficient, anyway. I have had such a shell
prompt since 1988. It doesn't help that much for reasons I don't
understand, and more important to my case, M-! doesn't show a shell
prompt.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 5:30 ` Stephen J. Turnbull
2014-11-22 5:50 ` Yuri Khan
@ 2014-11-22 6:50 ` Ivan Shmakov
2014-11-22 7:25 ` Stephen J. Turnbull
` (2 more replies)
2014-11-22 8:35 ` Eli Zaretskii
2 siblings, 3 replies; 41+ messages in thread
From: Ivan Shmakov @ 2014-11-22 6:50 UTC (permalink / raw)
To: emacs-devel
>>>>> Stephen J Turnbull <stephen@xemacs.org> writes:
[…]
> Technically speaking, it's not possible in git to merge between
> clones, you have to fetch and then merge (== pull).
Not necessarily, – you can just as well add the Git (or, rather,
.git/objects) directory of your “other” clone to your current’s
.git/objects/info/alternates, which will make the other clone’s
commits available for any operation – including merge – on the
current one. Like, say:
$ cat < emacs-foo/.git/objects
../../../emacs-bar/.git/objects
../../../emacs-qux/.git/objects
/read/only/archives/git/emacs.git/objects
$
If you do not care about the warning, you can even do this is in
a cyclic manner:
$ cat < emacs-bar/.git/objects
../../../emacs-foo/.git/objects
../../../emacs-qux/.git/objects
/read/only/archives/git/emacs.git/objects
$
[…]
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 6:50 ` Ivan Shmakov
@ 2014-11-22 7:25 ` Stephen J. Turnbull
2014-11-22 7:42 ` Ivan Shmakov
2014-11-22 8:36 ` Eli Zaretskii
2014-11-22 8:37 ` Andreas Schwab
2 siblings, 1 reply; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-22 7:25 UTC (permalink / raw)
To: Ivan Shmakov; +Cc: emacs-devel
Ivan Shmakov writes:
> >>>>> Stephen J Turnbull <stephen@xemacs.org> writes:
>
> […]
>
> > Technically speaking, it's not possible in git to merge between
> > clones, you have to fetch and then merge (== pull).
>
> Not necessarily, – you can just as well add the Git (or, rather,
> .git/objects) directory of your “other” clone to your current’s
> .git/objects/info/alternates, which will make the other clone’s
> commits available for any operation – including merge – on the
> current one.
OK, it's possible to avoid the copy/linking operations of fetch, but
you still need to do the merge in the current repo (and typically pull
the ref from the other repo). There are also reasons why using
alternates is not necessarily great (especially for new users) -- eg,
it means that rebase, commit --amend, filter-branch, and so on can
corrupt the dependent repo.
It's somewhat beside the point, but I don't consider the physical
location of objects in the DAG particularly interesting. fetch is
usually very cheap even over the network -- one hardly notices it
unless one distrusts coworkers enough to insist on a fetch-review-
merge workflow instead of a pull workflow.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 7:25 ` Stephen J. Turnbull
@ 2014-11-22 7:42 ` Ivan Shmakov
2014-11-22 8:59 ` Stephen J. Turnbull
0 siblings, 1 reply; 41+ messages in thread
From: Ivan Shmakov @ 2014-11-22 7:42 UTC (permalink / raw)
To: emacs-devel
>>>>> Stephen J Turnbull <stephen@xemacs.org> writes:
>>>>> Ivan Shmakov writes:
[…]
>> Not necessarily, – you can just as well add the Git (or, rather,
>> .git/objects) directory of your “other” clone to your current’s
>> .git/objects/info/alternates, which will make the other clone’s
>> commits available for any operation – including merge – on the
>> current one.
> OK, it's possible to avoid the copy/linking operations of fetch, but
> you still need to do the merge in the current repo
My understanding was that it was the intent.
> (and typically pull the ref from the other repo).
Refs are just human-readable aliases to the commit identifiers.
It’s perfectly possible to merge in a branch using the latter.
> There are also reasons why using alternates is not necessarily great
> (especially for new users) -- eg, it means that rebase, commit
> --amend, filter-branch, and so on can corrupt the dependent repo.
Only if the objects comprising the original commit get deleted
in the process; I’m unsure on what are the conditions to that.
Otherwise, the objects are immutable, and the likes of --amend
just create a brand new commit based on the given one; the
latter being left intact.
[…]
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 7:42 ` Ivan Shmakov
@ 2014-11-22 8:59 ` Stephen J. Turnbull
0 siblings, 0 replies; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-22 8:59 UTC (permalink / raw)
To: Ivan Shmakov; +Cc: emacs-devel
Ivan Shmakov writes:
> > (and typically pull the ref from the other repo).
>
> Refs are just human-readable aliases to the commit identifiers.
> It’s perfectly possible to merge in a branch using the latter.
How do you propose reliably identifying the *current* branch HEAD
without dereferencing that ref? Even if it's possible, it's likely
beyond the capability of the new users this thread is about.
> > There are also reasons why using alternates is not necessarily
> > great (especially for new users) -- eg, it means that rebase,
> > commit --amend, filter-branch, and so on can corrupt the
> > dependent repo.
>
> Only if the objects comprising the original commit get deleted
> in the process; I’m unsure on what are the conditions to that.
GC will do it eventually. Might take a couple months.
> Otherwise, the objects are immutable, and the likes of --amend
> just create a brand new commit based on the given one; the
> latter being left intact.
Yes, I know that.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 6:50 ` Ivan Shmakov
2014-11-22 7:25 ` Stephen J. Turnbull
@ 2014-11-22 8:36 ` Eli Zaretskii
2014-11-22 8:37 ` Andreas Schwab
2 siblings, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 8:36 UTC (permalink / raw)
To: Ivan Shmakov; +Cc: emacs-devel
> From: Ivan Shmakov <ivan@siamics.net>
> Date: Sat, 22 Nov 2014 06:50:51 +0000
>
> > Technically speaking, it's not possible in git to merge between
> > clones, you have to fetch and then merge (== pull).
>
> Not necessarily, – you can just as well add the Git (or, rather,
> .git/objects) directory of your “other” clone to your current’s
> .git/objects/info/alternates, which will make the other clone’s
> commits available for any operation – including merge – on the
> current one. Like, say:
>
> $ cat < emacs-foo/.git/objects
> ../../../emacs-bar/.git/objects
> ../../../emacs-qux/.git/objects
> /read/only/archives/git/emacs.git/objects
I don't think it's a good idea to recommend anything like that to
people who use Git for a short time, who are the main audience for the
Wiki recommendations.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 6:50 ` Ivan Shmakov
2014-11-22 7:25 ` Stephen J. Turnbull
2014-11-22 8:36 ` Eli Zaretskii
@ 2014-11-22 8:37 ` Andreas Schwab
2014-11-22 8:50 ` Ivan Shmakov
2 siblings, 1 reply; 41+ messages in thread
From: Andreas Schwab @ 2014-11-22 8:37 UTC (permalink / raw)
To: Ivan Shmakov; +Cc: emacs-devel
Ivan Shmakov <ivan@siamics.net> writes:
> Not necessarily, – you can just as well add the Git (or, rather,
> .git/objects) directory of your “other” clone to your current’s
> .git/objects/info/alternates, which will make the other clone’s
You should never do that to link to repositories that are used for
development. The originating repository doesn't know that others have
borrowed objects, and a garbage collection can remove them under their
feet.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 8:37 ` Andreas Schwab
@ 2014-11-22 8:50 ` Ivan Shmakov
0 siblings, 0 replies; 41+ messages in thread
From: Ivan Shmakov @ 2014-11-22 8:50 UTC (permalink / raw)
To: emacs-devel
>>>>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>>>> Ivan Shmakov <ivan@siamics.net> writes:
>> Not necessarily, – you can just as well add the Git (or, rather,
>> .git/objects) directory of your “other” clone to your current’s
>> .git/objects/info/alternates, which will make the other clone’s
>> commits available for any operation
> You should never do that to link to repositories that are used for
> development. The originating repository doesn't know that others
> have borrowed objects, and a garbage collection can remove them under
> their feet.
Personally, I do not use garbage collection at all. Instead,
after I’m finished with the clone, and make sure all its worthy
commits made it into a separate (--bare) repository, I’d remove
one in its entirety.
Sure, I’d unlink it from alternates first, and check if my other
clones are still valid after that, before the actual removal.
--
FSF associate member #7257 np. Conclusion — Apocalyptica … B6A0 230E 334A
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 5:30 ` Stephen J. Turnbull
2014-11-22 5:50 ` Yuri Khan
2014-11-22 6:50 ` Ivan Shmakov
@ 2014-11-22 8:35 ` Eli Zaretskii
2014-11-22 9:36 ` Stephen J. Turnbull
2 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 8:35 UTC (permalink / raw)
To: Stephen J. Turnbull; +Cc: Stromeko, emacs-devel
> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Cc: Stromeko@nexgo.de,
> emacs-devel@gnu.org
> Date: Sat, 22 Nov 2014 14:30:15 +0900
>
> Eli Zaretskii writes:
> > > From: "Stephen J. Turnbull" <stephen@xemacs.org>
>
> > > 3) multiple clones, build per clone (I don't think it much matters
> > > whether it is in-tree or not, and people who use out-of-tree builds
> > > probably have other reasons for doing that already, and they'll
> > > know what they are doing). Disadvantages: one of the clones will
> > > be used for "stable" -> trunk merges and reverse cherry-picking,
> > > and you need to keep track of which one. You also need a lot more
> > > VCS operations to keep them in synch.
>
> > I tend to recommend 3), but I don't understand the disadvantages; can
> > you elaborate? I thought it was possible to merge between clones, are
> > you saying that's not a good idea?
>
> The disadvantages are relatively minor. Technically speaking, it's
> not possible in git to merge between clones, you have to fetch and
> then merge (== pull).
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.
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.
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.
> 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.
> 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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 8:35 ` Eli Zaretskii
@ 2014-11-22 9:36 ` Stephen J. Turnbull
2014-11-22 10:25 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: Stephen J. Turnbull @ 2014-11-22 9:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stromeko, emacs-devel
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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 9:36 ` Stephen J. Turnbull
@ 2014-11-22 10:25 ` Eli Zaretskii
2014-11-22 11:31 ` Andreas Schwab
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 10:25 UTC (permalink / raw)
To: Stephen J. Turnbull; +Cc: Stromeko, emacs-devel
> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Cc: Stromeko@nexgo.de,
> emacs-devel@gnu.org
> Date: Sat, 22 Nov 2014 18:36:34 +0900
>
> > 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.
Yes, so I think merging from another clone is unnecessary.
> > 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.
I don't think we need the "../" part, do we? It's the same
repository, and emacs-24 is the name of a branch, not a directory.
I wonder if it's a good idea to tell people to pull from a different
branch, though. It could cause errors down the road (not in this
scenario). FWIW, I'd be nervous to do that.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 10:25 ` Eli Zaretskii
@ 2014-11-22 11:31 ` Andreas Schwab
2014-11-22 12:37 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: Andreas Schwab @ 2014-11-22 11:31 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stephen J. Turnbull, Stromeko, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> I think just "git pull -e ../emacs-24" and edit the commit message is
>> clearer, instead of pull and merging.
>
> I don't think we need the "../" part, do we? It's the same
> repository, and emacs-24 is the name of a branch, not a directory.
You don't pull from a branch, you pull from a repository. That's the
operation that copies objects from one repository to another.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 11:31 ` Andreas Schwab
@ 2014-11-22 12:37 ` Eli Zaretskii
2014-11-22 13:00 ` Andreas Schwab
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 12:37 UTC (permalink / raw)
To: Andreas Schwab; +Cc: stephen, Stromeko, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: "Stephen J. Turnbull" <stephen@xemacs.org>, Stromeko@nexgo.de, emacs-devel@gnu.org
> Date: Sat, 22 Nov 2014 12:31:41 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> I think just "git pull -e ../emacs-24" and edit the commit message is
> >> clearer, instead of pull and merging.
> >
> > I don't think we need the "../" part, do we? It's the same
> > repository, and emacs-24 is the name of a branch, not a directory.
>
> You don't pull from a branch, you pull from a repository. That's the
> operation that copies objects from one repository to another.
Ah, okay, thanks.
However, I was asking about merging from the release branch in the
same repository, just without checking out the release branch in that
repository, ever. In that case, I think this will do (assuming
'master' is checked out):
git pull
git merge emacs-24
# fix conflicts, if any
# run tests, fix bugs
git commit -a
git push
Am I missing something in this sequence?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 12:37 ` Eli Zaretskii
@ 2014-11-22 13:00 ` Andreas Schwab
2014-11-22 13:45 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: Andreas Schwab @ 2014-11-22 13:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: stephen, Stromeko, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> However, I was asking about merging from the release branch in the
> same repository, just without checking out the release branch in that
> repository, ever. In that case, I think this will do (assuming
> 'master' is checked out):
>
> git pull
> git merge emacs-24
You want to merge the remote-tracking branch origin/emacs-24. That's
what git pull (or rather git fetch) will update.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 13:00 ` Andreas Schwab
@ 2014-11-22 13:45 ` Eli Zaretskii
2014-11-22 14:12 ` Andreas Schwab
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 13:45 UTC (permalink / raw)
To: Andreas Schwab; +Cc: stephen, Stromeko, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: stephen@xemacs.org, Stromeko@nexgo.de, emacs-devel@gnu.org
> Date: Sat, 22 Nov 2014 14:00:22 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > However, I was asking about merging from the release branch in the
> > same repository, just without checking out the release branch in that
> > repository, ever. In that case, I think this will do (assuming
> > 'master' is checked out):
> >
> > git pull
> > git merge emacs-24
>
> You want to merge the remote-tracking branch origin/emacs-24. That's
> what git pull (or rather git fetch) will update.
Thanks. Just to be sure, the correct merge command should be
git merge remotes/origin/emacs-24
is that right?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 13:45 ` Eli Zaretskii
@ 2014-11-22 14:12 ` Andreas Schwab
2014-11-22 15:20 ` Eli Zaretskii
0 siblings, 1 reply; 41+ messages in thread
From: Andreas Schwab @ 2014-11-22 14:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: stephen, Stromeko, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Thanks. Just to be sure, the correct merge command should be
>
> git merge remotes/origin/emacs-24
>
> is that right?
You can abbreviate it to origin/emacs-24.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-22 14:12 ` Andreas Schwab
@ 2014-11-22 15:20 ` Eli Zaretskii
0 siblings, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-22 15:20 UTC (permalink / raw)
To: Andreas Schwab; +Cc: stephen, Stromeko, emacs-devel
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: stephen@xemacs.org, Stromeko@nexgo.de, emacs-devel@gnu.org
> Date: Sat, 22 Nov 2014 15:12:45 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Thanks. Just to be sure, the correct merge command should be
> >
> > git merge remotes/origin/emacs-24
> >
> > is that right?
>
> You can abbreviate it to origin/emacs-24.
Thanks.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-20 20:59 ` Eli Zaretskii
2014-11-21 0:31 ` Stephen J. Turnbull
@ 2014-11-21 8:23 ` martin rudalics
2014-11-21 9:06 ` Eli Zaretskii
2014-11-21 8:49 ` Thien-Thi Nguyen
2 siblings, 1 reply; 41+ messages in thread
From: martin rudalics @ 2014-11-21 8:23 UTC (permalink / raw)
To: Eli Zaretskii, Achim Gratz; +Cc: emacs-devel
> You are missing the point. Switching the branch is easy, but after
> that, you'd almost always need a full bootstrap, which might become
> annoying.
A bootstrap takes more than half an hour on my machines. Having touched
one C header file means that rebuilding takes almost 10 minutes here.
Calling that "annoying" would be an understatement. Having multiple
clones is an essential prerequsite here.
> I personally am working on both branches in parallel, yes. Many
> others do, too. Bugfixes go to one branch, new features to the other,
> people report bugs on this or other, etc. Bootstrapping each time,
> which takes a couple of minutes, is annoying. And then you sometimes
> want to compare what the two binaries, one from master, the other from
> the release branch, do in the same situation.
This is my workflow as well. Which doesn't exclude that git's branching
concept might be useful even here. Sometimes, at least.
> But that's me, and I already know how to solve this. I'm asking what,
> if anything, do we want to recommend.
Among others, the switch to MSYS has made building on Windows slow down
by a factor of two here (at least that's the impression I get). And I
never gave bisecting a thought on my machine even before that change.
In addition, recent changes to C mode has made editing C files slower by
a factor of two here. So I'm hardly going to tolerate further slowdowns
caused by switching branches.
Mine might be an exotic case and the only useful recommendation for me
is probably to get myself a new machine. Nevertheless I doubt that all
Emacs users have suitable hardware that makes switching between master
and Emacs-24 a feasible operation in one and the same clone.
martin
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 8:23 ` martin rudalics
@ 2014-11-21 9:06 ` Eli Zaretskii
2014-11-21 9:40 ` Dani Moncayo
2014-11-21 10:24 ` martin rudalics
0 siblings, 2 replies; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-21 9:06 UTC (permalink / raw)
To: martin rudalics; +Cc: Stromeko, emacs-devel
> Date: Fri, 21 Nov 2014 09:23:55 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: emacs-devel@gnu.org
>
> > You are missing the point. Switching the branch is easy, but after
> > that, you'd almost always need a full bootstrap, which might become
> > annoying.
>
> A bootstrap takes more than half an hour on my machines.
Are you using "make -jN"? If not, I highly recommend trying that. On
a Core i7 system, "make -j6" (if you have XP) or "make -j8" (Windows 7
and later) can work wonders on your build time.
> Having touched one C header file means that rebuilding takes almost
> 10 minutes here.
That's strange: compiling C sources is very fast, most of the
bootstrap time is spent compiling Lisp. What kind of CPU do you have
there?
> > I personally am working on both branches in parallel, yes. Many
> > others do, too. Bugfixes go to one branch, new features to the other,
> > people report bugs on this or other, etc. Bootstrapping each time,
> > which takes a couple of minutes, is annoying. And then you sometimes
> > want to compare what the two binaries, one from master, the other from
> > the release branch, do in the same situation.
>
> This is my workflow as well. Which doesn't exclude that git's branching
> concept might be useful even here. Sometimes, at least.
Of course, it's useful: for branches that don't diverge too much from
the branch you fork off, like feature branches, for example.
> Among others, the switch to MSYS has made building on Windows slow down
> by a factor of two here (at least that's the impression I get).
If "make -jN" is not speedy enough, consider replacing your work disk
with an SSD. The build will fly.
> I doubt that all Emacs users have suitable hardware that makes
> switching between master and Emacs-24 a feasible operation in one
> and the same clone.
For those who need to do that frequently, I agree.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 9:06 ` Eli Zaretskii
@ 2014-11-21 9:40 ` Dani Moncayo
2014-11-21 10:24 ` martin rudalics
1 sibling, 0 replies; 41+ messages in thread
From: Dani Moncayo @ 2014-11-21 9:40 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Emacs development discussions
>> Having touched one C header file means that rebuilding takes almost
>> 10 minutes here.
>
> That's strange: compiling C sources is very fast, most of the
> bootstrap time is spent compiling Lisp.
FWIW: I agree, and that, I think, is one reason why it would be great
to move large subsystems like GNUS or CEDET into GNU ELPA;
bootstrapping would be much faster.
--
Dani Moncayo
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 9:06 ` Eli Zaretskii
2014-11-21 9:40 ` Dani Moncayo
@ 2014-11-21 10:24 ` martin rudalics
2014-11-21 10:40 ` Eli Zaretskii
1 sibling, 1 reply; 41+ messages in thread
From: martin rudalics @ 2014-11-21 10:24 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stromeko, emacs-devel
> Are you using "make -jN"? If not, I highly recommend trying that. On
> a Core i7 system, "make -j6" (if you have XP) or "make -j8" (Windows 7
> and later) can work wonders on your build time.
I can try that next time. But my last bootstrap before the git switch
was a couple of months ago, so I doubt it would matter much.
>> Having touched one C header file means that rebuilding takes almost
>> 10 minutes here.
>
> That's strange: compiling C sources is very fast, most of the
> bootstrap time is spent compiling Lisp.
Compiling Lisp files has never been an annoyance to me. It's my
impression that I spend most of the time entering and leaving
directories, loading files, updating subdirectories, generating
autoloads, checking whether files have changed. And configuring, if
necessary.
> What kind of CPU do you have
> there?
Windows XP here runs on a 1.80GHz Pentium Dual CPU.
> Of course, it's useful: for branches that don't diverge too much from
> the branch you fork off, like feature branches, for example.
I yet have to find out whether that's the case here.
>> Among others, the switch to MSYS has made building on Windows slow down
>> by a factor of two here (at least that's the impression I get).
>
> If "make -jN" is not speedy enough, consider replacing your work disk
> with an SSD. The build will fly.
;-)
martin
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 10:24 ` martin rudalics
@ 2014-11-21 10:40 ` Eli Zaretskii
0 siblings, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-21 10:40 UTC (permalink / raw)
To: martin rudalics; +Cc: Stromeko, emacs-devel
> Date: Fri, 21 Nov 2014 11:24:56 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: Stromeko@nexgo.de, emacs-devel@gnu.org
>
> > Are you using "make -jN"? If not, I highly recommend trying that. On
> > a Core i7 system, "make -j6" (if you have XP) or "make -j8" (Windows 7
> > and later) can work wonders on your build time.
>
> I can try that next time. But my last bootstrap before the git switch
> was a couple of months ago, so I doubt it would matter much.
"make -j" speeds up normal builds as well.
> > What kind of CPU do you have there?
>
> Windows XP here runs on a 1.80GHz Pentium Dual CPU.
Then I'd suggest "make -j2", and expect that to slash the times by a
factor of 2.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-20 20:59 ` Eli Zaretskii
2014-11-21 0:31 ` Stephen J. Turnbull
2014-11-21 8:23 ` martin rudalics
@ 2014-11-21 8:49 ` Thien-Thi Nguyen
2014-11-21 9:12 ` Eli Zaretskii
2 siblings, 1 reply; 41+ messages in thread
From: Thien-Thi Nguyen @ 2014-11-21 8:49 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]
() Eli Zaretskii <eliz@gnu.org>
() Thu, 20 Nov 2014 22:59:07 +0200
Switching the branch is easy, but after that, you'd almost
always need a full bootstrap, which might become annoying.
The pain point seems to be bootstrap, so might as well
address it directly in the instructions: "If hacking TOPIC
will require bootstrap, then probably you want a separate
working tree on branch TOPIC. Otherwise, you can use the
same working tree and switch branches."
We are talking about simplified instructions here, mind
you. Don't take that as a general advice for advanced
users: they don't need these instructions.
I think it's okay to have a small conditional branch (argh,
another overloaded use of that word!) in these instructions.
Being explicit about intent puts the onus of choice on the
reader, which is where it belongs when it comes to managing
pain.
--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: git commit/push and VC
2014-11-21 8:49 ` Thien-Thi Nguyen
@ 2014-11-21 9:12 ` Eli Zaretskii
0 siblings, 0 replies; 41+ messages in thread
From: Eli Zaretskii @ 2014-11-21 9:12 UTC (permalink / raw)
To: emacs-devel; +Cc: emacs-devel
> From: Thien-Thi Nguyen <ttn@gnu.org>
> Date: Fri, 21 Nov 2014 09:49:07 +0100
>
> Switching the branch is easy, but after that, you'd almost
> always need a full bootstrap, which might become annoying.
>
> The pain point seems to be bootstrap, so might as well
> address it directly in the instructions: "If hacking TOPIC
> will require bootstrap, then probably you want a separate
> working tree on branch TOPIC.
The main point here is not hacking TOPIC, it's working in parallel in
master and in release branch. Those diverge very fast in Emacs, so
switching almost always will require a full bootstrap. Most, if not
all, of the other use cases can use a single clone.
> We are talking about simplified instructions here, mind
> you. Don't take that as a general advice for advanced
> users: they don't need these instructions.
>
> I think it's okay to have a small conditional branch (argh,
> another overloaded use of that word!) in these instructions.
> Being explicit about intent puts the onus of choice on the
> reader, which is where it belongs when it comes to managing
> pain.
If you mean that the instructions should explain the considerations
for and against using "commit -a", then I don't think that's the place
for that. The text might say "we recommend using 'commit -a' because
it avoids the need to use 'git add', except when you add new files",
but that's about all. The Wiki is not the place for describing these
choices in too much detail, or we will lose the reader's attention.
That page is already too long, IMO; I moved some of the stuff to the
end of it so it doesn't interfere with the workflow description.
^ permalink raw reply [flat|nested] 41+ messages in thread