{"thread":{"id":"27439","subject":"[PATCH] diff-options.txt: document --[no]-textconv","startedAt":"2011-05-24T00:27:54Z","lastAt":"2011-05-24T19:45:27Z","messageCount":4,"participants":["Jay Soffian","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"168559","messageId":"1306196874-64687-1-git-send-email-jaysoffian@gmail.com","threadId":"27439","inReplyTo":null,"subject":"[PATCH] diff-options.txt: document --[no]-textconv","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-05-24T00:27:54Z","receivedAt":"2011-05-24T00:27:54Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\ntextconv also seems to be supported by blame, it isn't clear to me whether\nit respects --no-textconv.\n\n Documentation/diff-options.txt |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex c7ed946357..8b311a60ea 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -412,6 +412,15 @@ endif::git-format-patch[]\n --no-ext-diff::\n \tDisallow external diff drivers.\n \n+--textconv::\n+\tText conversion of binary files is enabled by default if configured\n+\taccording to \"Performing text diffs of binary files\" in\n+\tlinkgit:gitattributes[5], but may be disabled with `--no-textconv`.\n+\tThis option overrides a previously given `--no-textconv`.\n+\n+--no-textconv::\n+\tDisable text conversion of binary files.\n+\n --ignore-submodules[=<when>]::\n \tIgnore changes to submodules in the diff generation. <when> can be\n \teither \"none\", \"untracked\", \"dirty\" or \"all\", which is the default\n-- \n1.7.5.2.323.g00f3d\n"},{"id":"168566","messageId":"7vlixwanrl.fsf@alter.siamese.dyndns.org","threadId":"27439","inReplyTo":"1306196874-64687-1-git-send-email-jaysoffian@gmail.com","subject":"Re: [PATCH] diff-options.txt: document --[no]-textconv","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-24T01:30:22Z","receivedAt":"2011-05-24T01:30:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> Signed-off-by: Jay Soffian <jaysoffian@gmail.com>\n> ---\n> textconv also seems to be supported by blame, it isn't clear to me whether\n> it respects --no-textconv.\n\nI think it would, as it shares the command line parser with the rest of\nthe commands in the \"log\" family.\n"},{"id":"168591","messageId":"20110524194322.GC584@sigill.intra.peff.net","threadId":"27439","inReplyTo":"1306196874-64687-1-git-send-email-jaysoffian@gmail.com","subject":"Re: [PATCH] diff-options.txt: document --[no]-textconv","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-24T19:43:23Z","receivedAt":"2011-05-24T19:43:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 23, 2011 at 08:27:54PM -0400, Jay Soffian wrote:\n\n> textconv also seems to be supported by blame, it isn't clear to me whether\n> it respects --no-textconv.\n\nYeah, it should, via the regular diff option parser.\n\n> +--textconv::\n> +\tText conversion of binary files is enabled by default if configured\n> +\taccording to \"Performing text diffs of binary files\" in\n> +\tlinkgit:gitattributes[5], but may be disabled with `--no-textconv`.\n> +\tThis option overrides a previously given `--no-textconv`.\n\nIt's only on by default for porcelain commands (log, show, diff).\nPlumbing commands do not allow textconv unless --textconv is given.\n\nI don't offhand recall whether it is on by default for blame.\n\n-Peff\n"},{"id":"168592","messageId":"20110524194527.GD584@sigill.intra.peff.net","threadId":"27439","inReplyTo":"1306196874-64687-1-git-send-email-jaysoffian@gmail.com","subject":"[PATCH] doc: discuss textconv versus external diff drivers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-24T19:45:27Z","receivedAt":"2011-05-24T19:45:27Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We already talk about how to use each one and how they work,\nbut it is a reasonable question to wonder why one might use\none over the other.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis can probably go with Jay's --textconv documentation topic.\n\n Documentation/gitattributes.txt |   31 +++++++++++++++++++++++++++++++\n 1 files changed, 31 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 15aebc6..412c55b 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -593,6 +593,37 @@ and now produces better output), you can remove the cache\n manually with `git update-ref -d refs/notes/textconv/jpg` (where\n \"jpg\" is the name of the diff driver, as in the example above).\n \n+Choosing textconv versus external diff\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+If you want to show differences between binary or specially-formatted\n+blobs in your repository, you can choose to use either an external diff\n+command, or to use textconv to convert them to a diff-able text format.\n+Which method you choose depends on your exact situation.\n+\n+The advantage of using an external diff command is flexibility. You are\n+not bound to find line-oriented changes, nor is it necessary for the\n+output to resemble unified diff. You are free to locate and report\n+changes in the most appropriate way for your data format.\n+\n+A textconv, by comparison, is much more limiting. You provide a\n+transformation of the data into a line-oriented text format, and git\n+uses its regular diff tools to generate the output. There are several\n+advantages to choosing this method:\n+\n+1. Ease of use. It is often much simpler to write a binary to text\n+   transformation than it is to perform your own diff. In many cases,\n+   existing programs can be used as textconv filters (e.g., exif,\n+   odt2txt).\n+\n+2. Git diff features. By performing only the transformation step\n+   yourself, you can still utilize many of git's diff features,\n+   including colorization, word-diff, and combined diffs for merges.\n+\n+3. Caching. Textconv caching can speed up repeated diffs, such as those\n+   you might trigger by running `git log -p`.\n+\n+\n Marking files as binary\n ^^^^^^^^^^^^^^^^^^^^^^^\n \n-- \n1.7.4.5.7.g2e01\n"}]}