Linux Mint has an implementation of the highlight command (unrelated
to the one from that works as a simple
filter. The script uses 'sed' to add terminal colour escape codes
around text matching a regular expression. When t9500-*.sh attempts
to run "highlight --version", the script simply hangs waiting for
input. (See

The tool required by gitweb can be installed from the 'highlight'
package. Unfortunately, given the default $PATH, this leads to the
tool having lower precedence than the script.

In order to avoid hanging the test, add '</dev/null' to the command
line of the highlight invocation. Also, since the 'highlight' tool
requred by gitweb produces '--version' output (and the script does
not), saving the command output allows a simple check for the wrong

Signed-off-by: Ramsay Jones <>
 t/ | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/ 
index 6fca193..718014d 100755
--- a/t/
+++ b/t/
@@ -683,9 +683,11 @@ test_expect_success \
 # syntax highlighting
-highlight --version >/dev/null 2>&1
+highlight_version=$(highlight --version </dev/null 2>/dev/null)
 if [ $? -eq 127 ]; then
-       say "Skipping syntax highlighting test, because 'highlight' was not 
+       say "Skipping syntax highlighting tests: 'highlight' not found"
+elif test -z "$highlight_version"; then
+       say "Skipping syntax highlighting tests: incorrect 'highlight' found"
        test_set_prereq HIGHLIGHT
        cat >>gitweb_config.perl <<-\EOF
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to