Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 01:56:08PM -0700, Junio C Hamano wrote: > So here is the final version with a log message. > > -- >8 -- > Subject: [PATCH] t5500 & t7403: lose bash-ism "local" > [...] Looks good. Thanks. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Stefan Beller
On Wed, Jun 1, 2016 at 1:48 PM, Junio C Hamano wrote: > John Keeping writes: > >> Absolutely, my original point should have been prefixed with: I wonder >> if the reason we haven't had any problems reported is because ... >> >> And we've got lucky because

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Eric Sunshine
On Wed, Jun 1, 2016 at 4:56 PM, Junio C Hamano wrote: > Subject: [PATCH] t5500 & t7403: lose bash-ism "local" > > In t5500::check_prot_host_port_path(), diagport is not a variable > used elsewhere and the function is not recursively called so this > can simply lose the "local",

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > John Keeping writes: > >> Absolutely, my original point should have been prefixed with: I wonder >> if the reason we haven't had any problems reported is because ... >> >> And we've got lucky because the clobbering of global

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
John Keeping writes: > Absolutely, my original point should have been prefixed with: I wonder > if the reason we haven't had any problems reported is because ... > > And we've got lucky because the clobbering of global variables happens > not to matter in these particular

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 09:28:53PM +0100, John Keeping wrote: > > So either way, I do not think "local variable names" that breaks > > &&-chain can be justified. Either the variable must be localized > > for the script to work correctly, in which case we want local with > > &&-chaining, or it

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 12:45:11PM -0700, Junio C Hamano wrote: > John Keeping writes: > > > On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: > >> On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > >> > >> > > > reset_submodule_urls () { > >> > > > -

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
John Keeping writes: > On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: >> On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: >> >> > > > reset_submodule_urls () { >> > > > - local root >> > > > - root=$(pwd) && >> > > >( >> > > > +

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 03:07:59PM -0400, Jeff King wrote: > On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > > > > > reset_submodule_urls () { > > > > - local root > > > > - root=$(pwd) && > > > > ( > > > > + root=$(pwd) && > > > >

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > > > reset_submodule_urls () { > > > - local root > > > - root=$(pwd) && > > > ( > > > + root=$(pwd) && > > > cd super-clone/submodule && > > > git config remote.origin.url "$root/submodule" > > > ) &&

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread John Keeping
On Wed, Jun 01, 2016 at 12:37:47PM -0400, Jeff King wrote: > On Wed, Jun 01, 2016 at 09:19:06AM -0700, Junio C Hamano wrote: > > diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh > > index 79bc135..5503ec0 100755 > > --- a/t/t7403-submodule-sync.sh > > +++

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Jeff King
On Wed, Jun 01, 2016 at 09:19:06AM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > These are two other offenders. > > > > $ git grep '^[ ]local[]' \*.sh > > t/t5500-fetch-pack.sh: local diagport > > t/t7403-submodule-sync.sh: local root > > > >

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > These are two other offenders. > > $ git grep '^[ ]local[]' \*.sh > t/t5500-fetch-pack.sh:local diagport > t/t7403-submodule-sync.sh:local root > > The grep gives many other hits, but those in completion are OK; it > is

Re: [BUG] git-submodule has bash-ism?

2016-06-01 Thread Junio C Hamano
Junio C Hamano writes: > relative_path () > { > local target curdir result > target=$1 > curdir=${2-$wt_prefix} > > I am hoping that Stefan's "gradually rewrite things in C" will make > it unnecessary to worry about this one. "git submodule" would not > work

Re: [BUG] git-submodule has bash-ism?

2016-05-31 Thread Stefan Beller
On Tue, May 31, 2016 at 4:08 PM, Junio C Hamano wrote: > relative_path () > { > local target curdir result > target=$1 > curdir=${2-$wt_prefix} > > I am hoping that Stefan's "gradually rewrite things in C" will make > it unnecessary to worry about this

[BUG] git-submodule has bash-ism?

2016-05-31 Thread Junio C Hamano
relative_path () { local target curdir result target=$1 curdir=${2-$wt_prefix} I am hoping that Stefan's "gradually rewrite things in C" will make it unnecessary to worry about this one. "git submodule" would not work correctly on posixly correct shells in the meantime.