Thread (5 messages) flat view 5 messages, 5 authors, 2016-08-11

Re: Rationale for the "Never commit to the right side of a Pull line" rule

From: Luben Tuikov <hidden>
Date: 2016-08-11 20:22:30

--- Jerome Lovy <t2a2e9z8ncbs9qg@brefemail.com> wrote:
Hi,

Could someone please point me to / give me the rationale for the "Never 
commit to the right side of a Pull line" rule ?

I found the rule in the second Note of the git-fetch man-page (eg 
http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html).

It's been taken over in _bold letters_ by X.Org/freedesktop.org in their 
"UsingGit" document (http://freedesktop.org/wiki/UsingGit).

In both places though, I don't see any explanation, but rather a 
commandment ;-) . Am I missing the ovious ?
Yes, you are missing the obvious and yes it is explained.
Read the 2nd "Note" for the documentation of "git-fetch":

http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html

Quoted here for convenience:

[NOTE]
You never do your own development on branches that appear
on the right hand side of a <refspec> colon on `Pull:` lines;
they are to be updated by `git-fetch`.  If you intend to do
development derived from a remote branch `B`, have a `Pull:`
line to track it (i.e. `Pull: B:remote-B`), and have a separate
branch `my-B` to do your development on top of it.  The latter
is created by `git branch my-B remote-B` (or its equivalent `git
checkout -b my-B remote-B`).  Run `git fetch` to keep track of
the progress of the remote side, and when you see something new
on the remote branch, merge it into your development branch with
`git pull . remote-B`, while you are on `my-B` branch.
The common `Pull: master:origin` mapping of a remote `master`
branch to a local `origin` branch, which is then merged to a
local development branch, again typically named `master`, is made
when you run `git clone` for you to follow this pattern.

  Luben

My candid thoughts: to me the practice recommended here seems 
subjectively "cleaner" indeed, but is it objectively better or even 
essential? Why?

TIA
Jérôme

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help