Re: [git] Re: Pull is Evil

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

 



On Thu, May 01, 2014 at 02:04:33PM -0400, Marc Branchaud wrote:
> On 14-05-01 01:56 PM, W. Trevor King wrote:
> > On Thu, May 01, 2014 at 11:20:44AM -0400, Marc Branchaud wrote:
> >> On 14-05-01 05:46 AM, brian m. carlson wrote:
> >>>   git checkout maintenance-branch
> >>>   # Update our maintenance branch to the latest from the main repo.
> >>>   git pull --ff-only
> >>>   git pull --no-ff developer-remote topic-branch
> >>>   git push main-repo HEAD
> >>
> >> …
> >> What's more, it seems to me that the only real advantage "git pull" provides
> >> here is a less typing compared to the non-pull equivalent:
> >>
> >>   git fetch main-repo
> >>   git checkout main-repo/maintenance-branch
> >>   git fetch developer-remote
> >>   git merge --no-ff developer-remote/topic-branch
> >>   git push main-repo HEAD
> > 
> > You're missing Brian's fast-forward merge here.  It should be:
> > 
> >   git checkout maintenance-branch
> >   git fetch main-repo
> >   git merge --ff-only main-repo/maintenance-branch
> >   git fetch developer-remote
> >   …
> 
> I think you're mistaken -- I checked out "main-repo/maintenance-branch"
> directly, so there's no need to fast-forward a local branch.

I actually need my local copy to be up-to-date.  Part of my workflow,
which I omitted for the sake of brevity, is running scripts that rely on
my local branch's name, format, and contents.

My use case is that I'm one of several code reviewers, and I update my
branch, merge in another developer's changes, review them, and then push
them if they're good.  I need to pull from the main repo immediately
before merging, to minimize the chances that someone else will have
pushed before me, which would result in me having to redo the merge
(because the push has to be fast-forward).

I just used this to illustrate the fact that there isn't actually one
completely correct case with pull.  I have aliases for pull (and merge)
--ff-only and --no-ff, and I never actually use plain git pull unless I
really don't care whether or not it's a fast-forward.  So I'm okay with
the status quo because I have distinct choices for merge, no merge, and
don't care.  I don't really have a strong opinion, though, as long as
those three options remain.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]