[PATCH v7 2/2] test-config: Add tests for the config_set API

2014-07-09 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile | 1 + t

[PATCH v7 1/2] add `config_set` API for caching config-like files

2014-07-09 Thread Tanay Abhra
the `config_set` API. Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 134 +++ Makefile | 1 + cache.h| 34 config-hash.c | 295

Re: [PATCH v6 2/2] test-config: Add tests for the config_set API

2014-07-09 Thread Tanay Abhra
On 7/7/2014 10:34 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh >> new file mode 100755 >> index 000..ad99f8b >> --- /dev/null >> +++ b/t/t1308-config-hash.sh >> +test_expect_su

Re: [PATCH v7 1/2] add `config_set` API for caching config-like files

2014-07-09 Thread Tanay Abhra
On 7/9/2014 5:42 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> diff --git a/Documentation/technical/api-config.txt >> b/Documentation/technical/api-config.txt >> index 230b3a0..65a6717 100644 >> --- a/Documentation/technical/api-config.txt >> +++ b/Do

Re: [PATCH v7 2/2] test-config: Add tests for the config_set API

2014-07-09 Thread Tanay Abhra
On 7/9/2014 5:43 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> +test_expect_success 'find value with misspelled key' ' >> +test_must_fail check "my.fOo Bar.hi" "Value not found for \"my.fOo >> Bar.hi\"" >&g

Re: [PATCH v7 1/2] add `config_set` API for caching config-like files

2014-07-09 Thread Tanay Abhra
On 7/9/2014 7:49 PM, Matthieu Moy wrote: > Tanay Abhra writes: > > > My opinion on this: > > * It's low priority. I think the order of priority should be (high to > low) > > 1) Finish and get the current series into pu (we're almost there, it'

[PATCH v8 0/3] git config cache & special querying api utilizing the cache

2014-07-10 Thread Tanay Abhra
e.org/gmane.comp.version-control.git/252942/ [9] http://thread.gmane.org/gmane.comp.version-control.git/252959/ [10] http://article.gmane.org/gmane.comp.version-control.git/253113 Tanay Abhra (2): config set test-config .gitignore | 1 + Documentation/tec

[PATCH v8 2/2] test-config: add tests for the config_set API

2014-07-10 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile | 1 + t

[PATCH v8 1/2] add `config_set` API for caching config-like files

2014-07-10 Thread Tanay Abhra
the `config_set` API. Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 134 +++ cache.h| 31 config.c | 296 + 3 files changed, 461 insertions(+) diff --git a

Re: [PATCH v8 1/2] add `config_set` API for caching config-like files

2014-07-11 Thread Tanay Abhra
g --get section.key >actual 2>error && grep " line 3 " error ' test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' ' test_must_fail git config --file non-existing-config -l ' They cover the same parsing cod

