git/list[1] front-page[2] threads[3] people[4] search[5] about
 

GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts

From
BHBruno Haible <bruno@clisp.org>
Date
Sep 30, 2007, 19:17 UTC
Message-ID
<200709302117.37422.bruno@clisp.org>
Hi,

"git diff --uncached" invokes the GIT_EXTERNAL_DIFF variable with just one argument (instead of 7 arguments, as documented) in a particular situation: when there are conflicts after "git stash apply".

To reproduce:
  - Set environment variable GIT_EXTERNAL_DIFF to point to the attached
    script.
  - Make a clean gnulib checkout, 1 day old.
  - Add a entry to the top of the ChangeLog.
  - $ git pull
    fails due a conflict.
  - $ git stash
  - $ git pull
  - $ git stash apply
  - $ git-diff --cached | cat
    yields:
my-diff-for-git ChangeLog
diff --cc ChangeLog
index 443ad76,991c26b..0000000
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,7 -1,6 +1,11 @@@
  2007-09-30  Bruno Haible  <bruno@clisp.org>
  
++<<<<<<< Updated upstream:ChangeLog
 +      * tests/test-getaddrinfo.c (AF_UNSPEC): Provide a fallback definition.
 +      Needed on BeOS.
++=======
+       * Some other changes.
++>>>>>>> Stashed changes:ChangeLog
  
  2007-09-30  Bruno Haible  <bruno@clisp.org>
  

As you can see from the output of the script's line 2, it was called with
just one argument. This is not enough information for producing output
in a different way than the built-in way - defeating the purpose of
GIT_EXTERNAL_DIFF.

Can the GIT_EXTERNAL_DIFF invocation be done with 7 or more arguments?
It'd be OK to extend the calling convention.

Bruno
Next: Junio C Hamano
Message 1 of 3 in “GIT_EXTERNAL_DIFF invoked with undocumented calling convention after unstashing conflicts”
  1. Bruno HaibleSep 30, 2007
  2. Junio C HamanoSep 30, 2007
  3. Bruno HaibleSep 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.