Commit Diff


commit - b9f899df45678237dc88ac499eb6de31a23294d5
commit + 372960fedf033e1a18e08ae30d9d0a9096206266
blob - 7f93819e7c81cad6a3fae4ea38c5564ff61ae6cf
blob + 9f27a5b3838165f5f270d7da86b7e35a5068ed48
--- Makefile.common.in
+++ Makefile.common.in
@@ -2,10 +2,11 @@ AM_CFLAGS += \
 	    @AM_CFLAGS@ \
 	    -g -Wall -Wno-long-long -W -Wformat=2 -Wmissing-prototypes \
 	    -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings \
-	    -Wshadow -Wpointer-arith -Wsign-compare -Wundef \
+	    -Wshadow -Wpointer-arith -Wno-sign-compare -Wundef \
 	    -Wbad-function-cast -Winline -Wcast-align \
 	    -Wdeclaration-after-statement -Wno-pointer-sign \
-	    -Wno-attributes -Wno-unused-result
+	    -Wno-attributes -Wno-unused-result \
+	    -Wno-incompatible-pointer-types-discards-qualifiers
 
 AM_CPPFLAGS += \
 	      @AM_CPPFLAGS@ \
blob - 22b98dd9f7ee723fd045ee9edb92fdbcdc75df98
blob + f4828b6c8a7e9c290972b5457c4a9c2f7d93597b
--- regress/cmdline/commit.sh
+++ regress/cmdline/commit.sh
@@ -1377,7 +1377,7 @@ test_commit_prepared_logmsg() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i 's/foo/bar/' "\$1"
+sed -i '' 's/foo/bar/' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
@@ -1399,7 +1399,10 @@ EOF
 	fi
 
 	local author_time=`git_show_author_time $testroot/repo`
-	d=`env LC_TIME=C date -u -d "@$author_time" +"%a %b %e %X %Y UTC"`
+	local prev_LC_TIME="$LC_TIME"
+	export LC_TIME=C
+	d=`date -u -d "@$author_time" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
 	echo "-----------------------------------------------" > $testroot/stdout.expected
 	echo "commit $head_rev (master)" >> $testroot/stdout.expected
 	echo "from: $GOT_AUTHOR" >> $testroot/stdout.expected
@@ -1438,7 +1441,10 @@ EOF
 	fi
 
 	local author_time=`git_show_author_time $testroot/repo`
-	d=`env LC_TIME=C date -u -d "@$author_time" +"%a %b %e %X %Y UTC"`
+	local prev_LC_TIME="$LC_TIME"
+	export LC_TIME=C
+	d=`date -u -d "@$author_time" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
 	echo "-----------------------------------------------" \
 		> $testroot/stdout.expected
 	echo "commit $head_rev (master)" >> $testroot/stdout.expected
blob - c0b2732f4fd9fd4cc10cc8964d7e255b1341f13b
blob + daf8b3ad0ba368a26d5b4278e6746fb270a59784
--- regress/cmdline/common.sh
+++ regress/cmdline/common.sh
@@ -26,6 +26,31 @@ export GOT_TEST_ROOT="/tmp"
 
 export MALLOC_OPTIONS=S
 
