git config tests for "'git config ignores pairs ..."
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 2 repliesIn review
- v23 patches 4 repliesSuperseded
- v12 patches 1 replySuperseded
Changes in v3 from the cover letter
- Patch 3 updates:
- Added missing word "are" in commit message
- Added signoff
- Wrapped $1 and $2 in double quotes for consistency with git grep -P 'local .*="?[$][1-9]"? &&$' -- t
- Added &&-chainging to function "test_missing_key"
- Fixed quoting so that substitution of $key happens inside eval
- Added tests about config subsections
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | t1300: drop duplicate testt/ | +0 | 0 replies | |
| 2/3 | t1300: check stderr for "ignores pairs" testst/ | +5 | 0 replies | |
| 3/3 | t1300: add tests for missing keyst/ | +17 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/3] git config tests for "'git config ignores pairs ..."
Clean up existing tests and add new tests in t1300-config.sh.
v1 cover letter:
https://lore.kernel.org/git/[email protected]/
v2 cover letter:
https://lore.kernel.org/git/[email protected]/
Changes since v2:
- Patch 3 updates:
- Added missing word "are" in commit message
- Added signoff
- Wrapped $1 and $2 in double quotes for consistency with git grep -P 'local .*="?[$][1-9]"? &&$' -- t
- Added &&-chainging to function "test_missing_key"
- Fixed quoting so that substitution of $key happens inside eval
- Added tests about config subsections
Changes since v1:
- Rewritten commit message for patch 2.
- New RFC patch 3.
Andrei Rybak (3):
t1300: drop duplicate test
t1300: check stderr for "ignores pairs" tests
t1300: add tests for missing keys
t/t1300-config.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-)
Range diff against v2:
1: cf812f4fa8 = 1: cf812f4fa8 t1300: drop duplicate test 2: b4132adea8 = 2: b4132adea8 t1300: check stderr for "ignores pairs" tests 3: 6126f42449 ! 3: ba536bf855 t1300: add tests for missing keys
@@ Metadata
## Commit message ##
t1300: add tests for missing keys
- There several tests in t1300-config.sh that validate failing invocations
- of "git config". However, there are no tests that check what happens
- when "git config" is asked to retrieve a value for a missing key.
+ There are several tests in t1300-config.sh that validate failing
+ invocations of "git config". However, there are no tests that check
+ what happens when "git config" is asked to retrieve a value for a
+ missing key.
- Add tests that check this for various combinations of "<section>.<key>".
+ Add tests that check this for various combinations of "<section>.<key>"
+ and "<section>.<subsection>.<key>".
+
+ Signed-off-by: Andrei Rybak <[email protected]>
## t/t1300-config.sh ##
@@ t/t1300-config.sh: test_expect_success 'subsections are not canonicalized by git-config' '
@@ t/t1300-config.sh: test_expect_success 'subsections are not canonicalized by git
'
+test_missing_key () {
-+ local key=$1
-+ local title=$2
-+ test_expect_success "value for $title is not printed" "
-+ test_must_fail git config $key >out 2>err &&
++ local key="$1" &&
++ local title="$2" &&
++ test_expect_success "value for $title is not printed" '
++ test_must_fail git config "$key" >out 2>err &&
+ test_must_be_empty out &&
+ test_must_be_empty err
-+ "
++ '
+}
+
+test_missing_key 'missingsection.missingkey' 'missing section and missing key' +test_missing_key 'missingsection.penguin' 'missing section and existing key' +test_missing_key 'section.missingkey' 'existing section and missing key'
++test_missing_key 'section.MissingSubSection.missingkey' 'missing subsection and missing key' ++test_missing_key 'section.SubSection.missingkey' 'existing subsection and missing key' ++test_missing_key 'section.MissingSubSection.key' 'missing subsection and existing key'
+
cat > .git/config <<\EOF
[alpha]
Signature · 1 line
2.40.0