From 7bcf341453572a227036afec76bdab451b798870 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 9 Sep 2016 12:10:50 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- Documentation/git-cat-file.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/git-cat-file.txt') 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 | | --textconv | --filters ) +'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | | --textconv | --filters ) [--path=] 'git cat-file' (--batch | --batch-check) [--follow-symlinks] DESCRIPTION @@ -64,6 +64,11 @@ OPTIONS end-of-line conversion, etc). In this case, has to be of the form :, or :. +--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=:: Print object information and contents for each object provided -- cgit v1.2.3