git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 09/16] tag: add more incompatibles mode tests

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 23, 2017, 20:37 UTC
Message-ID
<CACBZZX5wFaSdeXGxGNMK4j_OoEJ_Zt08vAYRosSwnJVs9K+Lng@mail.gmail.com>
In-Reply-To
<xmqqtw6jex0o.fsf@gitster.mtv.corp.google.com>
On Thu, Mar 23, 2017 at 6:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Amend the test suite to test for more invalid uses like "-l -a"
>> etc. This change tests this code path in builtin/tag.c:
>>
>>     `(argc == 0 && !cmdmode)`
>>     ->
>>     `((create_tag_object || force) && (cmdmode != 0))`
>
> What is this notation trying to tell us?  A range of lines starting
> with the first one to the second one?
Yeah.
Show 6 quoted lines
> If so perhaps
>
>         Add tests to detect more invalid combinations like "-a -l",
>         to test code that defaults to the list mode when no other
>         conflicting options are given and that detects conflicting
>         requests.

I think the only people who'll ever dig up this commit is someone trying to figure out why one of these invocations dies after 'git blame'-ing this code. Surely it'll be more useful to them to see what specific code this was aiming to test, rather than having more vague prose like that...

Show 36 quoted lines
> would be easier to understand, I would think.
>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>>  t/t7004-tag.sh | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
>> index 63ee2cf727..92af8bb7e6 100755
>> --- a/t/t7004-tag.sh
>> +++ b/t/t7004-tag.sh
>> @@ -1455,8 +1455,24 @@ test_expect_success 'checking that initial commit is in all tags' "
>>
>>  test_expect_success 'mixing incompatibles modes and options is forbidden' '
>>       test_must_fail git tag -a &&
>> +     test_must_fail git tag -a -l &&
>> +     test_must_fail git tag -s &&
>> +     test_must_fail git tag -s -l &&
>> +     test_must_fail git tag -m &&
>> +     test_must_fail git tag -m -l &&
>> +     test_must_fail git tag -m "hlagh" &&
>> +     test_must_fail git tag -m "hlagh" -l &&
>> +     test_must_fail git tag -F &&
>> +     test_must_fail git tag -F -l &&
>> +     test_must_fail git tag -f &&
>> +     test_must_fail git tag -f -l &&
>> +     test_must_fail git tag -a -s -m -F &&
>> +     test_must_fail git tag -a -s -m -F -l &&
>>       test_must_fail git tag -l -v &&
>> +     test_must_fail git tag -l -d &&
>> +     test_must_fail git tag -l -v -d &&
>>       test_must_fail git tag -n 100 &&
>> +     test_must_fail git tag -n 100 -v &&
>>       test_must_fail git tag -l -m msg &&
>>       test_must_fail git tag -l -F some file &&
>>       test_must_fail git tag -v -s &&
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 25 in “Various changes to the "tag" command & related”
  1. 00/16 Various changes to the "tag" command & relatedÆvar Arnfjörð Bjarmason, Mar 23, 2017
  2. 01/16 tag doc: move the description of --[no-]merged earlierÆvar Arnfjörð Bjarmason, Mar 23, 2017
  3. 02/16 tag doc: split up the --[no-]merged documentationÆvar Arnfjörð Bjarmason, Mar 23, 2017
  4. 03/16 tag doc: reword --[no-]merged to talk about commits, not tipsÆvar Arnfjörð Bjarmason, Mar 23, 2017
  5. 04/16 ref-filter: make combining --merged & --no-merged an errorÆvar Arnfjörð Bjarmason, Mar 23, 2017
  6. 05/16 ref-filter: add test for --contains on a non-commitÆvar Arnfjörð Bjarmason, Mar 23, 2017
  7. 06/16 tag: remove a TODO item from the test suiteÆvar Arnfjörð Bjarmason, Mar 23, 2017
  8. 08/16 for-each-ref: partly change <object> to <commit> in helpÆvar Arnfjörð Bjarmason, Mar 23, 2017
  9. 07/16 tag tests: fix a typo in a test descriptionÆvar Arnfjörð Bjarmason, Mar 23, 2017
  10. 11/16 tag: change misleading --list <pattern> documentationÆvar Arnfjörð Bjarmason, Mar 23, 2017
  11. Junio C HamanoMar 23, 2017
  12. 13/16 tag: change --point-at to default to HEADÆvar Arnfjörð Bjarmason, Mar 23, 2017
  13. 12/16 tag: implicitly supply --list given another list-like optionÆvar Arnfjörð Bjarmason, Mar 23, 2017
  14. Junio C HamanoMar 23, 2017
  15. Ævar Arnfjörð BjarmasonMar 23, 2017
  16. Junio C HamanoMar 23, 2017
  17. 14/16 ref-filter: add --no-contains option to tag/branch/for-each-refÆvar Arnfjörð Bjarmason, Mar 23, 2017
  18. 15/16 ref-filter: reflow recently changed branch/tag/for-each-ref docsÆvar Arnfjörð Bjarmason, Mar 23, 2017
  19. 10/16 parse-options: add OPT_NONEG to the "contains" optionÆvar Arnfjörð Bjarmason, Mar 23, 2017
  20. 16/16 tag: add tests for --with and --withoutÆvar Arnfjörð Bjarmason, Mar 23, 2017
  21. 09/16 tag: add more incompatibles mode testsÆvar Arnfjörð Bjarmason, Mar 23, 2017
  22. Junio C HamanoMar 23, 2017
  23. Ævar Arnfjörð BjarmasonMar 23, 2017
  24. Junio C HamanoMar 23, 2017
  25. Ævar Arnfjörð BjarmasonMar 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.