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

2015-06-14 Thread Junio C Hamano
Duy Nguyen 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 pointing at

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 wrote: > On Wed, Apr 22, 2015 at 3:32 PM, Jens Lehmann 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

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 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 directory w

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 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-l

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

2015-04-22 Thread Junio C Hamano
Jens Lehmann 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 >> ( >> c

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 writes: On Mon, Apr 20, 2015 at 12:37 PM, Junio C Hamano wrote: Duy Nguyen 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 di

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

2015-04-21 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Apr 20, 2015 at 12:37 PM, Junio C Hamano wrote: >> Duy Nguyen 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 >> differe

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 wrote: > Duy Nguyen 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.

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

2015-04-19 Thread Junio C Hamano
Duy Nguyen 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 subproject's

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 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 gitlink: > >$ c

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 bi

[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 i