"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Regress script fix for "printf ---"
To:
gameoftrees@openbsd.org
Date:
Mon, 16 Nov 2026 23:47:27 +0100

Download raw body.

Thread
  • Christian Weisgerber:

    Regress script fix for "printf ---"

Commit eff4b972 introduced many instances of "printf ---" into the
regression test scripts, e.g.

+       printf '--- gamma/delta\t\n' >> $testroot/stdout.expected
+       printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected

This has broken the regression suite on FreeBSD and presumably some
flavors of Linux, because various printf(1) implementations attempt
option parsing and choke:

FreeBSD sh(1) builtin:  printf: Illegal option --
FreeBSD standalone:     printf: illegal option -- -
bash(1) builtin:        -bash: printf: --: invalid option

We can explicitly terminate option parsing by inserting "--".  I'm
unsure whether this strictly conforms to POSIX, but it works across
OpenBSD, FreeBSD, GNU coreutils, and bash.

OK?  Other ideas?


sed -i "/printf '---/{ N; s/printf '/printf -- '/g; }" *.sh

diff /home/naddy/got
path + /home/naddy/got
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - 27cd1ade413da1d898e58df163433229c2b96525ea106bd074dd8d1194a1d845
file + regress/cmdline/commit.sh
--- regress/cmdline/commit.sh	
+++ regress/cmdline/commit.sh	
@@ -561,8 +561,8 @@ test_commit_path_prefix() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	got tree -r $testroot/repo -c $commit2 -i gamma | grep 'delta$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
-	printf '--- gamma/delta\t\n' >> $testroot/stdout.expected
-	printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected
+	printf -- '--- gamma/delta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ gamma/delta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-delta' >> $testroot/stdout.expected
 	echo '+modified delta' >> $testroot/stdout.expected
