git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Specifying multiple refspecs in remote.{remote}.fetch
@ 2009-06-20  6:37 Jon Seymour
  2009-06-20  7:42 ` Jakub Narebski
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Seymour @ 2009-06-20  6:37 UTC (permalink / raw)
  To: Git Mailing List

It doesn't seem to be possible to specify multiple refspecs in a git config.

I want to do this:

remote.hub/pub/release.fetch=+refs/heads/*:refs/remotes/hub/pub/release/*
+refs/tags/*:refs/tags/hub/pub/release/*
remote.hub/pub/release.tagopt=--no-tags

but git fetch complains:

fatal: Invalid refspec '+refs/heads/*:refs/remotes/hub/pub/release/*
+refs/tags/*:refs/tags/hub/pub/release/*'

Now, in theory, I could use a file in remotes/ to specify multiple
Pull: lines. This works if my remote doesn't have slashes in its name,
but it doesn't work if my remote does have slashes in its name since
git doesn't recognize remote files located in sub-directories of
${GIT_DIR}/remotes.

Is it a reasonable expectation that:

* git should support multiple refspecs specified via git config?
* git should support subdirectories in ${GIT_DIR}/remotes?

BTW: the reason I want to do this is that I need to namespace the tags
and heads because I am using a "hub" repo to simplify a transport
topology for distributing a number of different spoke repos via a
smaller number of hub repos. Since I can't guarantee the branches and
tags of each spoke repo will be globally unique, I need to namespace
both the heads and the tags and a path-like naming convention for each
spoke repo seems like the most natural way to do that.

jon seymour.

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

* Re: Specifying multiple refspecs in remote.{remote}.fetch
  2009-06-20  6:37 Specifying multiple refspecs in remote.{remote}.fetch Jon Seymour
@ 2009-06-20  7:42 ` Jakub Narebski
  2009-06-20 13:00   ` Jon Seymour
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Narebski @ 2009-06-20  7:42 UTC (permalink / raw)
  To: Jon Seymour; +Cc: Git Mailing List

Jon Seymour <jon.seymour@gmail.com> writes:

> It doesn't seem to be possible to specify multiple refspecs in a git config.
> 
> I want to do this:
> 
> remote.hub/pub/release.fetch=+refs/heads/*:refs/remotes/hub/pub/release/*
> +refs/tags/*:refs/tags/hub/pub/release/*
> remote.hub/pub/release.tagopt=--no-tags
> 
> but git fetch complains:
> 
> fatal: Invalid refspec '+refs/heads/*:refs/remotes/hub/pub/release/*
> +refs/tags/*:refs/tags/hub/pub/release/*'
> 
> Now, in theory, I could use a file in remotes/ to specify multiple
> Pull: lines. This works if my remote doesn't have slashes in its name,
> but it doesn't work if my remote does have slashes in its name since
> git doesn't recognize remote files located in sub-directories of
> ${GIT_DIR}/remotes.

And you can put multiple values for the same remote.hub/pub/release.fetch
key, using "git config --add".  

  $ git config --add remote.hub/pub/release.fetch \
        +refs/heads/*:refs/remotes/hub/pub/release/*
  $ git config --add remote.hub/pub/release.fetch \
        +refs/tags/*:refs/tags/hub/pub/release/*
  $ ...

You would get the following config:

  [remote "hub/pub/release"]
        url = ...
        fetch = +refs/heads/*:refs/remotes/hub/pub/release/*
        fetch = +refs/tags/*:refs/tags/hub/pub/release/*
        tagopts = --no-tags

You don't put many refspecs in a *single* value.
 
> Is it a reasonable expectation that:
> 
> * git should support multiple refspecs specified via git config?

It does.

> * git should support subdirectories in ${GIT_DIR}/remotes?

It does.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

* Re: Specifying multiple refspecs in remote.{remote}.fetch
  2009-06-20  7:42 ` Jakub Narebski
@ 2009-06-20 13:00   ` Jon Seymour
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Seymour @ 2009-06-20 13:00 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Git Mailing List

Jakub,

Ah, thanks for that.

I don't know why my attempt to use subdirs of remotes failed but if  
you say it works I'll try it again.

Anyway, thank you!

jon.

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

end of thread, other threads:[~2009-06-20 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-20  6:37 Specifying multiple refspecs in remote.{remote}.fetch Jon Seymour
2009-06-20  7:42 ` Jakub Narebski
2009-06-20 13:00   ` Jon Seymour

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).