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 prevent"git 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-06 Thread Junio C Hamano
On Mon, Oct 6, 2014 at 11:59 AM, Tanay Abhra 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 would > do much g

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 writes: > >> Junio C Hamano 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 one major use case. >>>

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

2014-10-03 Thread Junio C Hamano
Matthieu Moy writes: > Junio C Hamano 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; "g

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

2014-10-03 Thread Matthieu Moy
Junio C Hamano 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 def

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

2014-10-03 Thread Junio C Hamano
Junio C Hamano 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 different > t

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

2014-10-03 Thread Junio C Hamano
Matthieu Moy writes: > Junio C Hamano 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. understanding of the limitation of the current co

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

2014-10-03 Thread Matthieu Moy
Junio C Hamano writes: > Tanay Abhra 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

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

2014-10-02 Thread Junio C Hamano
Tanay Abhra 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 could also change

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 writes: > >> On 10/3/2014 1:39 AM, Junio C Hamano wrote: >>> Tanay Abhra writes: >>> +test_expect_success 'document how unset.variable will behave in shell scripts' ' + rm -f .git/config && + cat >expect <<-\EOF &

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

2014-10-02 Thread Junio C Hamano
Tanay Abhra writes: > On 10/3/2014 1:39 AM, Junio C Hamano wrote: >> Tanay Abhra 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:39 AM, Junio C Hamano wrote: > Tanay Abhra 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

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

2014-10-02 Thread Junio C Hamano
Tanay Abhra 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

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

2014-10-02 Thread Tanay Abhra
Helped-by: Matthieu Moy Signed-off-by: Tanay Abhra --- 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 100755 --- a/t/t1300-repo-config.sh +++ b/t