Re: Git-Mediawiki : cloning a set of pages
From: Jeff King <hidden>
Date: 2016-06-15 22:51:27
On Wed, Jun 08, 2011 at 11:19:40AM -0400, Jeff King wrote:
Maybe it would be even simpler and more flexible to give clone a "-c"
flag that writes specific config variables in the newly-created
repository. Like:
git clone -c mediawiki.page=page1 \
-c mediawiki.page=page2 \
http://...
Then the remote helper can just consult the git config. As a bonus, it
also lets you do things like:
git clone -c core.ignorecase=true git://...
which is currently awkward (you either have to have set such variable in
your ~/.gitconfig, or you must use init+config+fetch to do a clone
manually.This turned out to be a very tiny amount of code, but I found a ton of other bugs while working on it. :) So the patch series is long, but the important bits are at the end. I factored the code from the existing "git -c", so most of the bugfixes are there. [01/10]: strbuf_split: add a max parameter [02/10]: fix "git -c" parsing of values with equals signs These two are the first bugfix. [03/10]: config: die on error in command-line config Another bugfix. [04/10]: config: avoid segfault when parsing command-line config Another bugfix. [05/10]: strbuf: allow strbuf_split to work on non-strbufs [06/10]: config: use strbuf_split_str instead of a temporary strbuf Plugging a memory leak. [07/10]: parse-options: add OPT_STRING_LIST helper [08/10]: remote: use new OPT_STRING_LIST [09/10]: config: make git_config_parse_parameter a public function These are refactoring for 10/10. [10/10]: clone: accept config options on the command line And this is the actual patch. -Peff