@@ -604,8 +604,8 @@ test_commit_path_prefix() {
 		| cut -d' ' -f 1 | sed -e 's/$/ (mode 644)/' \
 		>> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- gamma/delta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- gamma/delta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-modified delta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
@@ -613,8 +613,8 @@ test_commit_path_prefix() {
 	got tree -r $testroot/repo -c $commit3 -i gamma | grep 'new$' | \
 		cut -d' ' -f 1 | sed -e 's/$/ (mode 644)/' \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ gamma/new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ gamma/new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new' >> $testroot/stdout.expected
 
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - b48a8479fd68912fb78dd752ab03801692dd415d4b6a79b8093e8b3e6f651a95
file + regress/cmdline/diff.sh
--- regress/cmdline/diff.sh	
+++ regress/cmdline/diff.sh	
@@ -40,8 +40,8 @@ test_diff_basic() {
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + alpha' >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -50,15 +50,15 @@ test_diff_basic() {
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -127,8 +127,8 @@ test_diff_basic() {
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + alpha' >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -137,8 +137,8 @@ test_diff_basic() {
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
@@ -146,16 +146,16 @@ test_diff_basic() {
 	got tree -r $testroot/repo -i epsilon | grep 'zeta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + epsilon/zeta' >> $testroot/stdout.expected
-	printf '--- epsilon/zeta\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-zeta' >> $testroot/stdout.expected
 	echo '+modified zeta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -275,15 +275,15 @@ test_diff_basic() {
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + master (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ master\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ master\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+master' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -318,8 +318,8 @@ test_diff_basic() {
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	(cd $testroot/wt && got diff new > $testroot/stdout)
@@ -372,8 +372,8 @@ test_diff_basic() {
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -561,8 +561,8 @@ test_diff_shows_conflict() {
 	got tree -r $testroot/repo -i | grep 'numbers$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + numbers' >> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	echo '@@ -1,8 +1,20 @@' >> $testroot/stdout.expected
 	echo ' 1' >> $testroot/stdout.expected
 	echo "+<<<<<<< merged change: commit $head_rev" \
@@ -627,8 +627,8 @@ test_diff_tag() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -650,8 +650,8 @@ test_diff_tag() {
 	got tree -r $testroot/repo -i -c $commit_id2 | grep 'new$' | \
 		cut -d' ' -f 1 | tr -d '\n' >> $testroot/stdout.expected
 	echo " (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -692,8 +692,8 @@ test_diff_lightweight_tag() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -715,8 +715,8 @@ test_diff_lightweight_tag() {
 	got tree -r $testroot/repo -i -c $commit_id2 | grep 'new$' | \
 		cut -d' ' -f 1 | tr -d '\n' >> $testroot/stdout.expected
 	echo " (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -831,8 +831,8 @@ test_diff_symlinks_in_work_tree() {
 		grep 'alpha.link@ -> alpha$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'file + alpha.link' >> $testroot/stdout.expected
-	printf '--- alpha.link\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -844,8 +844,8 @@ test_diff_symlinks_in_work_tree() {
 		grep 'dotgotfoo.link@ -> .got/foo$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'file + dotgotfoo.link' >> $testroot/stdout.expected
-	printf '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected
-	printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-.got/foo' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -857,8 +857,8 @@ test_diff_symlinks_in_work_tree() {
 		grep 'beta.link@ -> ../beta$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'file + epsilon/beta.link' >> $testroot/stdout.expected
-	printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-../beta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -870,8 +870,8 @@ test_diff_symlinks_in_work_tree() {
 		grep 'epsilon.link@ -> epsilon$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'file + epsilon.link' >> $testroot/stdout.expected
-	printf '--- epsilon.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-epsilon' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -883,16 +883,16 @@ test_diff_symlinks_in_work_tree() {
 		grep 'nonexistent.link@ -> nonexistent$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- nonexistent.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-nonexistent' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
 	echo "commit - $commit_id1" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + zeta.link (mode 120000)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ zeta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ zeta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+epsilon/zeta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -941,8 +941,8 @@ test_diff_symlinks_in_repo() {
 	got tree -r $testroot/repo -c $commit_id2 -i | \
 		grep 'alpha.link@ -> beta$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
-	printf '--- alpha.link\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -956,8 +956,8 @@ test_diff_symlinks_in_repo() {
 	got tree -r $testroot/repo -c $commit_id2 -i | \
 		grep 'dotgotfoo.link@ -> .got/bar$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
-	printf '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected
-	printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-.got/foo' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -971,8 +971,8 @@ test_diff_symlinks_in_repo() {
 	got tree -r $testroot/repo -c $commit_id2 -i epsilon | \
 		grep 'beta.link@ -> ../gamma/delta$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
-	printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-../beta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -986,8 +986,8 @@ test_diff_symlinks_in_repo() {
 	got tree -r $testroot/repo -c $commit_id2 -i | \
 		grep 'epsilon.link@ -> gamma$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
-	printf '--- epsilon.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-epsilon' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -999,8 +999,8 @@ test_diff_symlinks_in_repo() {
 		cut -d' ' -f 1 | sed -e 's/$/ (mode 120000)/' \
 		>> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- nonexistent.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-nonexistent' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -1010,8 +1010,8 @@ test_diff_symlinks_in_repo() {
 		grep 'zeta.link@ -> epsilon/zeta$' | \
 		cut -d' ' -f 1 | sed -e 's/$/ (mode 120000)/' \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ zeta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ zeta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+epsilon/zeta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -1060,8 +1060,8 @@ test_diff_binary_files() {
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + foo (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ foo\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ foo\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	printf '+\377\377\0\0\377\377\0\0\n' >> $testroot/stdout.expected
 	printf '\\ No newline at end of file\n' >> $testroot/stdout.expected
@@ -1087,8 +1087,8 @@ test_diff_binary_files() {
 	got tree -r $testroot/repo -i | grep 'foo$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + foo' >> $testroot/stdout.expected
-	printf '--- foo\t\n' >> $testroot/stdout.expected
-	printf '+++ foo\t\n' >> $testroot/stdout.expected
+	printf -- '--- foo\t\n' >> $testroot/stdout.expected
+	printf -- '+++ foo\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	printf -- '-\377\377\0\0\377\377\0\0\n' >> $testroot/stdout.expected
 	printf '\\ No newline at end of file\n' >> $testroot/stdout.expected
@@ -1132,21 +1132,21 @@ test_diff_commits() {
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1176,21 +1176,21 @@ test_diff_commits() {
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	(cd $testroot/wt && got diff -c $commit_id0 -c $commit_id1 \
@@ -1209,8 +1209,8 @@ test_diff_commits() {
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -1239,14 +1239,14 @@ test_diff_commits() {
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	(cd $testroot/repo && got diff -c $commit_id0 -c $commit_id1 \
@@ -1506,21 +1506,21 @@ EOF
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1560,21 +1560,21 @@ EOF
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	(cd $testroot/wt && got diff -d -c $commit_id0 -c $commit_id1 \
@@ -1601,8 +1601,8 @@ EOF
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $alpha_id0" >> $testroot/stdout.expected
 	echo "blob + $alpha_id1" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -1641,14 +1641,14 @@ EOF
 	echo "commit + $commit_id1" >> $testroot/stdout.expected
 	echo "blob - $beta_id0 (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo "blob + $new_id1 (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	(cd $testroot/repo && got diff -d -c $commit_id0 -c $commit_id1 \
@@ -1695,8 +1695,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + alpha' >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -1705,15 +1705,15 @@ EOF
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1747,8 +1747,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'alpha$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + alpha' >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified alpha' >> $testroot/stdout.expected
@@ -1757,8 +1757,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
@@ -1766,16 +1766,16 @@ EOF
 	got tree -r $testroot/repo -i epsilon | grep 'zeta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + epsilon/zeta' >> $testroot/stdout.expected
-	printf '--- epsilon/zeta\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-zeta' >> $testroot/stdout.expected
 	echo '+modified zeta' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1830,15 +1830,15 @@ EOF
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + master (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ master\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ master\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+master' >> $testroot/stdout.expected
 	echo "commit - $head_rev" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ new\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -2289,8 +2289,8 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-beta change 5' >> $testroot/stdout.expected
 	echo '+beta change 7' >> $testroot/stdout.expected
@@ -2325,8 +2325,8 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 2 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 1 $beta_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo '+beta change 1' >> $testroot/stdout.expected
@@ -2353,8 +2353,8 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 4 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 3 $beta_ids)" >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-beta change 1' >> $testroot/stdout.expected
 	echo '+beta change 3' >> $testroot/stdout.expected
@@ -2382,8 +2382,8 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha change 6' >> $testroot/stdout.expected
 	echo '+alpha change 8' >> $testroot/stdout.expected
@@ -2410,15 +2410,15 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 9 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 2 $alpha_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 5 $alpha_ids)" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha change 2' >> $testroot/stdout.expected
 	echo '+alpha change 8' >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 2 $beta_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-beta change 1' >> $testroot/stdout.expected
 	echo '+beta change 7' >> $testroot/stdout.expected
@@ -2445,15 +2445,15 @@ test_diff_commit_keywords() {
 	echo "commit + $(pop_idx 8 $@)" >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 3 $alpha_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 4 $alpha_ids)" >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha change 4' >> $testroot/stdout.expected
 	echo '+alpha change 6' >> $testroot/stdout.expected
 	echo "blob - $(pop_idx 4 $beta_ids)" >> $testroot/stdout.expected
 	echo "blob + $(pop_idx 5 $beta_ids)" >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-beta change 5' >> $testroot/stdout.expected
 	echo '+beta change 7' >> $testroot/stdout.expected
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - ac783d4b0db097b7b8727a69d2219088fdeda8666d77e2465c330c929ca4fdd0
file + regress/cmdline/import.sh
--- regress/cmdline/import.sh	
+++ regress/cmdline/import.sh	
@@ -71,26 +71,26 @@ test_import_basic() {
 	echo "commit + $head_commit" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_alpha (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+alpha" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_beta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+beta" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_zeta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+zeta" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_delta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ gamma/delta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+delta" >> $testroot/stdout.expected
 	echo "" >> $testroot/stdout.expected
@@ -197,26 +197,26 @@ test_import_specified_head() {
 	echo "commit + $head_commit" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_alpha (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+alpha" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_beta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ beta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ beta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+beta" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_zeta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/zeta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+zeta" >> $testroot/stdout.expected
 	echo "blob - /dev/null" >> $testroot/stdout.expected
 	echo "blob + $id_delta (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ gamma/delta\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ gamma/delta\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+delta" >> $testroot/stdout.expected
 	echo "" >> $testroot/stdout.expected
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - ac9d47eb756f7a68a630f6b787617d6fb923ce43c0ceecad7f3ef4e4583b4edd
file + regress/cmdline/stage.sh
--- regress/cmdline/stage.sh	
+++ regress/cmdline/stage.sh	
@@ -941,8 +941,8 @@ test_stage_diff() {
 		>> $testroot/stdout.expected
 	echo ' (staged)' >> $testroot/stdout.expected
 	echo 'file + alpha' >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-modified file' >> $testroot/stdout.expected
 	echo '+modified file again' >> $testroot/stdout.expected
@@ -952,8 +952,8 @@ test_stage_diff() {
 		>> $testroot/stdout.expected
 	echo " (staged)" >> $testroot/stdout.expected
 	echo 'file + foo' >> $testroot/stdout.expected
-	printf '--- foo\t\n' >> $testroot/stdout.expected
-	printf '+++ foo\t\n' >> $testroot/stdout.expected
+	printf -- '--- foo\t\n' >> $testroot/stdout.expected
+	printf -- '+++ foo\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-new file' >> $testroot/stdout.expected
 	echo '+new file changed' >> $testroot/stdout.expected
@@ -977,8 +977,8 @@ test_stage_diff() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l alpha) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified file' >> $testroot/stdout.expected
@@ -987,8 +987,8 @@ test_stage_diff() {
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo "commit - $head_commit" >> $testroot/stdout.expected
@@ -996,8 +996,8 @@ test_stage_diff() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l foo) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ foo\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ foo\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1393,8 +1393,8 @@ test_stage_commit() {
 		>> $testroot/stdout.expected
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	cat $testroot/blob_id_alpha >> $testroot/stdout.expected
-	printf '--- alpha\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '+modified file' >> $testroot/stdout.expected
@@ -1404,16 +1404,16 @@ test_stage_commit() {
 		>> $testroot/stdout.expected
 	echo " (mode 644)" >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-beta' >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	cat $testroot/blob_id_foo | tr -d '\n' >> $testroot/stdout.expected
 	echo " (mode 644)" >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ foo\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ foo\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+new file' >> $testroot/stdout.expected
 
@@ -1607,8 +1607,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	echo "@@ -4,7 +4,7 @@" >> $testroot/stdout.expected
 	echo " 4" >> $testroot/stdout.expected
 	echo " 5" >> $testroot/stdout.expected
@@ -1714,8 +1714,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	echo "@@ -13,4 +13,4 @@" >> $testroot/stdout.expected
 	echo " 13" >> $testroot/stdout.expected
 	echo " 14" >> $testroot/stdout.expected
@@ -1869,8 +1869,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	cat >> $testroot/stdout.expected <<EOF
 @@ -4,7 +4,7 @@
  4
@@ -1906,8 +1906,8 @@ EOF
 		tr -d '\n' >> $testroot/stdout.expected
 	echo " (staged)" >> $testroot/stdout.expected
 	echo 'file + numbers' >> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	cat >> $testroot/stdout.expected <<EOF
 @@ -1,5 +1,5 @@
  1
@@ -1972,8 +1972,8 @@ test_stage_patch_added() {
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l epsilon/new) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/new\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+new" >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -2097,8 +2097,8 @@ test_stage_patch_removed() {
 	(cd $testroot/wt && got stage -l beta) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected
 	echo "-beta" >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -2322,8 +2322,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l numbers) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	echo "@@ -1,5 +1,5 @@" >> $testroot/stdout.expected
 	echo " 1" >> $testroot/stdout.expected
 	echo "-2" >> $testroot/stdout.expected
@@ -2518,8 +2518,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l alpha.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- alpha.link\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2530,8 +2530,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l dotgotbar.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ dotgotbar.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ dotgotbar.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+.got/bar' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2540,8 +2540,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l dotgotfoo.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+this is regular file foo' >> $testroot/stdout.expected
 	echo "commit - $head_commit" >> $testroot/stdout.expected
@@ -2551,8 +2551,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l epsilon/beta.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon/beta.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/beta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-../beta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2565,8 +2565,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l epsilon.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- epsilon.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-epsilon' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2577,8 +2577,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'nonexistent.link@ -> nonexistent$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- nonexistent.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-nonexistent' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2587,8 +2587,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l zeta.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ zeta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ zeta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+gamma/delta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2849,8 +2849,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l alpha.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- alpha.link\t\n' >> $testroot/stdout.expected
-	printf '+++ alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- alpha.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ alpha.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-alpha' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2861,8 +2861,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l dotgotfoo.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ dotgotfoo.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+this is regular file foo' >> $testroot/stdout.expected
 	echo "commit - $head_commit" >> $testroot/stdout.expected
@@ -2872,8 +2872,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l epsilon.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- epsilon.link\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- epsilon.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +1 @@' >> $testroot/stdout.expected
 	echo '-epsilon' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2884,8 +2884,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'nonexistent.link@ -> nonexistent$' | \
 		cut -d' ' -f 1 >> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- nonexistent.link\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- nonexistent.link\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-nonexistent' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
@@ -2894,8 +2894,8 @@ EOF
 	echo -n 'blob + ' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage -l zeta.link) | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ zeta.link\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ zeta.link\t\n' >> $testroot/stdout.expected
 	echo '@@ -0,0 +1 @@' >> $testroot/stdout.expected
 	echo '+gamma/delta' >> $testroot/stdout.expected
 	echo '\ No newline at end of file' >> $testroot/stdout.expected
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - 3b6d843606291eafbf5c5413e057d142978a135be1f1424f344a01f57d6cda7e
file + regress/cmdline/unstage.sh
--- regress/cmdline/unstage.sh	
+++ regress/cmdline/unstage.sh	
@@ -803,8 +803,8 @@ test_unstage_patch_added() {
 	echo "commit - $commit_id" >> $testroot/stdout.expected
 	echo 'blob - /dev/null' >> $testroot/stdout.expected
 	echo 'file + epsilon/new (mode 644)' >> $testroot/stdout.expected
-	printf '--- /dev/null\t\n' >> $testroot/stdout.expected
-	printf '+++ epsilon/new\t\n' >> $testroot/stdout.expected
+	printf -- '--- /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '+++ epsilon/new\t\n' >> $testroot/stdout.expected
 	echo "@@ -0,0 +1 @@" >> $testroot/stdout.expected
 	echo "+new" >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -873,8 +873,8 @@ test_unstage_patch_removed() {
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected
 	echo "-beta" >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
@@ -979,8 +979,8 @@ EOF
 		tr -d '\n' >> $testroot/stdout.expected
 	echo " (staged)" >> $testroot/stdout.expected
 	echo "file + numbers" >> $testroot/stdout.expected
-	printf '--- numbers\t\n' >> $testroot/stdout.expected
-	printf '+++ numbers\t\n' >> $testroot/stdout.expected
+	printf -- '--- numbers\t\n' >> $testroot/stdout.expected
+	printf -- '+++ numbers\t\n' >> $testroot/stdout.expected
 	echo "@@ -1,5 +1,5 @@" >> $testroot/stdout.expected
 	echo " 1" >> $testroot/stdout.expected
 	echo "-2" >> $testroot/stdout.expected
@@ -1031,8 +1031,8 @@ EOF
 	got tree -r $testroot/repo -i | grep 'zzz$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'blob + /dev/null' >> $testroot/stdout.expected
-	printf '--- zzz\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- zzz\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo "@@ -1 +0,0 @@" >> $testroot/stdout.expected
 	echo "-zzz" >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
commit - 8fdee7bf59a9dd9448ca69b333c468f8c8a7b7081a59bc04fefc0860e9fd655e
blob - ad858adc1a58fb852908a501a86c6b24c8a513b9c02a77c86899e3c728b5a03f
file + regress/cmdline/update.sh
--- regress/cmdline/update.sh	
+++ regress/cmdline/update.sh	
@@ -1184,8 +1184,8 @@ test_update_conflict_wt_rm_vs_repo_edit() {
 	got tree -r $testroot/repo -i | grep 'beta$' | cut -d' ' -f 1 \
 		>> $testroot/stdout.expected
 	echo 'file + /dev/null' >> $testroot/stdout.expected
-	printf '--- beta\t\n' >> $testroot/stdout.expected
-	printf '+++ /dev/null\t\n' >> $testroot/stdout.expected
+	printf -- '--- beta\t\n' >> $testroot/stdout.expected
+	printf -- '+++ /dev/null\t\n' >> $testroot/stdout.expected
 	echo '@@ -1 +0,0 @@' >> $testroot/stdout.expected
 	echo '-modified beta' >> $testroot/stdout.expected
 
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de