Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-19 Thread Junio C Hamano
Johannes Sixt writes: > Why not just replace the six-liner by this one-liner: > > target=${target#"$curdir"/} Simple enough ;-) -- 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://vge

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-19 Thread Johannes Sixt
Am 19.04.2013 18:45, schrieb Junio C Hamano: > John Keeping writes: > >> On Thu, Apr 18, 2013 at 03:40:41PM -0700, Junio C Hamano wrote: >>> John Keeping writes: >>> +relative_path () +{ + local target curdir result + target=$1 + curdir=${2-$wt_prefix} + curdir=

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-19 Thread Junio C Hamano
John Keeping writes: > On Thu, Apr 18, 2013 at 03:40:41PM -0700, Junio C Hamano wrote: >> John Keeping writes: >> >> > +relative_path () >> > +{ >> > + local target curdir result >> > + target=$1 >> > + curdir=${2-$wt_prefix} >> > + curdir=${curdir%/} >> > + result= >> > + >> > + while te

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-19 Thread John Keeping
On Thu, Apr 18, 2013 at 03:40:41PM -0700, Junio C Hamano wrote: > John Keeping writes: > > > +relative_path () > > +{ > > + local target curdir result > > + target=$1 > > + curdir=${2-$wt_prefix} > > + curdir=${curdir%/} > > + result= > > + > > + while test -n "$curdir" > > + do > >

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-18 Thread Eric Sunshine
On Thu, Apr 18, 2013 at 3:50 PM, John Keeping wrote: > Use the new rev-parse --prefix option to process all paths given to the > submodule command, dropping the requirement that it be run from the > top-level of the repository. > > Signed-off-by: John Keeping > --- > diff --git a/t/t7400-submodul

Re: [PATCH v3 2/2] submodule: drop the top-level requirement

2013-04-18 Thread Junio C Hamano
John Keeping writes: > +relative_path () > +{ > + local target curdir result > + target=$1 > + curdir=${2-$wt_prefix} > + curdir=${curdir%/} > + result= > + > + while test -n "$curdir" > + do > + case "$target" in > + "$curdir/"*) > +