Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-06 Thread Tanay Abhra
On 10/4/2014 1:42 AM, Junio C Hamano wrote: Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: Well, the normal use-case for unset.variable is to put it in a local config file, to unset a variable set in another, lower-priority file. I agree that is

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-06 Thread Junio C Hamano
On Mon, Oct 6, 2014 at 11:59 AM, Tanay Abhra tanay...@gmail.com wrote: 3 Special case unset.variable, so that git config unset.variable foo.baz pastes it on the top of the file. The implementation should be trivial, but, Junio had said in an earlier mail that he doesn't think this approach

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-06 Thread Tanay Abhra
On 10/7/2014 12:58 AM, Junio C Hamano wrote: The point is to preventgit config --add foo.baz anothervalue starting from --- --- --- [foo] bar = some [unset] variable = foo.baz --- --- --- from adding foo.baz next to existing foo.bar. We would want to end up with --- --- ---

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-03 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: Tanay Abhra tanay...@gmail.com writes: I can think of two solutions, one leave it as it is and advertise it to be explicitly typed in the config files at the appropriate position or to change the behavior of unset.variable to unset all matching

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-03 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: ... Off the top of my head, from an end-user's point of view, something like this would give a behaviour that is at least understandable: Let's make sure we have the same starting point (i.e.

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-03 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: That is why I said unset.variable is unworkable with existing git config command line. Always appending at the end is usable for ordinary variables, but for unset.variable, it is most likely the least useful thing to do. You can explain among 47

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-03 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: The git config [--add] section.var value UI, [...] finds the var = value definition at the end (or adds a section at the end and then adds [...] It is fine for single-valued ones that follow the last one wins semantics; git config would add the new

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-03 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: The git config [--add] section.var value UI, [...] finds the var = value definition at the end (or adds a section at the end and then adds [...] It is fine for single-valued ones that follow the last

[PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Tanay Abhra
Helped-by: Matthieu Moy matthieu@imag.fr Signed-off-by: Tanay Abhra tanay...@gmail.com --- t/t1300-repo-config.sh | 54 ++ 1 file changed, 54 insertions(+) diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index ce5ea01..f75c001

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'document how unset.variable will behave in shell scripts' ' + rm -f .git/config + cat expect -\EOF + EOF + git config foo.bar boz1 + git config --add foo.bar boz2 + git config unset.variable foo.bar

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Tanay Abhra
On 10/3/2014 1:39 AM, Junio C Hamano wrote: Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'document how unset.variable will behave in shell scripts' ' +rm -f .git/config +cat expect -\EOF +EOF +git config foo.bar boz1 +git config --add foo.bar boz2

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: On 10/3/2014 1:39 AM, Junio C Hamano wrote: Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'document how unset.variable will behave in shell scripts' ' + rm -f .git/config + cat expect -\EOF + EOF + git config foo.bar boz1

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Tanay Abhra
On 10/3/2014 1:53 AM, Junio C Hamano wrote: Tanay Abhra tanay...@gmail.com writes: On 10/3/2014 1:39 AM, Junio C Hamano wrote: Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'document how unset.variable will behave in shell scripts' ' + rm -f .git/config + cat expect

Re: [PATCH/RFC 5/5] add tests for checking the behaviour of unset.variable

2014-10-02 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: I can think of two solutions, one leave it as it is and advertise it to be explicitly typed in the config files at the appropriate position or to change the behavior of unset.variable to unset all matching variables in that file, before and after. We