Re: [PATCH 0/3] "git config --get-urlmatch $section.$key $url"

2013-07-31 Thread Junio C Hamano
Ramsay Jones  writes:

> Junio C Hamano wrote:
>> So here is a bit of refactoring to extract the logic to find the
>> entry $section..$key from the configuration that best
>> matches the given $url to answer "what value $section.$key should be
>> for $url?" out of http.c (primarily because we never want to link
>> "git cofnig" with the cURL library), and use it from "git config" to
>> implement Peff's idea to extend "git config".
>> 
>> The first step is a pure code movement, plus some renaming of the
>> functions.
>> 
>> The second step is to factor out the code to handle --bool, --int, etc.
>> as a helper so that the new codepath can use it.
>> 
>> The last step currently duplicates the logic in http_options(), but
>> we might want to refactor it further so that the two functions can
>> share more code.  We hopefully can get rid of test-url-normalize and
>> instead use "git config --get-urlmatch" in the tests that protect
>> the http..config topic.
>
> I haven't been following this topic too closely and I don't have any
> feel for how long it will take to get to the end-game. However, unless
> the removal of test-url-normalize is coming soon, could I request that
> you apply my patch (or squash it into this series)? At present, I have
> to apply the patch before building the next and pu branches; OK it's not
> too onerous, but still ... :-P

Will squash in.  Thanks for a reminder.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] "git config --get-urlmatch $section.$key $url"

2013-07-31 Thread Ramsay Jones
Junio C Hamano wrote:
> So here is a bit of refactoring to extract the logic to find the
> entry $section..$key from the configuration that best
> matches the given $url to answer "what value $section.$key should be
> for $url?" out of http.c (primarily because we never want to link
> "git cofnig" with the cURL library), and use it from "git config" to
> implement Peff's idea to extend "git config".
> 
> The first step is a pure code movement, plus some renaming of the
> functions.
> 
> The second step is to factor out the code to handle --bool, --int, etc.
> as a helper so that the new codepath can use it.
> 
> The last step currently duplicates the logic in http_options(), but
> we might want to refactor it further so that the two functions can
> share more code.  We hopefully can get rid of test-url-normalize and
> instead use "git config --get-urlmatch" in the tests that protect
> the http..config topic.

I haven't been following this topic too closely and I don't have any
feel for how long it will take to get to the end-game. However, unless
the removal of test-url-normalize is coming soon, could I request that
you apply my patch (or squash it into this series)? At present, I have
to apply the patch before building the next and pu branches; OK it's not
too onerous, but still ... :-P


ATB,
Ramsay Jones


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] "git config --get-urlmatch $section.$key $url"

2013-07-29 Thread Junio C Hamano
So here is a bit of refactoring to extract the logic to find the
entry $section..$key from the configuration that best
matches the given $url to answer "what value $section.$key should be
for $url?" out of http.c (primarily because we never want to link
"git cofnig" with the cURL library), and use it from "git config" to
implement Peff's idea to extend "git config".

The first step is a pure code movement, plus some renaming of the
functions.

The second step is to factor out the code to handle --bool, --int, etc.
as a helper so that the new codepath can use it.

The last step currently duplicates the logic in http_options(), but
we might want to refactor it further so that the two functions can
share more code.  We hopefully can get rid of test-url-normalize and
instead use "git config --get-urlmatch" in the tests that protect
the http..config topic.

Junio C Hamano (3):
  url-match: split out URL matching logic out of http.c
  builtin/config: refactor collect_config()
  config: --get-urlmatch

 Makefile |   2 +
 builtin/config.c | 183 ---
 http.c   | 500 +--
 test-url-normalize.c |   2 -
 url-match.c  | 468 +++
 url-match.h  |  35 
 6 files changed, 671 insertions(+), 519 deletions(-)
 create mode 100644 url-match.c
 create mode 100644 url-match.h

-- 
1.8.4-rc0-137-g17832d4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html