{"thread":{"id":"19872","subject":"Specifying multiple refspecs in remote.{remote}.fetch","startedAt":"2009-06-20T06:37:51Z","lastAt":"2009-06-20T13:00:37Z","messageCount":3,"participants":["Jon Seymour","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116661","messageId":"2cfc40320906192337g66db81f0w92e06adfc6a189c9@mail.gmail.com","threadId":"19872","inReplyTo":null,"subject":"Specifying multiple refspecs in remote.{remote}.fetch","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2009-06-20T06:37:51Z","receivedAt":"2009-06-20T06:37:51Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"It doesn't seem to be possible to specify multiple refspecs in a git config.\n\nI want to do this:\n\nremote.hub/pub/release.fetch=+refs/heads/*:refs/remotes/hub/pub/release/*\n+refs/tags/*:refs/tags/hub/pub/release/*\nremote.hub/pub/release.tagopt=--no-tags\n\nbut git fetch complains:\n\nfatal: Invalid refspec '+refs/heads/*:refs/remotes/hub/pub/release/*\n+refs/tags/*:refs/tags/hub/pub/release/*'\n\nNow, in theory, I could use a file in remotes/ to specify multiple\nPull: lines. This works if my remote doesn't have slashes in its name,\nbut it doesn't work if my remote does have slashes in its name since\ngit doesn't recognize remote files located in sub-directories of\n${GIT_DIR}/remotes.\n\nIs it a reasonable expectation that:\n\n* git should support multiple refspecs specified via git config?\n* git should support subdirectories in ${GIT_DIR}/remotes?\n\nBTW: the reason I want to do this is that I need to namespace the tags\nand heads because I am using a \"hub\" repo to simplify a transport\ntopology for distributing a number of different spoke repos via a\nsmaller number of hub repos. Since I can't guarantee the branches and\ntags of each spoke repo will be globally unique, I need to namespace\nboth the heads and the tags and a path-like naming convention for each\nspoke repo seems like the most natural way to do that.\n\njon seymour.\n"},{"id":"116664","messageId":"m3eitfgxln.fsf@localhost.localdomain","threadId":"19872","inReplyTo":"2cfc40320906192337g66db81f0w92e06adfc6a189c9@mail.gmail.com","subject":"Re: Specifying multiple refspecs in remote.{remote}.fetch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-20T07:42:34Z","receivedAt":"2009-06-20T07:42:34Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jon Seymour <jon.seymour@gmail.com> writes:\n\n> It doesn't seem to be possible to specify multiple refspecs in a git config.\n> \n> I want to do this:\n> \n> remote.hub/pub/release.fetch=+refs/heads/*:refs/remotes/hub/pub/release/*\n> +refs/tags/*:refs/tags/hub/pub/release/*\n> remote.hub/pub/release.tagopt=--no-tags\n> \n> but git fetch complains:\n> \n> fatal: Invalid refspec '+refs/heads/*:refs/remotes/hub/pub/release/*\n> +refs/tags/*:refs/tags/hub/pub/release/*'\n> \n> Now, in theory, I could use a file in remotes/ to specify multiple\n> Pull: lines. This works if my remote doesn't have slashes in its name,\n> but it doesn't work if my remote does have slashes in its name since\n> git doesn't recognize remote files located in sub-directories of\n> ${GIT_DIR}/remotes.\n\nAnd you can put multiple values for the same remote.hub/pub/release.fetch\nkey, using \"git config --add\".  \n\n  $ git config --add remote.hub/pub/release.fetch \\\n        +refs/heads/*:refs/remotes/hub/pub/release/*\n  $ git config --add remote.hub/pub/release.fetch \\\n        +refs/tags/*:refs/tags/hub/pub/release/*\n  $ ...\n\nYou would get the following config:\n\n  [remote \"hub/pub/release\"]\n        url = ...\n        fetch = +refs/heads/*:refs/remotes/hub/pub/release/*\n        fetch = +refs/tags/*:refs/tags/hub/pub/release/*\n        tagopts = --no-tags\n\nYou don't put many refspecs in a *single* value.\n \n> Is it a reasonable expectation that:\n> \n> * git should support multiple refspecs specified via git config?\n\nIt does.\n\n> * git should support subdirectories in ${GIT_DIR}/remotes?\n\nIt does.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"116671","messageId":"37955246-7ECC-4A98-82C7-33DA894C864A@gmail.com","threadId":"19872","inReplyTo":"m3eitfgxln.fsf@localhost.localdomain","subject":"Re: Specifying multiple refspecs in remote.{remote}.fetch","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2009-06-20T13:00:37Z","receivedAt":"2009-06-20T13:00:37Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Jakub,\n\nAh, thanks for that.\n\nI don't know why my attempt to use subdirs of remotes failed but if  \nyou say it works I'll try it again.\n\nAnyway, thank you!\n\njon.\n"}]}