summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-23 21:39:30 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-12-23 22:01:32 (GMT)
commita69dd585fca9ab7fc4a07f7563f6cdb106e3ffed (patch)
tree67eb743f741d0b8457adfd0fceaae5b7822ffa1c /git-sh-setup.sh
parent797bd6f490c91c07986382b9f268e0df712cb246 (diff)
downloadgit-a69dd585fca9ab7fc4a07f7563f6cdb106e3ffed.zip
git-a69dd585fca9ab7fc4a07f7563f6cdb106e3ffed.tar.gz
git-a69dd585fca9ab7fc4a07f7563f6cdb106e3ffed.tar.bz2
ls-tree: chomp leading directories when run from a subdirectory
When run from a subdirectory, even though we filtered the output based on where we were using pathspec, we wrote out the repository relative paths, not subtree relative paths. This changes things so that it shows only the current subdirectory relative paths. For example, in Documentation subdirectory of git itself, this used to be the case: $ git-ls-tree --name-only HEAD | grep how Documentation/git-show-branch.txt Documentation/git-show-index.txt Documentation/howto-index.sh Documentation/howto But now it does this instead: $ git-ls-tree --name-only HEAD | grep how git-show-branch.txt git-show-index.txt howto-index.sh howto There are two things to keep in mind. 1. This shows nothing. $ git-ls-tree --name-only HEAD ../ppc/ This is to make things consistent with ls-files, which refuses relative path that goes uplevel. 2. These show things in full repository relative paths. In this case, paths outside the current subdirectory are also shown. $ git-ls-tree --name-only --full-name HEAD | grep how Documentation/git-show-branch.txt Documentation/git-show-index.txt Documentation/howto-index.sh Documentation/howto $ git-ls-tree --name-only --full-name HEAD ../ppc/ ppc/sha1.c ppc/sha1.h ppc/sha1ppc.S The flag --full-name gives the same behaviour as 1.0, so it ought to be the default if we really care about the backward compatibility, but in practice no Porcelain runs ls-tree from a subdirectory yet, and without --full-name is more human friendly, so hopefully the default being not --full-name would be acceptable. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-sh-setup.sh')
0 files changed, 0 insertions, 0 deletions