From 55029ae4dac07942437c0c715ea7c8ac60dd3576 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Wed, 20 Feb 2008 13:43:53 -0500 Subject: Add support for url aliases in config files This allows users with different preferences for access methods to the same remote repositories to rewrite each other's URLs by pattern matching across a large set of similiarly set up repositories to each get the desired access. For example, if you don't have a kernel.org account, you might want settings like: [url "git://git.kernel.org/pub/"] insteadOf = master.kernel.org:/pub Then, if you give git a URL like: master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git it will act like you gave it: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git and you can cut-and-paste pull requests in email without fixing them by hand, for example. Signed-off-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- Documentation/config.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index f2f6a774e0..298138917a 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -886,6 +886,18 @@ tar.umask:: archiving user's umask will be used instead. See umask(2) and linkgit:git-archive[1]. +url..insteadOf:: + Any URL that starts with this value will be rewritten to + start, instead, with . In cases where some site serves a + large number of repositories, and serves them with multiple + access methods, and some users need to use different access + methods, this feature allows people to specify any of the + equivalent URLs and have git automatically rewrite the URL to + the best alternative for the particular user, even for a + never-before-seen repository on the site. The effect of + having multiple `insteadOf` values from different + `` match to an URL is undefined. + user.email:: Your email address to be recorded in any newly created commits. Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and -- cgit v1.2.3 From 844112cac07d6413b9bb42d38527d2f7ca7c7801 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 24 Feb 2008 22:25:04 -0800 Subject: url rewriting: take longest and first match Earlier we had a cop-out in the documentation to make the behaviour "undefined" if configuration had more than one insteadOf that would match the target URL, like this: [url "git://git.or.cz/"] insteadOf = "git.or.cz:" ; (1) insteadOf = "repo.or.cz:" ; (2) [url "/local/mirror/"] insteadOf = "git.or.cz:myrepo" ; (3) insteadOf = "repo.or.cz:" ; (4) It would be most natural to take the longest and first match, i.e. - rewrite "git.or.cz:frotz" to "git://git.or.cz/frotz" by using (1), - rewrite "git.or.cz:myrepo/xyzzy" to "/local/mirror/xyzzy" by favoring (3) over (1), and - rewrite "repo.or.cz:frotz" to "git://git.or.cz/frotz" by favoring (2) over (4). Signed-off-by: Junio C Hamano --- Documentation/config.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Documentation/config.txt') diff --git a/Documentation/config.txt b/Documentation/config.txt index 298138917a..57b9b99863 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -894,9 +894,8 @@ url..insteadOf:: methods, this feature allows people to specify any of the equivalent URLs and have git automatically rewrite the URL to the best alternative for the particular user, even for a - never-before-seen repository on the site. The effect of - having multiple `insteadOf` values from different - `` match to an URL is undefined. + never-before-seen repository on the site. When more than one + insteadOf strings match a given URL, the longest match is used. user.email:: Your email address to be recorded in any newly created commits. -- cgit v1.2.3