From: Carl Worth Subject: Re: [RFC] git-clone: add --track support Date: Thu, 12 Apr 2007 09:34:16 -0700 Message-ID: <87veg1tuuv.wl%cworth@cworth.org> References: <1176372539871-git-send-email-martin@catalyst.net.nz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Apr_12_09:34:09_2007-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org, junkio@cox.net To: Martin Langhoff X-From: git-owner@vger.kernel.org Thu Apr 12 18:41:18 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hc2MG-0005aW-DT for gcvg-git@gmane.org; Thu, 12 Apr 2007 18:41:17 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932315AbXDLQlG (ORCPT ); Thu, 12 Apr 2007 12:41:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932339AbXDLQlG (ORCPT ); Thu, 12 Apr 2007 12:41:06 -0400 Received: from theworths.org ([217.160.253.102]:49790 "EHLO theworths.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932315AbXDLQlD (ORCPT ); Thu, 12 Apr 2007 12:41:03 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Thu, 12 Apr 2007 12:41:03 EDT Received: (qmail 28945 invoked from network); 12 Apr 2007 12:34:18 -0400 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 12 Apr 2007 12:34:18 -0400 In-Reply-To: <1176372539871-git-send-email-martin@catalyst.net.nz> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Thu_Apr_12_09:34:09_2007-1 Content-Type: text/plain; charset=US-ASCII On Thu, 12 Apr 2007 22:08:59 +1200, Martin Langhoff wrote: > Not sure if Junio wants this, but if I am going to migrate > away from cogito, I'd like these common operations to be > dead simple. Hi Martin, Whether we're talking about cogito migration or not, I also want these operations to be dead simple. So I really appreciate seeing your efforts on this front. > This is something cogito supports using the #branchname > syntax. I am pretty sure git supports it when fetching > but alas, no longer for cloning. I seem to recall Linus complaining about the #branchname syntax because it allows for only one branch name. So one thing to think about is how to allow for multiple branches to be tracked while cloning, ("--track branch1 --track branch2" ?). Separately, something I've always wanted is a succint way to advertise a complete specification of a branch that users could conveniently take, (read, "cut-and-paste, preferably with double-click"), and use whether they wanted to do any one of the following operations: 1. Make a new clone, and checkout that branch 2. Fetch that branch into an existing clone 3. Add that branch to an existing clone as something to start tracking So, if you wanted to try to tackle that problem as well, that would be great. (It's basically an extension of your "git clone --track" idea---allowing it to be performed after a clone as well, but without any more complication in the user interface.) For this, I think the #branch syntax is actually worthing thinking about. With it, the above three operations could be provided with operations something like: git clone #branch git fetch #branch git track #branch Where this new git-track command would encompass a lot of the work that git-clone is doing currently. That is, the git-clone rewrite that Junio is envisioning could be implemented something like: mkdir cd git init-db git track #branch In other words, most of the interesting stuff that git-clone does would still be available in an existing clone by using this new git-track command. By the way, the #branch syntax isn't essential for what I'm describing here. This syntax does provide something that could be usefully provided to either git-clone or git-fetch as a single command. This is opposed to the current state where I have to say things like: If you've got a clone already, do: [*] git fetch branch:branch git checkout branch If you don't have a clone yet, do: git clone git checkout -b branch origin/branch But whether or not #branch syntax is adopted, providing the post-init-db guts of git-track would still be useful, and it could still accept the same means of specifying multiple branches that git fetch accepts: git track branch1 branch2 ... Anyway, there's some food for thought for anyone that's working on adding these kind of conveniences to git, (which I would find extremely valuable). -Carl --pgp-sign-Multipart_Thu_Apr_12_09:34:09_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGHl+I6JDdNq8qSWgRAjafAJ96Io8MRlcFErNTtPN42H0pLprw+ACeKtu6 Eufi4yiJ1GpO0wgGHnQQXe8= =wZDN -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Apr_12_09:34:09_2007-1--