From 1ca5f6bfaeb067b3ee4817783515be575e01285a Mon Sep 17 00:00:00 2001 From: Jan Mazur Date: Tue, 23 Mar 2021 02:22:56 -0700 Subject: [PATCH] quiet git init command not to print out hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Git client was updated and it started outputting a hint that breaks our tests. It has no meaning in tests so just quiet it. ``` ➜ fbcode git init hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m Initialized empty Git repository in /data/users/mzr/fbsource/fbcode/.git/ ``` Reviewed By: StanislavGlebik Differential Revision: D27232853 fbshipit-source-id: 683ebebb36049adb758e7c26f843f12159a45301 --- .../tests/integration/test-gitimport-octopus.t | 3 +-- eden/scm/tests/test-convert-git.t | 14 +++++--------- eden/scm/tests/test-fb-hgext-scm-prompt-git.t | 3 +-- eden/scm/tests/test-hggit-clone.t | 6 ++---- eden/scm/tests/test-hggit-conflict-1.t | 3 +-- eden/scm/tests/test-hggit-conflict-2.t | 3 +-- eden/scm/tests/test-hggit-convergedmerge.t | 3 +-- eden/scm/tests/test-hggit-empty-working-tree.t | 6 ++---- eden/scm/tests/test-hggit-encoding.t | 6 ++---- eden/scm/tests/test-hggit-external-sync.t | 3 +-- eden/scm/tests/test-hggit-file-removal.t | 6 ++---- eden/scm/tests/test-hggit-git-clone.t | 3 +-- eden/scm/tests/test-hggit-hg-author.t | 3 +-- eden/scm/tests/test-hggit-incoming.t | 3 +-- eden/scm/tests/test-hggit-keywords.t | 3 +-- eden/scm/tests/test-hggit-merge.t | 6 ++---- eden/scm/tests/test-hggit-octopus.t | 6 ++---- eden/scm/tests/test-hggit-outgoing.t | 3 +-- eden/scm/tests/test-hggit-pull-after-strip.t | 3 +-- eden/scm/tests/test-hggit-push.t | 3 +-- eden/scm/tests/test-hggit-tree-decomposition.t | 6 ++---- eden/scm/tests/test-hggit-verify-fail.t | 3 +-- eden/scm/tests/test-hgsql-hggit.t | 3 +-- 23 files changed, 34 insertions(+), 67 deletions(-) diff --git a/eden/mononoke/tests/integration/test-gitimport-octopus.t b/eden/mononoke/tests/integration/test-gitimport-octopus.t index 9ea100cb68..0f3375816b 100644 --- a/eden/mononoke/tests/integration/test-gitimport-octopus.t +++ b/eden/mononoke/tests/integration/test-gitimport-octopus.t @@ -12,8 +12,7 @@ # Setup git repsitory $ mkdir "$GIT_REPO" $ cd "$GIT_REPO" - $ git init - Initialized empty Git repository in $TESTTMP/repo-git/.git/ + $ git init -q $ git commit --allow-empty -m "root commit" [master (root-commit) d53a2ef] root commit $ git branch root diff --git a/eden/scm/tests/test-convert-git.t b/eden/scm/tests/test-convert-git.t index d5b812f797..3807bed1e0 100644 --- a/eden/scm/tests/test-convert-git.t +++ b/eden/scm/tests/test-convert-git.t @@ -617,8 +617,7 @@ test converting certain branches $ mkdir git-testrevs $ cd git-testrevs - $ git init - Initialized empty Git repository in $TESTTMP/git-testrevs/.git/ + $ git init -q $ echo a >> a ; git add a > /dev/null; git commit -m 'first' > /dev/null $ echo a >> a ; git add a > /dev/null; git commit -m 'master commit' > /dev/null $ git checkout -b goodbranch 'HEAD^' @@ -808,8 +807,7 @@ skip submodules in the conversion .gitmodules-renamed convert using a different remote prefix - $ git init git-repo7 - Initialized empty Git repository in $TESTTMP/git-repo7/.git/ + $ git init -q git-repo7 $ cd git-repo7 TODO: it'd be nice to use (?) lines instead of grep -v to handle the git output variance, but that doesn't currently work in the middle of @@ -883,8 +881,7 @@ damage git repository by renaming a tree object test for escaping the repo name (CVE-2016-3069) - $ git init '`echo pwned >COMMAND-INJECTION`' - Initialized empty Git repository in $TESTTMP/`echo pwned >COMMAND-INJECTION`/.git/ + $ git init -q '`echo pwned >COMMAND-INJECTION`' $ cd '`echo pwned >COMMAND-INJECTION`' $ git commit -q --allow-empty -m 'empty' $ cd .. @@ -900,8 +897,7 @@ test for escaping the repo name (CVE-2016-3069) test for safely passing paths to git (CVE-2016-3105) - $ git init 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' - Initialized empty Git repository in $TESTTMP/ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #/.git/ + $ git init -q 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' $ cd 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' $ git commit -q --allow-empty -m 'empty' $ cd .. @@ -919,7 +915,7 @@ test for safely passing paths to git (CVE-2016-3105) Conversion of extra commit metadata to extras works - $ git init gitextras >/dev/null 2>/dev/null + $ git init -q gitextras >/dev/null 2>/dev/null $ cd gitextras $ touch foo $ git add foo diff --git a/eden/scm/tests/test-fb-hgext-scm-prompt-git.t b/eden/scm/tests/test-fb-hgext-scm-prompt-git.t index 6f947c1e60..f746b14b17 100644 --- a/eden/scm/tests/test-fb-hgext-scm-prompt-git.t +++ b/eden/scm/tests/test-fb-hgext-scm-prompt-git.t @@ -35,8 +35,7 @@ Outside of a repo, should have no output $ _scm_prompt Set up repo - $ git init repo - Initialized empty Git repository in $TESTTMP/repo/.git/ + $ git init -q repo $ cd repo $ _scm_prompt "%s\n" master diff --git a/eden/scm/tests/test-hggit-clone.t b/eden/scm/tests/test-hggit-clone.t index f13ee7385d..657c1c9199 100644 --- a/eden/scm/tests/test-hggit-clone.t +++ b/eden/scm/tests/test-hggit-clone.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha @@ -69,8 +68,7 @@ Make sure that a deleted .hgsubstate does not confuse hg-git $ hg --cwd hgrepo-c status clone empty repo - $ git init empty - Initialized empty Git repository in $TESTTMP/empty/.git/ + $ git init -q empty $ hg clone empty emptyhg updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/eden/scm/tests/test-hggit-conflict-1.t b/eden/scm/tests/test-hggit-conflict-1.t index fdbd2dcda0..480d32ce7a 100644 --- a/eden/scm/tests/test-hggit-conflict-1.t +++ b/eden/scm/tests/test-hggit-conflict-1.t @@ -42,8 +42,7 @@ resolve using first parent $ cd .. - $ git init --bare gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/ + $ git init -q --bare gitrepo $ cd hgrepo1 $ hg bookmark -r tip master diff --git a/eden/scm/tests/test-hggit-conflict-2.t b/eden/scm/tests/test-hggit-conflict-2.t index fcb447cae4..6d75eeccae 100644 --- a/eden/scm/tests/test-hggit-conflict-2.t +++ b/eden/scm/tests/test-hggit-conflict-2.t @@ -42,8 +42,7 @@ resolve using second parent $ cd .. - $ git init --bare gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/ + $ git init -q --bare gitrepo $ cd hgrepo1 $ hg bookmark -r tip master diff --git a/eden/scm/tests/test-hggit-convergedmerge.t b/eden/scm/tests/test-hggit-convergedmerge.t index 7dfa32a833..f0e4f064dd 100644 --- a/eden/scm/tests/test-hggit-convergedmerge.t +++ b/eden/scm/tests/test-hggit-convergedmerge.t @@ -42,8 +42,7 @@ Load commonly used test logic $ cd .. - $ git init --bare gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/ + $ git init -q --bare gitrepo $ cd hgrepo1 $ hg bookmark -r'desc(merge)' master diff --git a/eden/scm/tests/test-hggit-empty-working-tree.t b/eden/scm/tests/test-hggit-empty-working-tree.t index 72bc9ae48d..442ad958f7 100644 --- a/eden/scm/tests/test-hggit-empty-working-tree.t +++ b/eden/scm/tests/test-hggit-empty-working-tree.t @@ -1,15 +1,13 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ git commit --allow-empty -m empty [master (root-commit) 6782568] empty $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-encoding.t b/eden/scm/tests/test-hggit-encoding.t index a7a4d38aa9..a98c7caf7c 100644 --- a/eden/scm/tests/test-hggit-encoding.t +++ b/eden/scm/tests/test-hggit-encoding.t @@ -4,8 +4,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo utf-8 encoded commit message @@ -24,8 +23,7 @@ The warning message changed in Git 1.8.0 variable i18n.commitencoding to the encoding your project uses. $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-external-sync.t b/eden/scm/tests/test-hggit-external-sync.t index 9c9cc1663d..49490f817c 100644 --- a/eden/scm/tests/test-hggit-external-sync.t +++ b/eden/scm/tests/test-hggit-external-sync.t @@ -5,8 +5,7 @@ Load commonly used test logic # Set up the git repo $ cd "$TESTTMP" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo commit1 > commit1 $ git add . diff --git a/eden/scm/tests/test-hggit-file-removal.t b/eden/scm/tests/test-hggit-file-removal.t index 0f55b30beb..093cb44c2f 100644 --- a/eden/scm/tests/test-hggit-file-removal.t +++ b/eden/scm/tests/test-hggit-file-removal.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha @@ -95,8 +94,7 @@ final manifest in git is just beta add alpha $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-git-clone.t b/eden/scm/tests/test-hggit-git-clone.t index eeee4ce58a..5cf3d60efb 100644 --- a/eden/scm/tests/test-hggit-git-clone.t +++ b/eden/scm/tests/test-hggit-git-clone.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-hg-author.t b/eden/scm/tests/test-hggit-hg-author.t index 61d559e6f7..340b2dd40d 100644 --- a/eden/scm/tests/test-hggit-hg-author.t +++ b/eden/scm/tests/test-hggit-hg-author.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-incoming.t b/eden/scm/tests/test-hggit-incoming.t index 2ce962bc03..601b0e4dea 100644 --- a/eden/scm/tests/test-hggit-incoming.t +++ b/eden/scm/tests/test-hggit-incoming.t @@ -2,8 +2,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" $ disable treemanifest - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-keywords.t b/eden/scm/tests/test-hggit-keywords.t index 1a2712900c..ecbd6246c0 100644 --- a/eden/scm/tests/test-hggit-keywords.t +++ b/eden/scm/tests/test-hggit-keywords.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-merge.t b/eden/scm/tests/test-hggit-merge.t index ed1c64c3a1..4a462446b1 100644 --- a/eden/scm/tests/test-hggit-merge.t +++ b/eden/scm/tests/test-hggit-merge.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha @@ -28,8 +27,7 @@ clean merge create mode 100644 beta $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-octopus.t b/eden/scm/tests/test-hggit-octopus.t index c21a0b5a22..330f4f330c 100644 --- a/eden/scm/tests/test-hggit-octopus.t +++ b/eden/scm/tests/test-hggit-octopus.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha @@ -59,8 +58,7 @@ Load commonly used test logic create mode 100644 zeta $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-outgoing.t b/eden/scm/tests/test-hggit-outgoing.t index 7451a008e2..bdee33e927 100644 --- a/eden/scm/tests/test-hggit-outgoing.t +++ b/eden/scm/tests/test-hggit-outgoing.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-pull-after-strip.t b/eden/scm/tests/test-hggit-pull-after-strip.t index f7dbd45732..085aa68715 100644 --- a/eden/scm/tests/test-hggit-pull-after-strip.t +++ b/eden/scm/tests/test-hggit-pull-after-strip.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-push.t b/eden/scm/tests/test-hggit-push.t index b9ccd7b3c7..4f0fb091df 100644 --- a/eden/scm/tests/test-hggit-push.t +++ b/eden/scm/tests/test-hggit-push.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo alpha > alpha $ git add alpha diff --git a/eden/scm/tests/test-hggit-tree-decomposition.t b/eden/scm/tests/test-hggit-tree-decomposition.t index 49f28161fb..bc10e74cb4 100644 --- a/eden/scm/tests/test-hggit-tree-decomposition.t +++ b/eden/scm/tests/test-hggit-tree-decomposition.t @@ -1,8 +1,7 @@ Load commonly used test logic $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ mkdir d1 $ echo a > d1/f1 @@ -21,8 +20,7 @@ Load commonly used test logic $ cd .. - $ git init --bare gitrepo2 - Initialized empty Git repository in $TESTTMP/gitrepo2/ + $ git init -q --bare gitrepo2 $ hg clone gitrepo hgrepo | grep -v '^updating' importing git objects into hg diff --git a/eden/scm/tests/test-hggit-verify-fail.t b/eden/scm/tests/test-hggit-verify-fail.t index 098dab9932..85bfe3eab6 100644 --- a/eden/scm/tests/test-hggit-verify-fail.t +++ b/eden/scm/tests/test-hggit-verify-fail.t @@ -3,8 +3,7 @@ inconsistencies. Since hg-git is ostensibly correct, we artificially create inconsistencies by placing different Mercurial and Git repos in the right spots. $ . "$TESTDIR/hggit/testutil" - $ git init gitrepo - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ + $ git init -q gitrepo $ cd gitrepo $ echo normalf > normalf $ echo missingf > missingf diff --git a/eden/scm/tests/test-hgsql-hggit.t b/eden/scm/tests/test-hgsql-hggit.t index f901f07079..105b1b3eba 100644 --- a/eden/scm/tests/test-hgsql-hggit.t +++ b/eden/scm/tests/test-hgsql-hggit.t @@ -4,8 +4,7 @@ $ shorttraceback $ enable lz4revlog - $ git init a-git - Initialized empty Git repository in $TESTTMP/a-git/.git/ + $ git init -q a-git $ cd a-git Make "a" compressable