git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [FEATURE REQUEST] git clone, just clone selected branches?
@ 2007-10-10 18:55 Joakim Tjernlund
  2007-10-10 19:35 ` Johannes Schindelin
  2007-10-10 19:38 ` Linus Torvalds
  0 siblings, 2 replies; 9+ messages in thread
From: Joakim Tjernlund @ 2007-10-10 18:55 UTC (permalink / raw)
  To: git

To my knowlede a git clone always clones all branches from the remote repo.
I would like the possibly to clone selected branches, like
 git clone <repo URL> -b master -b upstream
which will only fetch the master and upstream branch.

I know I can use git remote to do this, but it is a bit clumsy 
when starting a new repo.

What do you think?

 Jocke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 18:55 [FEATURE REQUEST] git clone, just clone selected branches? Joakim Tjernlund
@ 2007-10-10 19:35 ` Johannes Schindelin
  2007-10-10 21:25   ` Joakim Tjernlund
  2007-10-10 19:38 ` Linus Torvalds
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2007-10-10 19:35 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: git

Hi,

On Wed, 10 Oct 2007, Joakim Tjernlund wrote:

> To my knowlede a git clone always clones all branches from the remote 
> repo. I would like the possibly to clone selected branches, like
>  git clone <repo URL> -b master -b upstream
> which will only fetch the master and upstream branch.
> 
> I know I can use git remote to do this, but it is a bit clumsy when 
> starting a new repo.

This is why I suggest: since it is an itch of yours, just fix it.  You are 
in the prime position to know when you're satisfied.

As a hint how to start: Junio dreamt of a git-clone which is a tiny 
wrapper around git-fetch and git-remote.

So you could start by writing a script which would be a replacement for 
git-clone.sh, and there you can also include the support for -b that you 
would like so much.

It would be nice, though, to keep this in separate patches, which you then 
submit to this list.

Thank you,
Dscho

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 18:55 [FEATURE REQUEST] git clone, just clone selected branches? Joakim Tjernlund
  2007-10-10 19:35 ` Johannes Schindelin
@ 2007-10-10 19:38 ` Linus Torvalds
  2007-10-10 21:36   ` Joakim Tjernlund
  1 sibling, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2007-10-10 19:38 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: git



On Wed, 10 Oct 2007, Joakim Tjernlund wrote:
> 
> I know I can use git remote to do this, but it is a bit clumsy 
> when starting a new repo.

How about just

	git init
	.. set up remote tracking info in .git/config ..
	git fetch remote

which should do what you want.

		Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 19:35 ` Johannes Schindelin
@ 2007-10-10 21:25   ` Joakim Tjernlund
  2007-10-10 21:56     ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2007-10-10 21:25 UTC (permalink / raw)
  To: 'Johannes Schindelin'; +Cc: git

> -----Original Message-----
> From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] 
> Sent: den 10 oktober 2007 21:35
> To: Joakim Tjernlund
> Cc: git@vger.kernel.org
> Subject: Re: [FEATURE REQUEST] git clone, just clone selected 
> branches?
> 
> Hi,
> 
> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:
> 
> > To my knowlede a git clone always clones all branches from 
> the remote 
> > repo. I would like the possibly to clone selected branches, like
> >  git clone <repo URL> -b master -b upstream
> > which will only fetch the master and upstream branch.
> > 
> > I know I can use git remote to do this, but it is a bit clumsy when 
> > starting a new repo.
> 
> This is why I suggest: since it is an itch of yours, just fix 
> it.  You are 
> in the prime position to know when you're satisfied.
> 
> As a hint how to start: Junio dreamt of a git-clone which is a tiny 
> wrapper around git-fetch and git-remote.
> 
> So you could start by writing a script which would be a 
> replacement for 
> git-clone.sh, and there you can also include the support for 
> -b that you 
> would like so much.
> 
> It would be nice, though, to keep this in separate patches, 
> which you then 
> submit to this list.
> 
> Thank you,
> Dscho

Thank you for these words of visdom, I should know better
than to throw out ideas like this. Next time I have an suggestion
I will think long and hard about it before posting again. 

 Jocke 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 19:38 ` Linus Torvalds
@ 2007-10-10 21:36   ` Joakim Tjernlund
  2007-10-11  9:18     ` Andreas Ericsson
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2007-10-10 21:36 UTC (permalink / raw)
  To: 'Linus Torvalds'; +Cc: git

> -----Original Message-----
> From: Linus Torvalds [mailto:torvalds@linux-foundation.org] 
> Sent: den 10 oktober 2007 21:38
> To: Joakim Tjernlund
> Cc: git@vger.kernel.org
> Subject: Re: [FEATURE REQUEST] git clone, just clone selected 
> branches?
> 
> 
> 
> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:
> > 
> > I know I can use git remote to do this, but it is a bit clumsy 
> > when starting a new repo.
> 
> How about just
> 
> 	git init
> 	.. set up remote tracking info in .git/config ..
> 	git fetch remote
> 
> which should do what you want.
> 
> 		Linus

>From git remote man page:
 o  Imitate git clone but track only selected branches

          $ mkdir project.git
          $ cd project.git
          $ git init
          $ git remote add -f -t master -m master origin git://example.com/git.git/
          $ git merge origin

yes, this does the trick too but that is more to type so I thought
it would be simpler if I could just tell git clone which branches I want.
Now, this isn't a killer feature to me so if you don't like it, I good
with that too.

 Jocke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 21:25   ` Joakim Tjernlund
