From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] Add tests for the diff.ignoreSubmodules config option
Date: Fri, 06 Aug 2010 01:27:15 +0200 [thread overview]
Message-ID: <4C5B48D3.6020402@web.de> (raw)
In-Reply-To: <4C5B0C13.6020809@web.de>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
Am 05.08.2010 21:08, schrieb Jens Lehmann:
> Am 05.08.2010 18:49, schrieb Junio C Hamano:
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>>> This commit introduces a global config setting to set a default
>>> (porcelain) value for the --ignore-submodules option, keeping the
>>> default at 'none'. It can be overridden by the submodule.*.ignore
>>> setting and by the --ignore-submodules option.
>>> ...
>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>>> ---
>>
>> Nice, at least from a cursory look.
>
> Yup, makes sense to me too.
>
> Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
And here are some test cases for this new option.
t/t4027-diff-submodule.sh | 10 +++++++++-
t/t7508-status.sh | 12 ++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index 1bc6e77..d99814a 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -115,6 +115,9 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'
'
test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.git/config]' '
+ git config diff.ignoreSubmodules all &&
+ git diff HEAD >actual &&
+ ! test -s actual &&
git config submodule.subname.ignore none &&
git config submodule.subname.path sub &&
git diff HEAD >actual &&
@@ -136,10 +139,14 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
sed -e "1,/^@@/d" actual >actual.body &&
expect_from_to >expect.body $subprev $subprev-dirty &&
test_cmp expect.body actual.body &&
- git config --remove-section submodule.subname
+ git config --remove-section submodule.subname &&
+ git config --unset diff.ignoreSubmodules
'
test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.gitmodules]' '
+ git config diff.ignoreSubmodules dirty &&
+ git diff HEAD >actual &&
+ ! test -s actual &&
git config --add -f .gitmodules submodule.subname.ignore none &&
git config --add -f .gitmodules submodule.subname.path sub &&
git diff HEAD >actual &&
@@ -166,6 +173,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
test_cmp expect.body actual.body &&
git config --remove-section submodule.subname &&
git config --remove-section -f .gitmodules submodule.subname &&
+ git config --unset diff.ignoreSubmodules &&
rm .gitmodules
'
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 1aae762..9c14b85 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -849,11 +849,15 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un
'
test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
+ git config diff.ignoreSubmodules dirty &&
+ git status >output &&
+ test_cmp expect output &&
git config --add -f .gitmodules submodule.subname.ignore untracked &&
git config --add -f .gitmodules submodule.subname.path sm &&
git status > output &&
test_cmp expect output &&
- git config -f .gitmodules --remove-section submodule.subname
+ git config -f .gitmodules --remove-section submodule.subname &&
+ git config --unset diff.ignoreSubmodules
'
test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
@@ -873,11 +877,15 @@ test_expect_success '--ignore-submodules=dirty suppresses submodules with untrac
'
test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
+ git config diff.ignoreSubmodules dirty &&
+ git status >output &&
+ ! test -s actual &&
git config --add -f .gitmodules submodule.subname.ignore dirty &&
git config --add -f .gitmodules submodule.subname.path sm &&
git status > output &&
test_cmp expect output &&
- git config -f .gitmodules --remove-section submodule.subname
+ git config -f .gitmodules --remove-section submodule.subname &&
+ git config --unset diff.ignoreSubmodules
'
test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
--
1.7.2.1.54.g6bed1
next prev parent reply other threads:[~2010-08-05 23:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 18:26 [PATCH 0/2] Submodules: Add the new config option "ignore" Jens Lehmann
2010-07-26 18:27 ` [PATCH 1/2] Submodules: Add the new "ignore" config option for diff and status Jens Lehmann
2010-07-26 18:28 ` [PATCH 2/2] Submodules: Use "ignore" settings from .gitmodules too " Jens Lehmann
2010-07-28 21:35 ` Junio C Hamano
2010-08-05 22:37 ` [PATCH v2 0/2] Submodules: Add the new config option "ignore" Jens Lehmann
2010-08-05 22:39 ` [PATCH v2 1/2] Submodules: Add the new "ignore" config option for diff and status Jens Lehmann
2010-08-05 22:40 ` [PATCH v2 2/2] Submodules: Use "ignore" settings from .gitmodules too " Jens Lehmann
2010-08-05 23:27 ` [PATCH v2 0/2] Submodules: Add the new config option "ignore" Junio C Hamano
2010-08-05 23:51 ` Jens Lehmann
2010-08-09 16:57 ` Junio C Hamano
2010-08-05 9:21 ` [PATCH " Johannes Schindelin
2010-08-05 16:49 ` Junio C Hamano
2010-08-05 19:08 ` Jens Lehmann
2010-08-05 23:27 ` Jens Lehmann [this message]
2010-08-09 16:57 ` [PATCH] Add tests for the diff.ignoreSubmodules config option 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=4C5B48D3.6020402@web.de \
--to=jens.lehmann@web.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).