Re: Making git disappear when talking about my code (was: Re: GIT vs Other: Need argument)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Carl Worth <cworth@...>
Cc: Junio C Hamano <junkio@...>, Linus Torvalds <torvalds@...>, Marcin Kasperski <Marcin.Kasperski@...>, <git@...>
Date: Wednesday, April 25, 2007 - 3:44 pm

On Wed, 25 Apr 2007, Carl Worth wrote:


Linus has stated a preference on the lkml for being told about branches in 
the syntax used for anonymous pulls: URL branchname.

That is, you say:

  Please pull from:
    git://server/path branch

And he cuts and pastes into the command line:

  git pull git://server/path branch

Now, this syntax isn't available for git-clone, because git-clone puts the 
optional directory to create after the URL. But, in an ideal world, this 
is how it would work; you could see a pull request, and just type "git 
some-command <paste>".


Here, you probably need to specify what you want the new branch to be, 
because it will often be the case that the remote branch will be "master" 
in a repository with a long unrecognizable URL, and you need to be able to 
switch to and away from the branch in some sane way. On the other hand, 
the user will presumably never care too deeply about the remote, aside 
from that git remembers stuff appropriately. I say, use the hash of the 
URL as the name of the remote, and provide some shorthand for the tracking 
branch that would be merged by default into the current head, and you're 
set. I.e.:

git track new-name URL [branch]

creates and checks out a new branch "new-name" with the config:

[remote "hash of URL"]
	url = URL
	fetch = +refs/heads/*:refs/remotes/hash of URL/*
[branch "new-name"]
	remote = "hash of URL"
	merge = refs/heads/[branch]

When on this branch, you update with "git pull" (which already works, 
given this configuration). And there would just need to be a better way of 
doing "git log remotes/hash of URL/branch..HEAD", which should probably be 
something like "git log MERGE..HEAD", with MERGE being magic for the thing 
that tracks the current branch's "merge" setting.

Incidentally, I'm not seeing the case of wanting to track multiple 
branches from the same repository as nearly as likely for a novice as 
wanting to track multiple branches from different repositories. I think 
the likely order of being interested in things is:

1. The project's maintainer's repository, exactly one of maint, master, or 
   next.
2. Somebody else's repository for some interesting feature, master
3. Somebody else's repository for all interesting features, some branch
4. Repository from 3, additional branches
5. Maintainer's repository, multiple branches.

With the most common case for two tracking branches being master from two 
repositories, such that upstream branch names are most often useless for 
distinguishing anything.

	-Daniel
*This .sig left intentionally blank*
-
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: GIT vs Other: Need argument, Junio C Hamano, (Tue Apr 24, 1:15 am)
Re: Making git disappear when talking about my code (was: Re..., Daniel Barkalow, (Wed Apr 25, 3:44 pm)
Re: Making git disappear when talking about my code, Junio C Hamano, (Wed Apr 25, 3:56 pm)
Re: Making git disappear when talking about my code, Daniel Barkalow, (Wed Apr 25, 5:38 pm)
Re: Making git disappear when talking about my code, Nicolas Pitre, (Wed Apr 25, 4:32 pm)
Re: Making git disappear when talking about my code, Linus Torvalds, (Wed Apr 25, 4:29 pm)
Re: Making git disappear when talking about my code, Junio C Hamano, (Wed Apr 25, 3:17 pm)
Re: Making git disappear when talking about my code, Carl Worth, (Wed Apr 25, 4:26 pm)
Re: Making git disappear when talking about my code, Nicolas Pitre, (Wed Apr 25, 3:22 pm)
Re: GIT vs Other: Need argument, J. Bruce Fields, (Tue Apr 24, 10:23 am)
Re: GIT vs Other: Need argument, Linus Torvalds, (Tue Apr 24, 11:01 am)
Re: GIT vs Other: Need argument, J. Bruce Fields, (Mon Apr 30, 12:31 am)