Re: [RFC] git-remote

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

 



On Fri, 05 Jan 2007 17:59:52 -0800, Junio C Hamano wrote:
> > 	git init-db
> > 	git remote add $url
> > 	git pull $name
>
> you could say "git remote add $name $url" here, having computed
> $name already.

Though I guess clone would actually be doing the equivalent of:

	git remote add origin $url

correct?

So that undercuts my argument a bit. If clone is always just using
"origin" for the remote that it creates then it's harder to justify
making "remote add" use part of the URL for the name. It would seem
convenient to be able to do:

	git remote add git://hosting.org/$project/$maintainer1
	git remote add git://hosting.org/$project/$maintainer2

but I guess that wouldn't help much if the project were organized
such that what's need is actually:

	git remote add $maintainer1 git://hosting.org/~$maintainer1/$project
	git remote add $maintainer2 git://hosting.org/~$maintainer2/$project

But the other piece is that clone does one thing more than setting up
a remote. It also creates a local branch "master" that is configured
with "remote" and "merge" entries. There's still no simple command
that sets this up that could be added to make the above list of steps
for a "manual clone" complete is there?

And by "simple" I mean something other than:

	git repo-config branch.master.remote origin
	git repo-config branch.master.merge refs/heads/master

It seems we're still missing a simple command that would create this
commonly desired arrangement. The only real input here is a local
branch name and a corresponding remote-tracking branch, (from which
the values for remote and merge could be determined). We've mentioned
before that "git checkout newbranch remote-tracking-branch" already
accepts those two pieces of information, so maybe we just want an
option there to create this extra configuration for further
tracking/merging.

-Carl

PS. It's probably too late, since "remote" already appears in
.git/remotes and in branch.*.remote entries in .git/config, but I do
have to say that "git remote add" looks really odd. The most natural
way to parse that is with "remote" as an adjective---so perhaps
interpreting this as a variant of "git add" that does something on the
remote side?

Previously, when I've wanted the functionality of what is now "remote
add" I've imagined it as a variant of "git clone" that would clone
"into" my existing repository (with a new "remote" name) rather than
creating a new repository. Or maybe this could be some new verb, (I'd
like something like "git track url [name]" perhaps. Though using a
verb would make it harder to add other actions beyond creation.

Anyway, there's some naming feedback, but like I said, it might be too
late to be used at all.

Attachment: pgpzZvNOAtQQM.pgp
Description: PGP 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]