From: Jon Loeliger Date: Mon, 26 Sep 2005 20:17:32 GMT Subject: Re: GIT 0.99.7d, and end of week status. Message-ID: <1127765852.5735.36.camel@cashmere.sps.mot.com> In-Reply-To: <7v7jd4n22i.fsf@assigned-by-dhcp.cox.net> On Sun, 2005-09-25 at 18:46, Junio C Hamano wrote: > Tom Prince writes: > > >> When you already have a repository to track git.git, I would > >> recommend to have something like this in .git/remote/origin: > >> > >> URL: http://kernel.org/pub/scm/git/git.git > >> Pull: master:origin maint:maint +pu:pu > >> > > > > A warning when you do this. If you say > > > > git pull origin > > > > then your master will be updated with an octopus merge of the three heads. > > Ahhhhhhhh. That is true. I always do "git fetch" and never do > "git pull" against anything but a local repository, heads > explicitly specified. You are right. The defaulting behaviour > is incredibly broken. > > Do people agree it is a good idea to change the "git pull > origin" to mean "fetch all the default refs specified on Pull: > lines, and merge only the first one into the current branch"? > > "git pull" without remote nor refspecs is a synonym to "git pull > origin" as before, and 99.99% of the time "git pull" from a > remote repo without explicit refspec is doing just one head > merge, so I think this is a sane default, much saner than the > current mess, while still allowing you to keep track of what's > happening in the other branches by doing fetches of all the > heads at once. > > Opinions? Hmmm... Would it make sense to introduce something like this instead: # When fetching, get bits from here: URL: http://...../git.git # When fetching, grab and map like this: Fetch: master:origin maint:maint +pu:pu # When merging, merge origin, maint and pu into master Merge: master origin maint pu With the intent that the "Fetch:" line effectively limits the fetching operation to git-fetch, and doesn't specify how to merge. Then, the "Merge:" line specifies how to do the git-merge bits. If you didn't want to merge in the maint and pu bits, this would have been the line instead: # Merge into master the just the origin bits Merge: master origin If you want the dual-step fetch+merge, the leave the "Pull:" line as originally written: # Fetch and merge Pull: master:origin maint:maint +pu:pu Syntax can be argued, of course. My point being to introduce another line to the remote file that distinguishes the default behavior for each step along the way. Thanks, jdl