git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* quieting down git-commit (and init-db) in tests
@ 2006-12-28  9:10 Eric Wong
  2006-12-28  9:10 ` [PATCH 1/3] t6024-recursive-merge: quiet down this test Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2006-12-28  9:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

There are more places where the tests have gotten, but I noticed these
the most.  Some non-portable uses of 'export' have been replaced.
I'll try to get to the rest in a day or two, but I'm sleepy and have
more things for git-svn to do.

--
 t/t6024-recursive-merge.sh     |   90 +++++++++++++++++++++-------------------
 t/t9200-git-cvsexportcommit.sh |   10 +++--
 t/test-lib.sh                  |    2 +-
 3 files changed, 54 insertions(+), 48 deletions(-)

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] t6024-recursive-merge: quiet down this test
  2006-12-28  9:10 quieting down git-commit (and init-db) in tests Eric Wong
@ 2006-12-28  9:10 ` Eric Wong
  2006-12-28  9:10   ` [PATCH 2/3] test-lib: quiet down init-db output for tests Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2006-12-28  9:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

We get an extra measure of error checking here as well.
While we're at it, also removed a less portable use of export.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/t6024-recursive-merge.sh |   90 +++++++++++++++++++++++---------------------
 1 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh
index 69b18f7..31b9625 100644
--- a/t/t6024-recursive-merge.sh
+++ b/t/t6024-recursive-merge.sh
@@ -11,50 +11,54 @@ test_description='Test merge without common ancestors'
 #       X   \
 # 2 - C - E - G
 
-export GIT_COMMITTER_DATE="2006-12-12 23:28:00 +0100"
-echo 1 > a1
-git add a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1
-
-git checkout -b A master
-echo A > a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1
-
-git checkout -b B master
-echo B > a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1
-
-git checkout -b D A
-git-rev-parse B > .git/MERGE_HEAD
-echo D > a1
-git update-index a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:03" git commit -m D
-
-git symbolic-ref HEAD refs/heads/other
-echo 2 > a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:04" git commit -m 2 a1
-
-git checkout -b C
-echo C > a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:05" git commit -m C a1
-
-git checkout -b E C
-git-rev-parse B > .git/MERGE_HEAD
-echo E > a1
-git update-index a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:06" git commit -m E
-
-git checkout -b G E
-git-rev-parse A > .git/MERGE_HEAD
-echo G > a1
-git update-index a1
-GIT_AUTHOR_DATE="2006-12-12 23:00:07" git commit -m G
-
-git checkout -b F D
-git-rev-parse C > .git/MERGE_HEAD
-echo F > a1
-git update-index a1
+GIT_COMMITTER_DATE="2006-12-12 23:28:00 +0100"
+export GIT_COMMITTER_DATE
+
+test_expect_success "setup tests" '
+echo 1 > a1 &&
+git add a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
+
+git checkout -b A master &&
+echo A > a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
+
+git checkout -b B master &&
+echo B > a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
+
+git checkout -b D A &&
+git-rev-parse B > .git/MERGE_HEAD &&
+echo D > a1 &&
+git update-index a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:03" git commit -m D &&
+
+git symbolic-ref HEAD refs/heads/other &&
+echo 2 > a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:04" git commit -m 2 a1 &&
+
+git checkout -b C &&
+echo C > a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:05" git commit -m C a1 &&
+
+git checkout -b E C &&
+git-rev-parse B > .git/MERGE_HEAD &&
+echo E > a1 &&
+git update-index a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:06" git commit -m E &&
+
+git checkout -b G E &&
+git-rev-parse A > .git/MERGE_HEAD &&
+echo G > a1 &&
+git update-index a1 &&
+GIT_AUTHOR_DATE="2006-12-12 23:00:07" git commit -m G &&
+
+git checkout -b F D &&
+git-rev-parse C > .git/MERGE_HEAD &&
+echo F > a1 &&
+git update-index a1 &&
 GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F
+'
 
 test_expect_failure "combined merge conflicts" "git merge -m final G"
 
-- 
1.4.4.3.gd4ada

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] test-lib: quiet down init-db output for tests
  2006-12-28  9:10 ` [PATCH 1/3] t6024-recursive-merge: quiet down this test Eric Wong
