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 j...@keeping.me.uk 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-19 Thread Junio C Hamano
John Keeping j...@keeping.me.uk writes: On Thu, Apr 18, 2013 at 03:40:41PM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: +relative_path () +{ + local target curdir result + target=$1 + curdir=${2-$wt_prefix} + curdir=${curdir%/} + result= + +

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 j...@keeping.me.uk writes: On Thu, Apr 18, 2013 at 03:40:41PM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: +relative_path () +{ + local target curdir result + target=$1 + curdir=${2-$wt_prefix} +

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

2013-04-19 Thread Junio C Hamano
Johannes Sixt j...@kdbg.org 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

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

2013-04-18 Thread Junio C Hamano
John Keeping j...@keeping.me.uk 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/*) +

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 j...@keeping.me.uk 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 j...@keeping.me.uk ---