On Fri, Oct 28, 2011 at 12:41 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote: >> ... Should we stick with one way only? > > Whatever we have been doing should not change, especially in corner cases. I disagree. If it's not right, then we should change it even though it may face unpleasant consequences from misusing it. And I don't think it's sane to behave like what we're doing now: $ GIT_DIR=clone2/.git git ls-files --stage 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1 $ ls -l clone2/2 3 -rw-r--r-- 1 pclouds users 0 Th10 30 12:40 3 -rw-r--r-- 1 pclouds users 0 Th10 30 12:40 clone2/2 $ GIT_DIR=clone2/.git git add clone2/2 3 $ GIT_DIR=clone2/.git git ls-files --stage 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 3 $ GIT_DIR=clone2/.git git add clone2/2 $ GIT_DIR=clone2/.git git ls-files --stage 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 1 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 3 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 clone2/2 "git add" behaves inconsistently when "clone2/2" and "3" are given and when clone2/2 is given alone. This is just bad to me. Note that this has nothing to do with read_directory() discussion we had in the notes-merge patch, I agree we should keep the prefix. This is about the calculating common prefix automatically from pathspec. But prefix and pathspec are treated differently by read_directory(). In "git add clone2/2 3", common prefix is "" while in "git add clone2/2" common prefix is "clone2". -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html