Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-06-14 Thread Duy Nguyen
On Thu, Apr 23, 2015 at 10:47 AM, Junio C Hamano gits...@pobox.com wrote: On Wed, Apr 22, 2015 at 3:32 PM, Jens Lehmann jens.lehm...@web.de wrote: ... But it is unclear if we should still do (2) when subrepo/.git is no longer there. That has to be done manually and it may be an indication

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-06-14 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: I think we should stop the ok-to-replace feature when submodules are involved, we consider submdules much more valuable than symlinks. Hmm, I am not sure valuable is a good criterion to decide what should happen, though. The push to use .git that is a file

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-22 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Am 21.04.2015 um 23:08 schrieb Junio C Hamano: I looked at the test script update. The new test does (I am rephrasing to make it clearer): mkdir -p dir/ectory git init dir/ectory ;# a new directory inside top-level project (

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-22 Thread Jens Lehmann
Am 21.04.2015 um 23:08 schrieb Junio C Hamano: Duy Nguyen pclo...@gmail.com writes: On Mon, Apr 20, 2015 at 12:37 PM, Junio C Hamano gits...@pobox.com wrote: Duy Nguyen pclo...@gmail.com writes: But if you look at it another way, cd subrepo; git add . should be the same as git add subrepo

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-22 Thread Junio C Hamano
On Wed, Apr 22, 2015 at 3:32 PM, Jens Lehmann jens.lehm...@web.de wrote: ... But it is unclear if we should still do (2) when subrepo/.git is no longer there. That has to be done manually and it may be an indication that is clear enough that the end user wants the directory to be a normal

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-22 Thread Jens Lehmann
Am 22.04.2015 um 21:58 schrieb Junio C Hamano: Jens Lehmann jens.lehm...@web.de writes: Am 21.04.2015 um 23:08 schrieb Junio C Hamano: I looked at the test script update. The new test does (I am rephrasing to make it clearer): mkdir -p dir/ectory git init dir/ectory ;# a new

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-21 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Mon, Apr 20, 2015 at 12:37 PM, Junio C Hamano gits...@pobox.com wrote: Duy Nguyen pclo...@gmail.com writes: But if you look at it another way, cd subrepo; git add . should be the same as git add subrepo ... Once you cd into subrepo, you are in a

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-19 Thread Jens Lehmann
Am 18.04.2015 um 03:19 schrieb Nguyễn Thái Ngọc Duy: A path(spec) from git perspective consists of two parts, the prefix, and the rest. The prefix covers the part of `pwd` after expanding .. components. The split is to support case-insensitive match in a sane way (see 93d9353, especially the big

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-19 Thread Duy Nguyen
On Sun, Apr 19, 2015 at 7:53 PM, Jens Lehmann jens.lehm...@web.de wrote: And me thinks it should error out. We already do that when trying to add a specific file from above the gitlink: $ git add subrepo/a fatal: Pathspec 'subrepo/a' is in submodule 'subrepo' And from below the

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-19 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: But if you look at it another way, cd subrepo; git add . should be the same as git add subrepo ... Once you cd into subrepo, you are in a different world, a world different from the toplevel project. git add . over there should mean add everything in

Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-19 Thread Duy Nguyen
On Mon, Apr 20, 2015 at 12:37 PM, Junio C Hamano gits...@pobox.com wrote: Duy Nguyen pclo...@gmail.com writes: But if you look at it another way, cd subrepo; git add . should be the same as git add subrepo ... Once you cd into subrepo, you are in a different world, a world different from

[PATCH] pathspec: adjust prefixlen after striping trailing slash

2015-04-17 Thread Nguyễn Thái Ngọc Duy
A path(spec) from git perspective consists of two parts, the prefix, and the rest. The prefix covers the part of `pwd` after expanding .. components. The split is to support case-insensitive match in a sane way (see 93d9353, especially the big comment block added in dir.c). Normally the prefix is