Re: [PATCHv4] Documentation: triangular workflow
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jun 11, 2016, 15:58 UTC
- Message-ID
- <CALkWK0nJDwH27V9B+X2K=c_X2k82ZXnab1r1zR6_axipxT5gkg@mail.gmail.com>
- In-Reply-To
- <xmqqmvmui9d2.fsf@gitster.mtv.corp.google.com>
Junio C Hamano wrote:
Show 7 quoted lines
> Jordan DE GEA wrote: > > > +* Allows contributors to work with Git even though they do not have > > +write access to **UPSTREAM**. > > > > +* Allows maintainers to receive code from contributors they may not > > +trust.
Triangular workflow is the ability to accept changes from contributors without mailing patches back-and-forth. Whether they send a pull request or commit directly to the master repository when review is done, is inconsequential. Essentially, they maintain forks of upstream, which they work on at their own pace.
> > +* Code review is more efficient > > I have no idea what data you have to back this claim up. More > efficient compared to what?
They're orthogonal. LLVM has one giant SVN server that everyone commits directly to. However, they review process is a lot more efficient than GitHub projects, because they use Phabricator. What does code review tool have to do with triangular workflow?
Show 34 quoted lines
> > +Preparation > > +~~~~~~~~~~~ > > + > > +Cloning from **PUBLISH**, which is a fork of **UPSTREAM** or an empty > > +repository. > > + > > +====================== > > +`git clone <PUBLISH_url>` > > +====================== > > + > > +Setting the behavior of push for the triangular workflow: > > + > > +=========================== > > +`git config push.default current` > > +=========================== > > + > > +Adding **UPSTREAM** remote: > > + > > +=================================== > > +`git remote add upstream <UPSTREAM_url>` > > +=================================== > > + > > +With the `remote add` above, using `git pull upstream` pulls there, > > +instead of saying its URL. In addition, `git pull` can pull from > > +**UPSTREAM** without argument. > > + > > +For each branch requiring a triangular workflow, set > > +`branch.<branch>.remote` and `branch.<branch>.pushRemote`. > > + > > +Example with master as <branch>: > > +=================================== > > +* `git config branch.master.remote upstream` > > +* `git config branch.master.pushRemote origin` > > +===================================
It's much too simple now. Just `git clone <upstream>`, `git remote add mine <fork-url>`, and `git config remote.pushdefault mine`. Only the last line requires an explanation.
> Instead you would set default.pushRemote to publish > just once, and no matter how many branches you create later, you do > not have to do anything special.
I think you meant remote.pushdefault here?