Re: [PATCH v8 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
se and in all of the cases if they cannot read a file they return -1 and continue running. So, I have updated the API to document the return value. I think if the file is unreadable. we must continue running as no harm has been done yet, worse is parsing a file with wrong syntax which can cause rea

Re: [PATCH v8 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
Junio C Hamano pobox.com> writes: > > Tanay Abhra gmail.com> writes: > > > diff --git a/test-config.c b/test-config.c > > new file mode 100644 > > index 000..dc313c2 > > --- /dev/null > > +++ b/test-config.c > > -0,0 +1,125

[PATCH v9 0/3] git config cache & special querying api utilizing the cache

2014-07-15 Thread Tanay Abhra
marc.info/?t=14042811521&r=1&w=2 [8] http://article.gmane.org/gmane.comp.version-control.git/252942/ [9] http://thread.gmane.org/gmane.comp.version-control.git/252959/ [10] http://article.gmane.org/gmane.comp.version-control.git/253113 [11] http://thread.gmane.org/gmane.comp.version-control.git

[PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

[PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
the `config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 135 cache.h| 31 config.c | 276 + 3 files changed, 442

Re: [PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
On 7/15/2014 9:16 PM, Junio C Hamano wrote: > Tanay Abhra writes: > >> diff --git a/config.c b/config.c >> index ba882a1..89e2d67 100644 >> --- a/config.c >> +++ b/config.c >> ... >> +const struct string_list *git_configset_get_value_multi(

Re: [PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
check_config get_value_multi case.baz sam bat hask Noted and corrected. > I suspect the same applies to most if not all uses of test-config > in the remainder of this patch. > I cant use it for configset_get_value_* as it may have variable number of files as arguments. :) Thanks, Tanay Abhra. -- 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 v9r1 1/2] add `config_set` API for caching config-like files

2014-07-16 Thread Tanay Abhra
`config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 137 + cache.h| 30 config.c | 264 + 3 files changed, 431

[PATCH v9r1 2/2] test-config: add tests for the config_set API

2014-07-16 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

[PATCH v9r2 1/2] add `config_set` API for caching config-like files

2014-07-16 Thread Tanay Abhra
`config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra Documentation/technical/api-config.txt | 137 + cache.h| 30 config.c | 264 + 3 files changed, 431

[PATCH v9r2 2/2] test-config: add tests for the config_set API

2014-07-16 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

Re: [PATCH v9r2 1/2] add `config_set` API for caching config-like files

2014-07-16 Thread Tanay Abhra
On 7/16/2014 9:36 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> implemented as a thin wrapper around the `config_set` API. >> >> Signed-off-by: Matthieu Moy >> Signed-off-by: Tanay Abhra >> Documentation/technical/api-config.txt

Re: [PATCH 2/3] fixup for patch 2: actually check the return value

2014-07-16 Thread Tanay Abhra
I think it would be unnecessary for the current iteration. Currently git_configset_add_file has only two possible return values -1 or 0. I could add specialized error values for ENOENT or ENOTDIR or EACCES, but the logs show that we silently ignore the first two. I can add an access warn for the th

Re: [PATCH v9r2 1/2] add `config_set` API for caching config-like files

2014-07-17 Thread Tanay Abhra
On 7/17/2014 3:31 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> I have a question about renaming git_config() to git_config_raw(). >> I was working on a patch and I am getting stuck here. >> It fails in t1001, t1020 & t4018. The reason for the last test failure

[PATCH v10 0/4] git config cache & special querying api utilizing the cache

2014-07-18 Thread Tanay Abhra
ion-control.git/252959/ [10] http://article.gmane.org/gmane.comp.version-control.git/253113 [11] http://thread.gmane.org/gmane.comp.version-control.git/253248 [12] http://thread.gmane.org/gmane.comp.version-control.git/253562 Tanay Abhra (4): string-list: add string_list initialiser helper

[PATCH v10 1/4] string-list: add string_list initializer helper function

2014-07-18 Thread Tanay Abhra
The string-list API has STRING_LIST_INIT_* macros to be used to define variables with initializers, but lacks functions to initialise an uninitialized piece of memory to be used as a string-list at the run-time. Introduce `string_list_init()` function for that. Signed-off-by: Tanay Abhra

[PATCH v10 4/4] test-config: add tests for the config_set API

2014-07-18 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

[PATCH v10 3/4] add `config_set` API for caching config-like files

2014-07-18 Thread Tanay Abhra
the `config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 137 + cache.h| 30 config.c | 263 + 3 files changed, 430

[PATCH v10 2/4] replace memset with string-list initializers

2014-07-18 Thread Tanay Abhra
Using memset and then manually setting values of the string-list members is not future proof as the internal representation of string-list may change any time. Use `string_list_init()` or STRING_LIST_INIT_* macros instead of memset. Signed-off-by: Tanay Abhra --- builtin/commit.c | 3

Re: [PATCH v10 3/4] add `config_set` API for caching config-like files

2014-07-18 Thread Tanay Abhra
On 7/18/2014 3:10 PM, Matthieu Moy wrote: > - Original Message - >> Documentation/technical/api-config.txt | 137 + >> cache.h| 30 >> config.c | 263 >> + >> 3 files chan

[PATCH v11 0/4] git config cache & special querying api utilizing the cache

2014-07-18 Thread Tanay Abhra
hread.gmane.org/gmane.comp.version-control.git/253799 Tanay Abhra (4): string-list: add string_list initialiser helper functions Use string-list initializaer functions to rewrite config set test-config .gitignore | 1 + Documentation/technical/api-config.tx

[PATCH v11 2/4] replace memset with string-list initializers

2014-07-18 Thread Tanay Abhra
Using memset and then manually setting values of the string-list members is not future proof as the internal representation of string-list may change any time. Use `string_list_init()` or STRING_LIST_INIT_* macros instead of memset. Signed-off-by: Tanay Abhra --- builtin/commit.c | 3

[PATCH v11 1/4] string-list: add string_list initializer helper function

2014-07-18 Thread Tanay Abhra
The string-list API has STRING_LIST_INIT_* macros to be used to define variables with initializers, but lacks functions to initialize an uninitialized piece of memory to be used as a string-list at the run-time. Introduce `string_list_init()` function for that. Signed-off-by: Tanay Abhra

[PATCH v11 3/4] add `config_set` API for caching config-like files

2014-07-18 Thread Tanay Abhra
the `config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 137 + cache.h| 30 config.c | 263 + setup.c

[PATCH v11 4/4] test-config: add tests for the config_set API

2014-07-18 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

[PATCH] add documentation for writing config files

2014-07-19 Thread Tanay Abhra
Replace TODO introduced in commit 9c3c22 with documentation explaining Git config API functions for writing configuration files. Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff

[PATCH v2] add documentation for writing config files

2014-07-20 Thread Tanay Abhra
Replace TODO introduced in commit 9c3c22 with documentation explaining Git config API functions for writing configuration files. Signed-off-by: Tanay Abhra --- Minor nit corrected. Thanks for the review. Documentation/technical/api-config.txt | 31 ++- 1 file

[PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_string()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra --- branch.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/branch.c b/branch.c index

[PATCH v3 6/6] notes-util.c: replace `git_config()` with `git_config_get_value()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_value()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. The function now raises an error instead of dying when a NULL value is found for key "notes.rewritemode". Signed-off-by: Tanay Abhra --- notes-ut

[PATCH v3 5/6] pager.c: replace `git_config()` with `git_config_get_value()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_value()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra --- pager.c | 40 +--- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/pager.c b

[PATCH v3 3/6] imap-send.c: replace `git_config()` with `git_config_get_*()` family

2014-07-21 Thread Tanay Abhra
Use `git_config_get_*()` family instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. The function now raises an error instead of dying in cases where a NULL value is not allowed. Signed-off-by: Tanay Abhra --- imap-send.c | 62

[PATCH v3 0/6] git_config callers rewritten with the new config cache API

2014-07-21 Thread Tanay Abhra
I will try to correct this anomaly in my next series. [1]: http://thread.gmane.org/gmane.comp.version-control.git/253862 [2]: http://thread.gmane.org/gmane.comp.version-control.git/252334 Tanay Abhra (6): alias.c | 27 +++ branch.c | 24

[PATCH v3 1/6] alias.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_string()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. The function now raises an error instead of dying when a NULL value is found. Signed-off-by: Tanay Abhra --- alias.c | 27 +++ 1 file

[PATCH v3 4/6] notes.c: replace `git_config()` with `git_config_get_value()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_value()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow, also previously 'string_list_add_refs_by_glob()' was called even when the retrieved value was NULL, correct it while we are at it. Signed-off-by: T

[PATCH/RFC] rewrite `git_default_config()` using config-set API functions

2014-07-21 Thread Tanay Abhra
Use `git_config_get_*()` family instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra --- Consider this as a proof of concept as the others callers have to be rewritten as well. I think that it is not so buggy as it

Re: [PATCH v3 0/6] git_config callers rewritten with the new config cache API

2014-07-21 Thread Tanay Abhra
On 7/21/2014 6:21 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> [PATCH v3]: Most of Eric's suggestions has been implemented. See [2] for >> discussion. >> Also, new helpers introduced in v7 of the config-set API series have >> been used. >>

Re: [PATCH v3 0/6] git_config callers rewritten with the new config cache API

2014-07-21 Thread Tanay Abhra
On 7/21/2014 7:15 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> On 7/21/2014 6:21 PM, Matthieu Moy wrote: >>> 2) Add a by-address parameter to git_configset_get_value that allows the >>>user to get the file and line information. In your previous patch, &g

Re: [PATCH/RFC] rewrite `git_default_config()` using config-set API functions

2014-07-21 Thread Tanay Abhra
> >> +if > + git_config_get_string("core.notesref", (const >> char**)¬es_ref_name); > > This cast is needed only because notes_ref_name is declared as > non-const, but a better fix would be to make the variable const, and > remove the cast. Same casts had to be used in imap-send.c patch,

Re: [PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Tanay Abhra
On 7/21/2014 11:29 PM, Junio C Hamano wrote: > Tanay Abhra writes: > >> Use `git_config_get_string()` instead of `git_config()` to take advantage of >> the config-set API which provides a cleaner control flow. >> >> Signed-off-by: Tanay A

[PATCH] config.c: change the function signature of `git_config_string()`

2014-07-22 Thread Tanay Abhra
`git_config_string()` output parameter `dest` is declared as a const which is unnecessary as the caller of the function is given a strduped string which can be modified without causing any harm. Thus, remove the const from the function signature. Signed-off-by: Tanay Abhra --- cache.h | 2

Re: [PATCH] config.c: change the function signature of `git_config_string()`

2014-07-22 Thread Tanay Abhra
On 7/22/2014 4:37 PM, Jeff King wrote: > On Tue, Jul 22, 2014 at 03:49:56AM -0700, Tanay Abhra wrote: > >> `git_config_string()` output parameter `dest` is declared as a const >> which is unnecessary as the caller of the function is given a strduped >> string which

Re: [PATCH] config.c: change the function signature of `git_config_string()`

2014-07-22 Thread Tanay Abhra
On 7/22/2014 5:14 PM, Matthieu Moy wrote: > Jeff King writes: > >> will complain that we are passing a pointer to "const char *", not a >> pointer to "char *". And indeed, compiling with your patch introduces a >> ton of compiler warnings. > > Tanay: are you not compiling with gcc -Wall -Werro

[PATCH 1/7] config.c: fix accuracy of line number in errors

2014-07-23 Thread Tanay Abhra
get accurate line number in error messages. Discovered-by: Tanay Abhra Signed-off-by: Matthieu Moy --- config.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 22971e9..6db8f97 100644 --- a/config.c +++ b/config.c @@ -244,6 +244,7

[PATCH 6/7] config: add `git_die_config()` to the config-set API

2014-07-23 Thread Tanay Abhra
(!git_config_get_value(key, &value)) { /* NULL values not allowed */ if (!value) git_config_die(key); else /* do work */ } Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt

[PATCH 3/7] add a test for semantic errors in config files

2014-07-23 Thread Tanay Abhra
: Tanay Abhra --- t/t1308-config-set.sh | 8 1 file changed, 8 insertions(+) diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh index 7fdf840..bd033df 100755 --- a/t/t1308-config-set.sh +++ b/t/t1308-config-set.sh @@ -197,4 +197,12 @@ test_expect_success 'proper error on err

[PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-23 Thread Tanay Abhra
git status now only rereads the configuration files twice instead of four times. [1]: http://thread.gmane.org/gmane.comp.version-control.git/253862 Tanay Abhra (7): Documentation/technical/api-config.txt | 5 ++ cache.h| 1 + config.c

[PATCH 7/7] Add tests for `git_config_get_string()`

2014-07-23 Thread Tanay Abhra
Add tests for `git_config_get_string()`, check whether it dies printing the line number and the file name if an NULL value is retrieved for the given key. Signed-off-by: Tanay Abhra --- t/t1308-config-set.sh | 9 + test-config.c | 10 ++ 2 files changed, 19 insertions

[PATCH 4/7] add line number and file name info to `config_set`

2014-07-23 Thread Tanay Abhra
Store file name and line number for each key-value pair in the cache. Use the information to print line number and file name in errors raised by `git_config()` which now uses the configuration files caching layer internally. Signed-off-by: Tanay Abhra --- config.c | 32

[PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Tanay Abhra
to avoid config file rereads on each invocation during a git process lifetime. First invocation constructs the cache, and after that for each successive invocation, `git_config()` feeds values from the config cache instead of rereading the configuration files. Signed-off-by: Tanay Abhra

[PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-23 Thread Tanay Abhra
`funcname` variable, enforce `xfuncname` precedence over `funcname` when the variables have the same subsection. Remove dependency that required values to be fed to userdiff_config() in parsing order for the test to succeed. Signed-off-by: Tanay Abhra --- Note: this the only test that failed for the

Re: [PATCH 1/7] config.c: fix accuracy of line number in errors

2014-07-24 Thread Tanay Abhra
On 7/24/2014 3:19 AM, Junio C Hamano wrote: > Tanay Abhra writes: > >> If a callback returns a negative value to `git_config*()` family, >> they call `die()` while printing the line number and the file name. >> Currently the printed line number is off by one, thus pr

Re: [PATCH 3/7] add a test for semantic errors in config files

2014-07-24 Thread Tanay Abhra
On 7/24/2014 3:41 AM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Tanay Abhra writes: >> >>> +test_expect_success 'check line errors for malformed values' ' >>> + cp .git/config .git/config.old && > > Should this be &

Re: [PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-24 Thread Tanay Abhra
> > Are you done with the original series, or do you still want to fix > the const-ness issue with the string pointer before working on > follow-up topics like this one? > I am attaching the v12 with two new functions git_configset_get_string() & git_configset_get_string_const(). Diff between v1

[PATCH v12 1/2] add `config_set` API for caching config-like files

2014-07-24 Thread Tanay Abhra
`config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 142 + cache.h| 32 config.c | 282 + setup.c

[PATCH v12 2/2] test-config: add tests for the config_set API

2014-07-24 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

Re: [PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-24 Thread Tanay Abhra
On 7/24/2014 9:09 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> I am attaching the v12 with two new functions git_configset_get_string() & >> git_configset_get_string_const(). > > Didn't you intend to change git_config_get_string to let it die in case &

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-24 Thread Tanay Abhra
gitgui using the config files to save data. Cheers, Tanay Abhra. We will be forbidden from correcting a UI > mistake by using the approach we took to transtion "funcname" over > to "xfuncname" (i.e. giving users "funcname" and allowing the > platform BRE p

Re: [PATCH 1/7] config.c: fix accuracy of line number in errors

2014-07-24 Thread Tanay Abhra
On 7/25/2014 12:01 AM, Junio C Hamano wrote: > Tanay Abhra writes: > >> On 7/24/2014 3:19 AM, Junio C Hamano wrote: >>> Tanay Abhra writes: >>> >>>> If a callback returns a negative value to `git_config*()` family, >>>> they call `d

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-24 Thread Tanay Abhra
On 7/25/2014 12:50 AM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Tanay Abhra writes: >> >>> For core the only test failing was xfuncname vs funcname, >> >> Being a little pessimistic: there may be other cases where the hashtable >> magic

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-24 Thread Tanay Abhra
On 7/25/2014 2:52 AM, Ramsay Jones wrote: > On 24/07/14 20:54, Junio C Hamano wrote: >> Tanay Abhra writes: >> >>> If we take the easy way out, fixing UI mistakes would be easier, >>> just replace git_config_cache() with git_config_raw() for such cases. >>

[PATCH v2 2/6] add line number and file name info to `config_set`

2014-07-25 Thread Tanay Abhra
Store file name and line number for each key-value pair in the cache during parsing of the configuration files. Signed-off-by: Tanay Abhra --- config.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 06257d9..110f9a5 100644 --- a

[PATCH v2 1/6] config.c: fix accuracy of line number in errors

2014-07-25 Thread Tanay Abhra
the call to callback to get accurate line number in error messages. Commit-message-by: Tanay Abhra Signed-off-by: Tanay Abhra --- config.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 0d799e0..06257d9 100644 --- a/config.c +++ b

[PATCH v2 0/6] Rewrite `git_config()` using config-set API

2014-07-25 Thread Tanay Abhra
/gmane.comp.version-control.git/253862 [2]: http://thread.gmane.org/gmane.comp.version-control.git/254101 Tanay Abhra (6): config.c: fix accuracy of line number in errors add line number and file name info to `config_set` rewrite git_config() to use the config-set API add a test for semantic err

[PATCH v2 4/6] add a test for semantic errors in config files

2014-07-25 Thread Tanay Abhra
: Tanay Abhra --- t/t1308-config-set.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh index 7fdf840..35c6ee2 100755 --- a/t/t1308-config-set.sh +++ b/t/t1308-config-set.sh @@ -197,4 +197,15 @@ test_expect_success 'proper error on

[PATCH v2 3/6] rewrite git_config() to use the config-set API

2014-07-25 Thread Tanay Abhra
to avoid config file rereads on each invocation during a git process lifetime. First invocation constructs the cache, and after that for each successive invocation, `git_config()` feeds values from the config cache instead of rereading the configuration files. Signed-off-by: Tanay Abhra

[PATCH v2 6/6] Add tests for `git_config_get_string()`

2014-07-25 Thread Tanay Abhra
Add tests for `git_config_get_string()`, check whether it dies printing the line number and the file name if a NULL value is retrieved for the given key. Signed-off-by: Tanay Abhra --- t/t1308-config-set.sh | 9 + test-config.c | 10 ++ 2 files changed, 19 insertions

[PATCH v2 5/6] config: add `git_die_config()` to the config-set API

2014-07-25 Thread Tanay Abhra
(!git_config_get_value(key, &value)) { /* NULL values not allowed */ if (!value) git_config_die(key); else /* do work */ } Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt

Re: [RFC PATCH 2/3] home_config_path: allow NULL xdg parameter

2014-07-25 Thread Tanay Abhra
On 7/25/2014 7:14 PM, Matthieu Moy wrote: > This allows a caller to requst the global config file without requesting nit s/requst/request/ -- 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.kern

Re: [PATCH v2 3/6] rewrite git_config() to use the config-set API

2014-07-25 Thread Tanay Abhra
On 7/25/2014 7:28 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> +struct config_set_element { >> +struct hashmap_entry ent; >> +char *key; >> +struct string_list value_list; >> +}; >> + >> +struct configset_list_item { &

Re: [PATCH v2 5/6] config: add `git_die_config()` to the config-set API

2014-07-25 Thread Tanay Abhra
On 7/25/2014 7:33 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> --- a/config.c >> +++ b/config.c >> @@ -1403,11 +1403,12 @@ const struct string_list >> *git_configset_get_value_multi(struct config_set *cs, c >> >> int git_configset_get_stri

[PATCH v13 0/2] git config cache & special querying api utilizing the cache

2014-07-28 Thread Tanay Abhra
n be seen at [1]. [1]:: http://thread.gmane.org/gmane.comp.version-control.git/253862/ Tanay Abhra (2): add `config_set` API for caching config-like files test-config: add tests for the config_set API .gitignore | 1 + Documentation/technical/api-config.txt |

[PATCH v13 2/2] test-config: add tests for the config_set API

2014-07-28 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- .gitignore| 1 + Makefile

[PATCH v13 1/2] add `config_set` API for caching config-like files

2014-07-28 Thread Tanay Abhra
`config_set` API. Signed-off-by: Matthieu Moy Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 142 + cache.h| 32 config.c | 274 + setup.c

[PATCH v3 3/6] rewrite git_config() to use the config-set API

2014-07-28 Thread Tanay Abhra
to avoid config file rereads on each invocation during a git process lifetime. First invocation constructs the cache, and after that for each successive invocation, `git_config()` feeds values from the config cache instead of rereading the configuration files. Signed-off-by: Tanay Abhra

[PATCH v3 0/6] Rewrite `git_config()` using config-set API

2014-07-28 Thread Tanay Abhra
r times. [1]: http://thread.gmane.org/gmane.comp.version-control.git/254286 [2]: http://thread.gmane.org/gmane.comp.version-control.git/254101 [3]: http://thread.gmane.org/gmane.comp.version-control.git/254211 Tanay Abhra (6): config.c: fix accuracy of line number in errors add line number and file name

[PATCH v3 1/6] config.c: fix accuracy of line number in errors

2014-07-28 Thread Tanay Abhra
the call to callback to get accurate line number in error messages. Commit-message-by: Tanay Abhra Signed-off-by: Tanay Abhra --- config.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index d3ad661..e5b7f10 100644 --- a/config.c +++ b

[PATCH v3 4/6] add a test for semantic errors in config files

2014-07-28 Thread Tanay Abhra
: Tanay Abhra --- t/t1308-config-set.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh index 7fdf840..35c6ee2 100755 --- a/t/t1308-config-set.sh +++ b/t/t1308-config-set.sh @@ -197,4 +197,15 @@ test_expect_success 'proper error on

[PATCH v3 2/6] add line number and file name info to `config_set`

2014-07-28 Thread Tanay Abhra
Store file name and line number for each key-value pair in the cache during parsing of the configuration files. Signed-off-by: Tanay Abhra --- config.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index e5b7f10..5499108 100644

[PATCH v3 6/6] add tests for `git_config_get_string_const()`

2014-07-28 Thread Tanay Abhra
Add tests for `git_config_get_string_const()`, check whether it dies printing the line number and the file name if a NULL value is retrieved for the given key. Signed-off-by: Tanay Abhra --- t/t1308-config-set.sh | 9 + test-config.c | 10 ++ 2 files changed, 19

[PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Tanay Abhra
(!git_config_get_value(key, &value)) { /* NULL values not allowed */ if (!value) git_config_die(key); else /* do work */ } Signed-off-by: Tanay Abhra --- Note: git_config_get_string() c

[PATCH v2] add documentation for writing config files

2014-07-28 Thread Tanay Abhra
Replace TODO introduced in commit 9c3c22 with documentation explaining Git config API functions for writing configuration files. Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff

Re: [PATCH v3 5/6] config: add `git_die_config()` to the config-set API

2014-07-28 Thread Tanay Abhra
On 7/28/2014 4:25 PM, Ramsay Jones wrote: > On 28/07/14 11:33, Tanay Abhra wrote: >> Add `git_die_config` that dies printing the line number and the file name >> of the highest priority value for the configuration variable `key`. >> >> It has usage in non-callback b

Re: [PATCH v3 4/6] add a test for semantic errors in config files

2014-07-28 Thread Tanay Abhra
On 7/28/2014 4:52 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> +test_expect_success 'check line errors for malformed values' ' >> +mv .git/config .git/config.old && >> +test_when_finished "mv .git/config.old .git/config&qu

[PATCH v4 0/6] Rewrite `git_config()` using config-set API

2014-07-29 Thread Tanay Abhra
version-control.git/254211 Tanay Abhra (6): config.c: fix accuracy of line number in errors add line number and file name info to `config_set` rewrite git_config() to use the config-set API add a test for semantic errors in config files config: add `git_die_config()` to the config-set

[PATCH v4 4/6] add a test for semantic errors in config files

2014-07-29 Thread Tanay Abhra
and the file name. Signed-off-by: Tanay Abhra --- t/t1308-config-set.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh index 7fdf840..e2f9d0b 100755 --- a/t/t1308-config-set.sh +++ b/t/t1308-config-set.sh @@ -197,4 +197,15

[PATCH v4 3/6] rewrite git_config() to use the config-set API

2014-07-29 Thread Tanay Abhra
addition to line number and file name to the error message that is printed when `git_config()` dies. Signed-off-by: Tanay Abhra --- cache.h | 24 config.c| 58 ++--- t/t4055-diff-context.sh | 2 +- 3 files

[PATCH v4 2/6] add line number and file name info to `config_set`

2014-07-29 Thread Tanay Abhra
Store file name and line number for each key-value pair in the cache during parsing of the configuration files. Signed-off-by: Tanay Abhra --- config.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index e5b7f10..5499108 100644

[PATCH v4 1/6] config.c: fix accuracy of line number in errors

2014-07-29 Thread Tanay Abhra
the call to callback to get accurate line number in error messages. Commit-message-by: Tanay Abhra Signed-off-by: Tanay Abhra --- config.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index d3ad661..e5b7f10 100644 --- a/config.c +++ b

[PATCH v4 5/6] config: add `git_die_config()` to the config-set API

2014-07-29 Thread Tanay Abhra
(!git_config_get_value(key, &value)) { /* NULL values not allowed */ if (!value) git_config_die(key); else /* do work */ } Signed-off-by: Tanay Abhra --- Documentation/technical/api-config.txt

[PATCH v4 6/6] add tests for `git_config_get_string_const()`

2014-07-29 Thread Tanay Abhra
Add tests for `git_config_get_string_const()`, check whether it dies printing the line number and the file name if a NULL value is retrieved for the given key. Signed-off-by: Tanay Abhra --- t/t1308-config-set.sh | 10 ++ test-config.c | 10 ++ 2 files changed, 20

<    1   2   3   4   >