@ 2006-12-28  9:10   ` Eric Wong
  2006-12-28  9:10     ` [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2006-12-28  9:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

I don't think anybody running tests needs to know they're
running init-db and creating a repository for testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index f0f9cd6..ad2b6f6 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -176,7 +176,7 @@ test_create_repo () {
 	repo="$1"
 	mkdir "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	"$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ 2>/dev/null ||
+	"$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
 	error "cannot run git init-db -- have you built things yet?"
 	mv .git/hooks .git/hooks-disabled
 	cd "$owd"
-- 
1.4.4.3.gd4ada

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit
  2006-12-28  9:10   ` [PATCH 2/3] test-lib: quiet down init-db output for tests Eric Wong
@ 2006-12-28  9:10     ` Eric Wong
  2006-12-28  9:24       ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2006-12-28  9:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Eric Wong

Also, fixed an unportable use of 'export'.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/t9200-git-cvsexportcommit.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index ca0513b..315119a 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -14,16 +14,18 @@ then
     exit
 fi
 
-export CVSROOT=$(pwd)/cvsroot
-export CVSWORK=$(pwd)/cvswork
+CVSROOT=$(pwd)/cvsroot
+CVSWORK=$(pwd)/cvswork
+GIT_DIR=$(pwd)/.git
+export CVSROOT CVSWORK GIT_DIR
+
 rm -rf "$CVSROOT" "$CVSWORK"
 mkdir "$CVSROOT" &&
 cvs init &&
 cvs -Q co -d "$CVSWORK" . &&
-export GIT_DIR=$(pwd)/.git &&
 echo >empty &&
 git add empty &&
-git commit -a -m "Initial" 2>/dev/null ||
+git commit -q -a -m "Initial" 2>/dev/null ||
 exit 1
 
 test_expect_success \
-- 
1.4.4.3.gd4ada

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit
  2006-12-28  9:10     ` [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit Eric Wong
@ 2006-12-28  9:24       ` Junio C Hamano
  2006-12-28 18:14         ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2006-12-28  9:24 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

Eric Wong <normalperson@yhbt.net> writes:

> Also, fixed an unportable use of 'export'.

As a traditionalist, I tend to prefer "var=val; export var" over
"export var=val" myself, but I wonder how unportable this is
these days.

Just wondering, no objection.

Do you have a specific shell in mind that groks other constructs
used in our tests but not "export var=val" form?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit
  2006-12-28  9:24       ` Junio C Hamano
@ 2006-12-28 18:14         ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2006-12-28 18:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Also, fixed an unportable use of 'export'.
> 
> As a traditionalist, I tend to prefer "var=val; export var" over
> "export var=val" myself, but I wonder how unportable this is
> these days.
> 
> Just wondering, no objection.
> 
> Do you have a specific shell in mind that groks other constructs
> used in our tests but not "export var=val" form?

I can't remember, and I can't seem to find one, either.  Even posh
(latest debian unstable) and ash (from woody) seem to support it...

On a related note, how portable is mkdir -p these days?  I remember
seeing systems that don't have it, too.

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-12-28 18:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-28  9:10 quieting down git-commit (and init-db) in tests Eric Wong
2006-12-28  9:10 ` [PATCH 1/3] t6024-recursive-merge: quiet down this test Eric Wong
2006-12-28  9:10   ` [PATCH 2/3] test-lib: quiet down init-db output for tests Eric Wong
2006-12-28  9:10     ` [PATCH 3/3] t9200-git-cvsexportcommit.sh: quiet down commit Eric Wong
2006-12-28  9:24       ` Junio C Hamano
2006-12-28 18:14         ` Eric Wong

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).