diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2016-09-09 12:10:50 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-11 14:48:15 -0700 |
commit | 7bcf341453572a227036afec76bdab451b798870 (patch) | |
tree | 44bf23805839bd2af79a0f33ede751b15821c217 /Documentation | |
parent | cat-file: introduce the --filters option (diff) | |
download | tgif-7bcf341453572a227036afec76bdab451b798870.tar.xz |
cat-file --textconv/--filters: allow specifying the path separately
There are circumstances when it is relatively easy to figure out the
object name for a given path, but not the name of the containing tree.
For example, when looking at a diff generated by Git, the object names
are recorded, but not the revision. As a matter of fact, the revisions
from which the diff was generated may not even exist locally.
In such a case, the user would have to generate a fake revision just to
be able to use --textconv or --filters.
Let's simplify this dramatically, because we do not really need that
revision at all: all we care about is that we know the path. In the
scenario described above, we do know the path, and we just want to
specify it separately from the object name.
Example usage:
git cat-file --textconv --path=main.c 0f1937fd
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-cat-file.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 537d02c87c..4fa9041490 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -9,7 +9,7 @@ git-cat-file - Provide content or type and size information for repository objec SYNOPSIS -------- [verse] -'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) <object> +'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) [--path=<path>] <object> 'git cat-file' (--batch | --batch-check) [--follow-symlinks] DESCRIPTION @@ -64,6 +64,11 @@ OPTIONS end-of-line conversion, etc). In this case, <object> has to be of the form <tree-ish>:<path>, or :<path>. +--path=<path>:: + For use with --textconv or --filters, to allow specifying an object + name and a path separately, e.g. when it is difficult to figure out + the revision from which the blob came. + --batch:: --batch=<format>:: Print object information and contents for each object provided |