git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Hansen <rhansen@bbn.com>
To: git@vger.kernel.org
Cc: felipe.contreras@gmail.com, Richard Hansen <rhansen@bbn.com>
Subject: [PATCH v2 0/9] remote-hg, remote-bzr fixes
Date: Tue, 12 Nov 2013 00:54:39 -0500	[thread overview]
Message-ID: <1384235688-9655-1-git-send-email-rhansen@bbn.com> (raw)
In-Reply-To: <1384142712-2936-1-git-send-email-rhansen@bbn.com>

A handful of fixes for the git-remote-hg and git-remote-bzr remote
helpers and their unit tests.

Changes from v1:

diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index ea597b0..1e53ff9 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -5,8 +5,8 @@
 
 test_description='Test remote-bzr'
 
-cd "${0%/*}"/../../t || exit 1
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then
@@ -28,9 +28,6 @@ check () {
 
 bzr whoami "A U Thor <author@example.com>"
 
-# silence warnings
-git config --global push.default simple
-
 test_expect_success 'cloning' '
 	(
 	bzr init bzrrepo &&
@@ -382,7 +379,7 @@ test_expect_success 'export utf-8 authors' '
 	git add content &&
 	git commit -m one &&
 	git remote add bzr "bzr::../bzrrepo" &&
-	git push -u bzr master
+	git push bzr master
 	) &&
 
 	(
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index 9f5066b..347e812 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -8,8 +8,8 @@
 
 test_description='Test remote-hg'
 
-cd "${0%/*}"/../../t || exit 1
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then
@@ -102,9 +102,6 @@ setup () {
 	GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0230" &&
 	GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" &&
 	export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
-
-	# silence warnings
-	git config --global push.default simple
 }
 
 setup
@@ -210,16 +207,16 @@ test_expect_success 'authors' '
 	>../expected &&
 	author_test alpha "" "H G Wells <wells@example.com>" &&
 	author_test beta "beta" "beta <unknown>" &&
-	author_test beta "beta <test@example.com> (comment)" "beta <test@example.com>" &&
-	author_test gamma "<gamma@example.com>" "Unknown <gamma@example.com>" &&
-	author_test delta "delta<test@example.com>" "delta <test@example.com>" &&
-	author_test epsilon "epsilon <test@example.com" "epsilon <test@example.com>" &&
-	author_test zeta " zeta " "zeta <unknown>" &&
-	author_test eta "eta < test@example.com >" "eta <test@example.com>" &&
-	author_test theta "theta >test@example.com>" "theta <test@example.com>" &&
-	author_test iota "iota < test <at> example <dot> com>" "iota <unknown>" &&
-	author_test kappa "kappa@example.com" "Unknown <kappa@example.com>" &&
-	author_test lambda "lambda.lambda@example.com" "Unknown <lambda.lambda@example.com>"
+	author_test gamma "gamma <test@example.com> (comment)" "gamma <test@example.com>" &&
+	author_test delta "<delta@example.com>" "Unknown <delta@example.com>" &&
+	author_test epsilon "epsilon<test@example.com>" "epsilon <test@example.com>" &&
+	author_test zeta "zeta <test@example.com" "zeta <test@example.com>" &&
+	author_test eta " eta " "eta <unknown>" &&
+	author_test theta "theta < test@example.com >" "theta <test@example.com>" &&
+	author_test iota "iota >test@example.com>" "iota <test@example.com>" &&
+	author_test kappa "kappa < test <at> example <dot> com>" "kappa <unknown>" &&
+	author_test lambda "lambda@example.com" "Unknown <lambda@example.com>" &&
+	author_test mu "mu.mu@example.com" "Unknown <mu.mu@example.com>"
 	) &&
 
 	git clone "hg::hgrepo" gitrepo &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b25249e..af172d9 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -26,6 +26,10 @@ then
 	# outside of t/, e.g. for running tests on the test library
 	# itself.
 	TEST_DIRECTORY=$(pwd)
+else
+	# ensure that TEST_DIRECTORY is an absolute path so that it
+	# works even if the current working directory is changed
+	TEST_DIRECTORY=$(cd "$TEST_DIRECTORY" && pwd) || exit 1
 fi
 if test -z "$TEST_OUTPUT_DIRECTORY"
 then

Richard Hansen (9):
  remote-hg:  don't decode UTF-8 paths into Unicode objects
  test-lib.sh: convert $TEST_DIRECTORY to an absolute path
  test-bzr.sh, test-hg.sh: allow running from any dir
  test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
  test-hg.sh: eliminate 'local' bashism
  test-hg.sh: avoid obsolete 'test' syntax
  test-hg.sh: fix duplicate content strings in author tests
  test-hg.sh: help user correlate verbose output with email test
  remote-bzr, remote-hg: fix email address regular expression

 contrib/remote-helpers/git-remote-bzr |  7 +++----
 contrib/remote-helpers/git-remote-hg  |  9 ++++-----
 contrib/remote-helpers/test-bzr.sh    |  5 +++--
 contrib/remote-helpers/test-hg.sh     | 30 ++++++++++++++++--------------
 t/test-lib.sh                         |  4 ++++
 5 files changed, 30 insertions(+), 25 deletions(-)

-- 
1.8.5.rc1.208.g8ff7964

  parent reply	other threads:[~2013-11-12  5:55 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  4:05 [PATCH 0/7] remote-hg, remote-bzr fixes Richard Hansen
2013-11-11  4:05 ` [PATCH 1/7] remote-hg: don't decode UTF-8 paths into Unicode objects Richard Hansen
2013-11-11 11:04   ` Felipe Contreras
2013-11-11 18:30     ` Richard Hansen
2013-11-11 19:10       ` Felipe Contreras
2013-11-11  4:05 ` [PATCH 2/7] test-bzr.sh, test-hg.sh: allow running from any dir Richard Hansen
2013-11-11 11:35   ` Felipe Contreras
2013-11-11 18:31     ` Junio C Hamano
2013-11-11 18:58       ` Felipe Contreras
2013-11-11  4:05 ` [PATCH 3/7] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple Richard Hansen
2013-11-11 11:37   ` Felipe Contreras
2013-11-11 19:20     ` Richard Hansen
2013-11-11 19:31   ` Felipe Contreras
2013-11-11 21:16     ` Richard Hansen
2013-11-11 21:19       ` Felipe Contreras
2013-11-11  4:05 ` [PATCH 4/7] test-hg.sh: eliminate 'local' bashism Richard Hansen
2013-11-11 11:40   ` Felipe Contreras
2013-11-11  4:05 ` [PATCH 5/7] test-hg.sh: avoid obsolete 'test' syntax Richard Hansen
2013-11-11 11:44   ` Felipe Contreras
2013-11-12  5:34     ` Richard Hansen
2013-11-12 20:23       ` Felipe Contreras
2013-11-11  4:05 ` [PATCH 6/7] test-hg.sh: help user correlate verbose output with email test Richard Hansen
2013-11-11 11:42   ` Felipe Contreras
2013-11-11 19:19     ` Richard Hansen
2013-11-11 19:29       ` Felipe Contreras
2013-11-11 21:17         ` Richard Hansen
2013-11-11  4:05 ` [PATCH 7/7] remote-bzr, remote-hg: fix email address regular expression Richard Hansen
2013-11-11 11:43   ` Felipe Contreras
2013-11-11 18:35 ` [PATCH 0/7] remote-hg, remote-bzr fixes Junio C Hamano
2013-11-12  5:54 ` Richard Hansen [this message]
2013-11-12  5:54   ` [PATCH v2 1/9] remote-hg: don't decode UTF-8 paths into Unicode objects Richard Hansen
2013-11-12  5:54   ` [PATCH v2 2/9] test-lib.sh: convert $TEST_DIRECTORY to an absolute path Richard Hansen
2013-11-12  6:05     ` Richard Hansen
2013-11-12 20:06       ` Junio C Hamano
2013-11-12 20:25       ` Felipe Contreras
2013-11-12  5:54   ` [PATCH v2 3/9] test-bzr.sh, test-hg.sh: allow running from any dir Richard Hansen
2013-11-12  5:54   ` [PATCH v2 4/9] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple Richard Hansen
2013-11-12  5:54   ` [PATCH v2 5/9] test-hg.sh: eliminate 'local' bashism Richard Hansen
2013-11-12  5:54   ` [PATCH v2 6/9] test-hg.sh: avoid obsolete 'test' syntax Richard Hansen
2013-11-12  5:54   ` [PATCH v2 7/9] test-hg.sh: fix duplicate content strings in author tests Richard Hansen
2013-11-12  5:54   ` [PATCH v2 8/9] test-hg.sh: help user correlate verbose output with email test Richard Hansen
2013-11-12  5:54   ` [PATCH v2 9/9] remote-bzr, remote-hg: fix email address regular expression Richard Hansen
2013-11-12 17:59   ` [PATCH v2 0/9] remote-hg, remote-bzr fixes Junio C Hamano
2013-11-12 20:27   ` Felipe Contreras
2013-11-18  4:12   ` [PATCH v3 " Richard Hansen
2013-11-18  4:12     ` [PATCH v3 1/9] remote-hg: don't decode UTF-8 paths into Unicode objects Richard Hansen
2013-11-18  4:12     ` [PATCH v3 2/9] test-lib.sh: convert $TEST_DIRECTORY to an absolute path Richard Hansen
2013-11-18  4:12     ` [PATCH v3 3/9] test-bzr.sh, test-hg.sh: allow running from any dir Richard Hansen
2013-11-18  4:12     ` [PATCH v3 4/9] test-bzr.sh, test-hg.sh: prepare for change to push.default=simple Richard Hansen
2013-11-18  4:12     ` [PATCH v3 5/9] test-hg.sh: eliminate 'local' bashism Richard Hansen
2013-11-18  4:12     ` [PATCH v3 6/9] test-hg.sh: avoid obsolete 'test' syntax Richard Hansen
2013-11-18  4:12     ` [PATCH v3 7/9] test-hg.sh: fix duplicate content strings in author tests Richard Hansen
2013-11-18  4:12     ` [PATCH v3 8/9] test-hg.sh: help user correlate verbose output with email test Richard Hansen
2013-11-18  4:12     ` [PATCH v3 9/9] remote-bzr, remote-hg: fix email address regular expression Richard Hansen
2013-11-18 16:13     ` [PATCH v3 0/9] remote-hg, remote-bzr fixes Junio C Hamano
2013-11-18 21:47     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384235688-9655-1-git-send-email-rhansen@bbn.com \
    --to=rhansen@bbn.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).