+date()
+{
+	DATECMD="date"
+	[ "$OSTYPE" != "linux-gnu" ] && DATECMD="gdate"
+
+	"$DATECMD" "$@"
+}
+
+ln()
+{
+	LNCMD="ln"
+	[ "$OSTYPE" != "linux-gnu" ] && LNCMD="gln"
+
+	"$LNCMD" "$@"
+}
+
+#sed()
+#{
+#	SEDCMD="sed"
+#	[ "$OSTYPE" != "linux-gnu" ] && LNCMD="gsed"
+#
+#	"$SEDCMD" "$@"
+#}
+
+
 git_init()
 {
 	git init -q "$1"
blob - 7bc83f4d3575b51f65002d99ae9beedadfea7495
blob + 1faa01998f546ad7441d23eeccd924bc46fd980d
--- regress/cmdline/diff.sh
+++ regress/cmdline/diff.sh
@@ -427,14 +427,14 @@ test_diff_shows_conflict() {
 		return 1
 	fi
 
-	sed -i 's/2/22/' $testroot/repo/numbers
-	sed -i 's/8/33/' $testroot/repo/numbers
+	sed -i '' 's/2/22/' $testroot/repo/numbers
+	sed -i '' 's/8/33/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 	local head_rev=`git_show_head $testroot/repo`
 
 	# modify lines 2 and 8 in conflicting ways
-	sed -i 's/2/77/' $testroot/wt/numbers
-	sed -i 's/8/88/' $testroot/wt/numbers
+	sed -i '' 's/2/77/' $testroot/wt/numbers
+	sed -i '' 's/8/88/' $testroot/wt/numbers
 
 	echo "C  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: $head_rev" \
blob - b41b92c7fcb1665a9350277973ed872e30f02de8
blob + bab97d4aacb49217ed5a5c0a3bf43ae8df1729eb
--- regress/cmdline/histedit.sh
+++ regress/cmdline/histedit.sh
@@ -131,7 +131,7 @@ test_histedit_no_op() {
 
 	got diff -r $testroot/repo $orig_commit $new_commit2 \
 		> $testroot/diff
-	sed -i -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
+	sed -i '' -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
 	cmp -s $testroot/diff.expected $testroot/diff
 	ret="$?"
 	if [ "$ret" != "0" ]; then
@@ -154,7 +154,11 @@ test_histedit_no_op() {
 	# We should have a backup of old commits
 	(cd $testroot/repo && got histedit -l > $testroot/stdout)
 	d_orig1=`date -u -d "@$old_author_time1" +"%G-%m-%d"`
-	d_orig2=`env LC_TIME=C date -u -d "@$old_author_time2" +"%a %b %e %X %Y UTC"`
+
+	local prev_LC_TIME="$LC_TIME"
+	export LC_TIME=C
+	d_orig2=`date -u -d "@$old_author_time2" +"%a %b %e %X %Y UTC"`
+	export LC_TIME="$prev_LC_TIME"
 	d_new2=`date -u -d "@$new_author_time2" +"%G-%m-%d"`
 	d_orig=`date -u -d "@$orig_author_time" +"%G-%m-%d"`
 	cat > $testroot/stdout.expected <<EOF
@@ -340,7 +344,7 @@ test_histedit_swap() {
 
 	got diff -r $testroot/repo $orig_commit $new_commit1 \
 		> $testroot/diff
-	sed -i -e "s/$old_commit2/$new_commit1/" $testroot/diff.expected
+	sed -i '' -e "s/$old_commit2/$new_commit1/" $testroot/diff.expected
 	cmp -s $testroot/diff.expected $testroot/diff
 	ret="$?"
 	if [ "$ret" != "0" ]; then
@@ -445,8 +449,8 @@ test_histedit_drop() {
 
 	got diff -r $testroot/repo $orig_commit $new_commit2 \
 		> $testroot/diff
-	sed -i -e "s/$old_commit1/$orig_commit/" $testroot/diff.expected
-	sed -i -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
+	sed -i '' -e "s/$old_commit1/$orig_commit/" $testroot/diff.expected
+	sed -i '' -e "s/$old_commit2/$new_commit2/" $testroot/diff.expected
 	cmp -s $testroot/diff.expected $testroot/diff
 	ret="$?"
 	if [ "$ret" != "0" ]; then
@@ -1150,7 +1154,7 @@ test_histedit_path_prefix_edit() {
 
 	got diff -r $testroot/repo $orig_commit $new_commit1 \
 		> $testroot/diff
-	sed -i -e "s/$old_commit1/$new_commit1/" $testroot/diff.expected
+	sed -i '' -e "s/$old_commit1/$new_commit1/" $testroot/diff.expected
 	cmp -s $testroot/diff.expected $testroot/diff
 	ret="$?"
 	if [ "$ret" != "0" ]; then
@@ -1565,7 +1569,7 @@ test_histedit_fold_only() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i 's/.*/committing folded changes/' "\$1"
+sed -i '' 's/.*/committing folded changes/' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
@@ -1681,7 +1685,7 @@ test_histedit_fold_only_empty_logmsg() {
 
 	cat > $testroot/editor.sh <<EOF
 #!/bin/sh
-sed -i 'd' "\$1"
+sed -i '' 'd' "\$1"
 EOF
 	chmod +x $testroot/editor.sh
 
blob - ad935fbf9a8d899be794504190115e1b649c0f16
blob + 0531881d4d4855f22d5d2acb605d1575c537a94d
--- regress/cmdline/rebase.sh
+++ regress/cmdline/rebase.sh
@@ -153,7 +153,10 @@ test_rebase_basic() {
 
 	# We should have a backup of old commits
 	(cd $testroot/repo && got rebase -l > $testroot/stdout)
-	d_orig2=`env LC_TIME=C date -u -d "@$orig_author_time2" +"%a %b %e %X %Y UTC"`
+	local prev_LC_TIME="$LC_TIME"
+	export LC_TIME=C
+	d_orig2=`date -u -d "@$orig_author_time2" +"%a %b %e %X %Y UTC"`
+	export LC_TIME="$prev_LC_TIME"
 	d_new2=`date -u -d "@$new_author_time2" +"%G-%m-%d"`
 	d_0=`date -u -d "@$commit0_author_time" +"%G-%m-%d"`
 	cat > $testroot/stdout.expected <<EOF
blob - f7324aa77b41d0836e1e4afad7db548534175ace
blob + d8ebff4da2318e250b48af48107b4239b2b982c9
--- regress/cmdline/revert.sh
+++ regress/cmdline/revert.sh
@@ -384,9 +384,9 @@ test_revert_patch() {
 		return 1
 	fi
 
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
-	sed -i -e 's/^7$/b/' $testroot/wt/numbers
-	sed -i -e 's/^16$/c/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^7$/b/' $testroot/wt/numbers
+	sed -i '' -e 's/^16$/c/' $testroot/wt/numbers
 
 	(cd $testroot/wt && got diff > $testroot/numbers.diff)
 
@@ -562,7 +562,7 @@ EOF
 	fi
 
 	# put first hunk back
-	sed -i -e 's/^2$/a/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/a/' $testroot/wt/numbers
 
 	# revert middle hunk
 	printf "n\ny\nn\n" > $testroot/patchscript
@@ -860,7 +860,7 @@ test_revert_patch_one_change() {
 	# Ensure file size is changed. Avoids race condition causing test
 	# failures where 'got revert' does not see changes to revert if
 	# timestamps and size in stat info remain unchanged.
-	sed -i -e 's/^2$/aa/' $testroot/wt/numbers
+	sed -i '' -e 's/^2$/aa/' $testroot/wt/numbers
 
 	# revert change with -p
 	printf "y\n" > $testroot/patchscript
blob - 6be568608fffc628917f8f2684672943768ae46e
blob + 5cba17832df6f6116c7bcae1f7fb3c259c11c230
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
@@ -177,11 +177,11 @@ test_status_shows_local_mods_after_update() {
 		return 1
 	fi
 
-	sed -i 's/2/22/' $testroot/repo/numbers
+	sed -i '' 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	# modify line 7; both changes should merge cleanly
-	sed -i 's/7/77/' $testroot/wt/numbers
+	sed -i '' 's/7/77/' $testroot/wt/numbers
 
 	echo "G  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
@@ -335,12 +335,12 @@ test_status_shows_no_mods_after_complete_merge() {
 		return 1
 	fi
 
-	sed -i 's/2/22/' $testroot/repo/numbers
+	sed -i '' 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	sleep 1
 	# modify line 2 again; no local changes are left after merge
-	sed -i 's/2/22/' $testroot/wt/numbers
+	sed -i '' 's/2/22/' $testroot/wt/numbers
 
 	echo "G  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
@@ -390,11 +390,11 @@ test_status_shows_conflict() {
 		return 1
 	fi
 
-	sed -i 's/2/22/' $testroot/repo/numbers
+	sed -i '' 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified line 2"
 
 	# modify line 2 in a conflicting way
-	sed -i 's/2/77/' $testroot/wt/numbers
+	sed -i '' 's/2/77/' $testroot/wt/numbers
 
 	echo "C  numbers" > $testroot/stdout.expected
 	echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
blob - 6e6e9148cba91c0585e5864abd297b37af5c317a
blob + 2e90851555c6dbe52c187b1f339b87326b87ad22
--- regress/cmdline/tag.sh
+++ regress/cmdline/tag.sh
@@ -137,11 +137,20 @@ test_tag_list() {
 	tag_id=`got ref -r $testroot/repo -l \
 		| grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
 	local tagger_time=`git_show_tagger_time $testroot/repo $tag`
-	d1=`env LC_TIME=C date -u -d "@$tagger_time" +"%a %b %e %X %Y UTC"`
+	
+	local prev_LC_TIME=$LC_TIME
+	export LC_TIME=C
+	d1=`date -u -d "@$tagger_time" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
+
 	tag_id2=`got ref -r $testroot/repo -l \
 		| grep "^refs/tags/$tag2" | tr -d ' ' | cut -d: -f2`
 	local tagger_time2=`git_show_tagger_time $testroot/repo $tag2`
-	d2=`env LC_TIME=C date -u -d "@$tagger_time2" +"%a %b %e %X %Y UTC"`
+	
+	prev_LC_TIME="$LC_TIME"
+	export LC_TIME=C
+	d2=`date -u -d "@$tagger_time2" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
 
 	got tag -r $testroot/repo -l > $testroot/stdout
 
@@ -184,11 +193,17 @@ test_tag_list_lightweight() {
 	tag_id=`got ref -r $testroot/repo -l \
 		| grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
 	local tagger_time=`git_show_author_time $testroot/repo $tag`
-	d1=`env LC_TIME=C date -u -d "@$tagger_time" +"%a %b %e %X %Y UTC"`
+	local prev_LC_TIME=$LC_TIME
+	export LC_TIME=C
+	d1=`date -u -d "@$tagger_time" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
 	tag_id2=`got ref -r $testroot/repo -l \
 		| grep "^refs/tags/$tag2" | tr -d ' ' | cut -d: -f2`
 	local tagger_time2=`git_show_author_time $testroot/repo $tag2`
-	d2=`env LC_TIME=C date -u -d "@$tagger_time2" +"%a %b %e %X %Y UTC"`
+	
+	export LC_TIME=C
+	d2=`date -u -d "@$tagger_time2" +"%a %b %e %X %Y UTC"`
+	LC_TIME="$prev_LC_TIME"
 
 	got tag -r $testroot/repo -l > $testroot/stdout
 
blob - 0437598f42eff21eee8777c77ae1f578a040eaf4
blob + d93ef8c508fbe9bf2bafd25578af7d0c0c1b512b
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
@@ -660,12 +660,12 @@ test_update_merges_file_edits() {
 
 	echo "modified alpha" > $testroot/repo/alpha
 	echo "modified beta" > $testroot/repo/beta
-	sed -i 's/2/22/' $testroot/repo/numbers
+	sed -i '' 's/2/22/' $testroot/repo/numbers
 	git_commit $testroot/repo -m "modified 3 files"
 
 	echo "modified alpha, too" > $testroot/wt/alpha
 	touch $testroot/wt/beta
-	sed -i 's/7/77/' $testroot/wt/numbers
+	sed -i '' 's/7/77/' $testroot/wt/numbers
 
 	echo "C  alpha" > $testroot/stdout.expected
 	echo "U  beta" >> $testroot/stdout.expected