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
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2017, 17:13 UTC
Message-ID
<xmqqtw6jex0o.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170323130529.11361-10-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 6 quoted lines
> 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? 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.
would be easier to understand, I would think.
Show 34 quoted lines
> 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: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 22 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.