git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Specifying multiple refspecs in remote.{remote}.fetch
Date: Sat, 20 Jun 2009 00:42:34 -0700 (PDT)	[thread overview]
Message-ID: <m3eitfgxln.fsf@localhost.localdomain> (raw)
In-Reply-To: <2cfc40320906192337g66db81f0w92e06adfc6a189c9@mail.gmail.com>

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

  reply	other threads:[~2009-06-20  7:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20  6:37 Specifying multiple refspecs in remote.{remote}.fetch Jon Seymour
2009-06-20  7:42 ` Jakub Narebski [this message]
2009-06-20 13:00   ` Jon Seymour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3eitfgxln.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jon.seymour@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).