]> git.ipfire.org Git - thirdparty/git.git/commit - Documentation/git-rev-parse.txt
rev-parse: add --prefix option
authorJohn Keeping <john@keeping.me.uk>
Sun, 16 Jun 2013 14:18:17 +0000 (15:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jun 2013 20:30:01 +0000 (13:30 -0700)
commit12b9d32790b40bf3ea49134095619700191abf1f
tree0b79987d1da6269a8c5e55d1090f7429133b84fa
parent1ae2e19a32729e21778b74f61794369203b58a1d
rev-parse: add --prefix option

This makes 'git rev-parse' behave as if it were invoked from the
specified subdirectory of a repository, with the difference that any
file paths which it prints are prefixed with the full path from the top
of the working tree.

This is useful for shell scripts where we may want to cd to the top of
the working tree but need to handle relative paths given by the user on
the command line.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-parse.txt
builtin/rev-parse.c
t/t1513-rev-parse-prefix.sh [new file with mode: 0755]