@matheusbsbs / matheus-bagliano / commits / 2cc3167c68
Fork 0

Document "diff=driver" attribute

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Apr 23, 2007 at 00:21 UTC 2cc3167c688d1c91bc4cb9b1caa737b9d4971056
1 file changed +29 -3
Documentation/gitattributes.txt
+29 -3
@@ -151,8 +151,34 @@ Unspecified::
151 text, it is treated as text. Otherwise it would
152 generate `Binary files differ`.
153
154 -Any other value set to `diff` attribute is ignored and git acts
155 -as if the attribute is left unspecified.
154 +String::
155 +
156 + Diff is shown using the specified custom diff driver.
157 + The driver program is given its input using the same
158 + calling convention as used for GIT_EXTERNAL_DIFF
159 + program.
160 +
161 +
162 +Defining a custom diff driver
163 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164 +
165 +The definition of a diff driver is done in `gitconfig`, not
166 +`gitattributes` file, so strictly speaking this manual page is a
167 +wrong place to talk about it. However...
168 +
169 +To define a custom diff driver `jcdiff`, add a section to your
170 +`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
171 +
172 +----------------------------------------------------------------
173 +[diff "jcdiff"]
174 + command = j-c-diff
175 +----------------------------------------------------------------
176 +
177 +When git needs to show you a diff for the path with `diff`
178 +attribute set to `jcdiff`, it calls the command you specified
179 +with the above configuration, i.e. `j-c-diff`, with 7
180 +parameters, just like `GIT_EXTERNAL_DIFF` program is called.
181 +See gitlink:git[7] for details.
182
183
184 Performing a three-way merge
@@ -183,7 +209,7 @@ Unspecified::
209 different merge driver to be used for paths to which the
210 `merge` attribute is unspecified.
211
186 -Any other string value::
212 +String::
213
214 3-way merge is performed using the specified custom
215 merge driver. The built-in 3-way merge driver can be