Adding glob support to remotes
- From
- Andy Parkins <andyparkins@gmail.com>
- Date
- Nov 22, 2006, 09:04 UTC
- Message-ID
- <200611220904.21850.andyparkins@gmail.com>
Hello,
I'm working on adding (basic) glob support to remote fetch definitions. This is to allow you to write things like
[remote "origin"] fetch = refs/heads/*:refs/remotes/upstream/*
I started to add code to git-parse-remote.sh:canon_refs_list_for_fetch() to preprocess the reflist to catch lines with a "*" in them then use the remote pattern to filter the output of from "git-ls-remote -h", blah, blah, you get the idea...
However, git-ls-remote needs the name of the remote repository (of course), but that isn't directly available in git-parse-remote.sh. Should I a) pass it as a parameter from git-fetch.sh right through each intermediate function b) create a global? c) change git-check-ref-format to allow "*" in the name, then put the git-ls-remote call in git-fetch instead.
I don't like to do (b) as it's nasty programming behaviour; however passing a parameter is fairly intrusive to the existing code. Similarly (c) means I'm messing in places I suspect I shouldn't be (git-check-ref-format).
git-gods - what do I do?
Andy
-- Dr Andy Parkins, M Eng (hons), MIEE