[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    [PATCH] Document the textconv filter.
From:       Matthieu Moy <Matthieu.Moy () imag ! fr>
Date:       2008-09-28 2:06:57
Message-ID: 1222567618-22156-5-git-send-email-Matthieu.Moy () imag ! fr
[Download RAW message or body]

---
 Documentation/gitattributes.txt |   43 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index e848c94..c4f2b8f 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -325,6 +325,49 @@ patterns are available:
 
 - `tex` suitable for source code for LaTeX documents.
 
+Converting files to text before a diff
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The attribute `textconv` affects 'git diff' in a way similar to the
+`diff` attribute, but with `textconv`, the user provides only a way to
+convert the file into text, and git takes care of doing the diff as
+usual (i.e. other options of 'git diff' such as '--color' remain
+available).
+
+The value of `textconv` must be a string, which is the textconv
+driver.
+
+To tell git to use the `exif` filter for jpeg images, use:
+
+----------------------------------------------------------------
+*.jpg   textconv=exif
+----------------------------------------------------------------
+
+Defining a custom textconv driver
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The definition of the `textconv` driver is done in `gitconfig`. To
+define a driver `exif`, add this to your `$GIT_DIR/config` file (or
+`$HOME/.gitconfig` file):
+
+----------------------------------------------------------------
+[textconv "exif"]
+	command = exiftags
+----------------------------------------------------------------
+
+Git will call the command specified in `command` with the file to
+convert as only argument. The program should write the text on its
+standard output.
+
+Examples of useful filters include:
+
+----------------------------------------------------------------
+[textconv "odt2txt"]
+	command = odt2txt
+[textconv "word"]
+	command = catdoc
+----------------------------------------------------------------
+
 
 Performing a three-way merge
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
1.6.0.2.312.g1ef81a

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic