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

t7610-mergetool.sh test failure

From
Armin Kunaschik <megabreit@googlemail.com>
Date
May 24, 2016, 16:44 UTC
Message-ID
<CALR6jEhQrSuVAG9=8AC10Lr776KyVurdTkH8QRHH5GWEMk+wNg@mail.gmail.com>
t7610-mergetool.sh fails on systems without mktemp.

mktemp is used in git-mergetool.sh and throws an error when it's not available. error: mktemp is needed when 'mergetool.writeToTemp' is true

I see 2 options:
1. code around it, write an own mktemp, maybe use the test-mktemp as a basis.
2. disable the test when mktemp is not available
>From my point of view option 2 would be enough.
Any opinions about that?

Peff suggested something like this... works for me. This patch is probably whitespace damaged... I could not yet figure out a way to use and preserve tabs with Google mail.

---
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 76306cf..9279bf5 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -589,7 +589,12 @@ test_expect_success 'filenames seen by tools
start with ./' '
        git reset --hard master >/dev/null 2>&1
 '

-test_expect_success 'temporary filenames are used with mergetool.writeToTemp' '
+test_lazy_prereq MKTEMP '
+       tempdir=$(mktemp -d -t foo.XXX) &&
+       test -d "$tempdir"
+'
+
+test_expect_success MKTEMP 'temporary filenames are used with
mergetool.writeToTemp' '
        git checkout -b test16 branch1 &&
        test_config mergetool.writeToTemp true &&
        test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
Next: Junio C Hamano
Message 1 of 13 in “t7610-mergetool.sh test failure”
  1. Armin KunaschikMay 24, 2016
  2. Junio C HamanoMay 24, 2016
  3. Armin KunaschikMay 24, 2016
  4. Jeff KingMay 25, 2016
  5. Jeff KingMay 26, 2016
  6. David AguilarMay 27, 2016
  7. Jeff KingMay 27, 2016
  8. Junio C HamanoMay 27, 2016
  9. Jeff KingMay 27, 2016
  10. Junio C HamanoMay 27, 2016
  11. Jeff KingMay 27, 2016
  12. Armin KunaschikJun 22, 2016
  13. Jeff KingJun 22, 2016

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.