From: Jonas Fonseca Date: Wed, 23 Apr 2008 19:14:08 +0000 (+0200) Subject: Drop use of $(...) for popen() and system() calls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=50efd29ce94c4dd90421db29d2516fdde675f8e8;p=tig.git Drop use of $(...) for popen() and system() calls Some shells don't support it, like the jsh that is used as /bin/sh on some Solaris boxes, which results in the following error: sh: syntax error at line 1: `(' unexpected Fix the only user (reading remote information via git-ls-remote) to use a much simpler shell syntax. Reported by SungHyun Nam. --- diff --git a/NEWS b/NEWS index 72efd04..626c824 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ Bug fixes: - Fix regression when staging all diff chunks in a section. - Bind the maximize view action to 'O'; it conflicted with the keybinding to launch the merge tool in the status view. + - Fix problem with $(cmd) usage in shell code. Some shells (jsh) + installed as /bin/sh does not support it. tig-0.11 -------- diff --git a/tig.c b/tig.c index 67d0693..c50ea84 100644 --- a/tig.c +++ b/tig.c @@ -109,7 +109,7 @@ static size_t utf8_length(const char *string, int *width, size_t max_width, int #endif #define TIG_LS_REMOTE \ - "git ls-remote $(git rev-parse --git-dir) 2>/dev/null" + "git ls-remote . 2>/dev/null" #define TIG_DIFF_CMD \ "git show --pretty=fuller --no-color --root --patch-with-stat --find-copies-harder -C %s 2>/dev/null"