{"thread":{"id":"47696","subject":"please resolve a mystery for me: what is j-c-diff exactly? ;)","startedAt":"2018-01-25T20:37:59Z","lastAt":"2018-01-25T20:37:59Z","messageCount":1,"participants":["Yaroslav Halchenko"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337405","messageId":"20180125203747.GI3658@hopa.kiewit.dartmouth.edu","threadId":"47696","inReplyTo":null,"subject":"please resolve a mystery for me: what is j-c-diff exactly? ;)","fromName":"Yaroslav Halchenko","fromEmail":"yoh@onerussian.com","sentAt":"2018-01-25T20:37:47Z","receivedAt":"2018-01-25T20:37:59Z","isPatch":false,"sender":{"key":"yoh@onerussian.com","avatar":"https://gravatar.com/avatar/8901b82415ae451a83aea49409708912726e53620e3ac92320bf1f86548d97e9?d=mp&s=160"},"body":"Hi Junio et al,\n\nj-c-diff is \"used\" in the docs within git, git-annex, and other places\ndiscussing git.  But I failed to find it to seek for an ultimate prototypical\nexample of the diff command used by git ppl ;)\n\n$> git log -Sj-c-diff -p Documentation/gitattributes.txt \ncommit 2cc3167c688d1c91bc4cb9b1caa737b9d4971056\nAuthor: Junio C Hamano <junkio@cox.net>\nDate:   Mon Apr 23 00:21:02 2007 -0700\n\n    Document \"diff=driver\" attribute\n    \n    Signed-off-by: Junio C Hamano <junkio@cox.net>\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 126871756d..d2edb9b14a 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -151,8 +151,34 @@ Unspecified::\n        text, it is treated as text.  Otherwise it would\n        generate `Binary files differ`.\n \n-Any other value set to `diff` attribute is ignored and git acts\n-as if the attribute is left unspecified.\n+String::\n+\n+ Diff is shown using the specified custom diff driver.\n+ The driver program is given its input using the same\n+ calling convention as used for GIT_EXTERNAL_DIFF\n+ program.\n+\n+\n+Defining a custom diff driver\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+The definition of a diff driver is done in `gitconfig`, not\n+`gitattributes` file, so strictly speaking this manual page is a\n+wrong place to talk about it.  However...\n+\n+To define a custom diff driver `jcdiff`, add a section to your\n+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:\n+\n+----------------------------------------------------------------\n+[diff \"jcdiff\"]\n+ command = j-c-diff\n+----------------------------------------------------------------\n+\n+When git needs to show you a diff for the path with `diff`\n+attribute set to `jcdiff`, it calls the command you specified\n+with the above configuration, i.e. `j-c-diff`, with 7\n+parameters, just like `GIT_EXTERNAL_DIFF` program is called.\n+See gitlink:git[7] for details.\n\nCheers!\n-- \nYaroslav O. Halchenko\nCenter for Open Neuroscience     http://centerforopenneuroscience.org\nDartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755\nPhone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419\nWWW:   http://www.linkedin.com/in/yarik        \n"}]}