@ 2007-10-10 21:56     ` Johannes Schindelin
  2007-10-10 22:41       ` Joakim Tjernlund
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2007-10-10 21:56 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: git

Hi,

On Wed, 10 Oct 2007, Joakim Tjernlund wrote:

> I should know better than to throw out ideas like this. Next time I have 
> an suggestion I will think long and hard about it before posting again.

Hey, it was just a try.

Personally, I am not interested in the feature _you_ asked for, but I 
thought it might be pretty easy for you to rewrite git-clone.sh to take 
advantage of git-fetch and git-remote, and that your desired feature would 
be easier to add then.  So easy that the whole thing would have taken you 
all of an hour or so.

But maybe somebody else is interested enough to scratch your itch.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 21:56     ` Johannes Schindelin
@ 2007-10-10 22:41       ` Joakim Tjernlund
  2007-10-10 23:01         ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2007-10-10 22:41 UTC (permalink / raw)
  To: 'Johannes Schindelin'; +Cc: git

> -----Original Message-----
> From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] 
> 
> Hi,
> 
> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:
> 
> > I should know better than to throw out ideas like this. 
> Next time I have 
> > an suggestion I will think long and hard about it before 
> posting again.
> 
> Hey, it was just a try.

Some people might get scared away from such tries

> 
> Personally, I am not interested in the feature _you_ asked for, but I 

NP, if it only me that is interested then this is probably not such a good idea.

> thought it might be pretty easy for you to rewrite 
> git-clone.sh to take 
> advantage of git-fetch and git-remote, and that your desired 
> feature would 
> be easier to add then.  So easy that the whole thing would 
> have taken you 
> all of an hour or so.

Well, now I had to take a look and I think you are overestimating my capabilities :)
It is a 12KB script full of git-plumbing I have never used, nor do I do
sh scripts well. It might be an hour for you, but I would probably have
to spend the whole day :)

 Jocke
> 
> But maybe somebody else is interested enough to scratch your itch.
> 
> Ciao,
> Dscho
> 
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 22:41       ` Joakim Tjernlund
@ 2007-10-10 23:01         ` Johannes Schindelin
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2007-10-10 23:01 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: git

Hi,

On Thu, 11 Oct 2007, Joakim Tjernlund wrote:

> > -----Original Message-----
> > From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] 
> > 
> > thought it might be pretty easy for you to rewrite git-clone.sh to 
> > take advantage of git-fetch and git-remote, and that your desired 
> > feature would be easier to add then.  So easy that the whole thing 
> > would have taken you all of an hour or so.
> 
> Well, now I had to take a look and I think you are overestimating my 
> capabilities :) It is a 12KB script full of git-plumbing I have never 
> used, nor do I do sh scripts well. It might be an hour for you, but I 
> would probably have to spend the whole day :)

Heh.  git-clone is pretty crowded.  But it predates git-remote.  And I 
have a hunch that git-clone will be a trivial script when it calls 
git-remote and the git-fetch.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [FEATURE REQUEST] git clone, just clone selected branches?
  2007-10-10 21:36   ` Joakim Tjernlund
@ 2007-10-11  9:18     ` Andreas Ericsson
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Ericsson @ 2007-10-11  9:18 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: 'Linus Torvalds', git

Joakim Tjernlund wrote:
>> -----Original Message-----
>> From: Linus Torvalds [mailto:torvalds@linux-foundation.org] 
>> Sent: den 10 oktober 2007 21:38
>> To: Joakim Tjernlund
>> Cc: git@vger.kernel.org
>> Subject: Re: [FEATURE REQUEST] git clone, just clone selected 
>> branches?
>>
>>
>>
>> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:
>>> I know I can use git remote to do this, but it is a bit clumsy 
>>> when starting a new repo.
>> How about just
>>
>> 	git init
>> 	.. set up remote tracking info in .git/config ..
>> 	git fetch remote
>>
>> which should do what you want.
>>
>> 		Linus
> 
> From git remote man page:
>  o  Imitate git clone but track only selected branches
> 
>           $ mkdir project.git
>           $ cd project.git
>           $ git init
>           $ git remote add -f -t master -m master origin git://example.com/git.git/
>           $ git merge origin
> 
> yes, this does the trick too but that is more to type so I thought
> it would be simpler if I could just tell git clone which branches I want.
> Now, this isn't a killer feature to me so if you don't like it, I good
> with that too.
> 

Well, that's how git-clone should probably look, now that git-remote exists.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-10-11  9:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 18:55 [FEATURE REQUEST] git clone, just clone selected branches? Joakim Tjernlund
2007-10-10 19:35 ` Johannes Schindelin
2007-10-10 21:25   ` Joakim Tjernlund
2007-10-10 21:56     ` Johannes Schindelin
2007-10-10 22:41       ` Joakim Tjernlund
2007-10-10 23:01         ` Johannes Schindelin
2007-10-10 19:38 ` Linus Torvalds
2007-10-10 21:36   ` Joakim Tjernlund
2007-10-11  9:18     ` Andreas Ericsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).