summaryrefslogtreecommitdiff
path: root/Documentation/git-cat-file.txt
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-08-24 12:23:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-11 21:47:46 (GMT)
commitb9e62f60115c75c5be5de593862925c8b8d7e683 (patch)
treee40451c0ce8274ff14063aa6c91173aeb4c9d661 /Documentation/git-cat-file.txt
parent16dcc2992b80d30f99c41fd7cc858e9d1c9dbca3 (diff)
downloadgit-b9e62f60115c75c5be5de593862925c8b8d7e683.zip
git-b9e62f60115c75c5be5de593862925c8b8d7e683.tar.gz
git-b9e62f60115c75c5be5de593862925c8b8d7e683.tar.bz2
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-cat-file.txt')
-rw-r--r--Documentation/git-cat-file.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 071029b..537d02c 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 | <type> | --textconv ) <object>
+'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) <object>
'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
<path>.
+--filters::
+ Show the content as converted by the filters configured in
+ the current working tree for the given <path> (i.e. smudge filters,
+ end-of-line conversion, etc). In this case, <object> has to be of
+ the form <tree-ish>:<path>, or :<path>.
+
--batch::
--batch=<format>::
Print object information and contents for each object provided