diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-11-28 10:37:32 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-07 14:25:46 -0800 |
commit | 979f792951913d75f992f87022b75610303a614f (patch) | |
tree | 9fb806af8cc96b58b89c19e2720bf71bf42cab3c /Documentation | |
parent | Make prefix_path() return char* without const (diff) | |
download | tgif-979f792951913d75f992f87022b75610303a614f.tar.xz |
get_sha1: support relative path ":path" syntax
Currently :path and ref:path can be used to refer to a specific object
in index or ref respectively. "path" component is absolute path. This
patch allows "path" to be written as "./path" or "../path", which is
relative to user's original cwd.
This does not work in commands for which startup_info is NULL
(i.e. non-builtin ones, it seems none of them needs this anyway).
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/revisions.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index 3d4b79c480..8b519d7448 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -121,6 +121,10 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file. ':path' (with an empty part before the colon, e.g. `:README`) is a special case of the syntax described next: content recorded in the index at the given path. + A path starting with './' or '../' is relative to current working directory. + The given path will be converted to be relative to working tree's root directory. + This is most useful to address a blob or tree from a commit or tree that has + the same tree structure with the working tree. * A colon, optionally followed by a stage number (0 to 3) and a colon, followed by a path (e.g. `:0:README`); this names a blob object in the |