From b9e62f60115c75c5be5de593862925c8b8d7e683 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Aug 2016 14:23:39 +0200 Subject: cat-file: introduce the --filters option The --filters option applies the convert_to_working_tree() filter for the path when showing the contents of a regular file blob object; the contents are written out as-is for other types of objects. This feature comes in handy when a 3rd-party tool wants to work with the contents of files from past revisions as if they had been checked out, but without detouring via temporary files. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/git-cat-file.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 071029b4ef..537d02c87c 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -9,15 +9,15 @@ 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 ) +'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | | --textconv | --filters ) 'git cat-file' (--batch | --batch-check) [--follow-symlinks] DESCRIPTION ----------- In its first form, the command provides the content or the type of an object in the repository. The type is required unless `-t` or `-p` is used to find the -object type, or `-s` is used to find the object size, or `--textconv` is used -(which implies type "blob"). +object type, or `-s` is used to find the object size, or `--textconv` or +`--filters` is used (which imply type "blob"). In the second form, a list of objects (separated by linefeeds) is provided on stdin, and the SHA-1, type, and size of each object is printed on stdout. @@ -58,6 +58,12 @@ OPTIONS order to apply the filter to the content recorded in the index at . +--filters:: + Show the content as converted by the filters configured in + the current working tree for the given (i.e. smudge filters, + end-of-line conversion, etc). In this case, has to be of + the form :, or :. + --batch:: --batch=:: Print object information and contents for each object provided -- cgit v1.2.1