{"thread":{"id":"10093","subject":"GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts","startedAt":"2007-09-30T19:17:37Z","lastAt":"2007-09-30T21:25:56Z","messageCount":3,"participants":["Bruno Haible","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54419","messageId":"200709302117.37422.bruno@clisp.org","threadId":"10093","inReplyTo":null,"subject":"GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts","fromName":"Bruno Haible","fromEmail":"bruno@clisp.org","sentAt":"2007-09-30T19:17:37Z","receivedAt":"2007-09-30T19:17:37Z","isPatch":false,"sender":{"key":"bruno@clisp.org","avatar":null},"body":"Hi,\n\n\"git diff --uncached\" invokes the GIT_EXTERNAL_DIFF variable with just one\nargument (instead of 7 arguments, as documented) in a particular situation:\nwhen there are conflicts after \"git stash apply\".\n\nTo reproduce:\n  - Set environment variable GIT_EXTERNAL_DIFF to point to the attached\n    script.\n  - Make a clean gnulib checkout, 1 day old.\n  - Add a entry to the top of the ChangeLog.\n  - $ git pull\n    fails due a conflict.\n  - $ git stash\n  - $ git pull\n  - $ git stash apply\n  - $ git-diff --cached | cat\n    yields:\nmy-diff-for-git ChangeLog\ndiff --cc ChangeLog\nindex 443ad76,991c26b..0000000\n--- a/ChangeLog\n+++ b/ChangeLog\n@@@ -1,7 -1,6 +1,11 @@@\n  2007-09-30  Bruno Haible  <bruno@clisp.org>\n  \n++<<<<<<< Updated upstream:ChangeLog\n +      * tests/test-getaddrinfo.c (AF_UNSPEC): Provide a fallback definition.\n +      Needed on BeOS.\n++=======\n+       * Some other changes.\n++>>>>>>> Stashed changes:ChangeLog\n  \n  2007-09-30  Bruno Haible  <bruno@clisp.org>\n  \n\nAs you can see from the output of the script's line 2, it was called with\njust one argument. This is not enough information for producing output\nin a different way than the built-in way - defeating the purpose of\nGIT_EXTERNAL_DIFF.\n\nCan the GIT_EXTERNAL_DIFF invocation be done with 7 or more arguments?\nIt'd be OK to extend the calling convention.\n\nBruno\n"},{"id":"54421","messageId":"7vk5q7hqld.fsf@gitster.siamese.dyndns.org","threadId":"10093","inReplyTo":"200709302117.37422.bruno@clisp.org","subject":"Re: GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-30T19:59:26Z","receivedAt":"2007-09-30T19:59:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> \"git diff --uncached\" invokes the GIT_EXTERNAL_DIFF variable with just one\n> argument (instead of 7 arguments, as documented) in a particular situation:\n\nYou are looking at an unmerged path.\n\n    'GIT_EXTERNAL_DIFF'::\n            When the environment variable 'GIT_EXTERNAL_DIFF' is set, the\n            program named by it is called, instead of the diff invocation\n            described above.  For a path that is added, removed, or modified,\n            'GIT_EXTERNAL_DIFF' is called with 7 parameters:\n\n    ...\n    +\n    For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1\n    parameter, <path>.\n\nThe script needs to decide how it wants to present an unmerged\npath; the information on each unmerged stages can be read from\nthe output of \"ls-files -u $thatpath\".\n"},{"id":"54438","messageId":"200709302325.56235.bruno@clisp.org","threadId":"10093","inReplyTo":"7vk5q7hqld.fsf@gitster.siamese.dyndns.org","subject":"Re: GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts","fromName":"Bruno Haible","fromEmail":"bruno@clisp.org","sentAt":"2007-09-30T21:25:56Z","receivedAt":"2007-09-30T21:25:56Z","isPatch":false,"sender":{"key":"bruno@clisp.org","avatar":null},"body":"Junio C Hamano wrote:\n> The script needs to decide how it wants to present an unmerged\n> path; the information on each unmerged stages can be read from\n> the output of \"ls-files -u $thatpath\".\n\nThanks for this info. This, and \"git cat-file\", did the trick.\n\nBruno\n"}]}