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

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 23, 2018, 05:08 UTC
Message-ID
<xmqqin1ts11h.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<931421945c040ba4518d91f7af9f386d0136bd2f.1540256910.git.matvore@google.com>
Matthew DeVore <matvore@google.com> writes:
Show 30 quoted lines
>  t/t4202-log.sh         | 4 ++++
>  t/t8002-blame.sh       | 4 ++++
>  7 files changed, 14 insertions(+), 1 deletion(-)
> ...
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 153a506151..819c24d10e 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -1703,4 +1703,8 @@ test_expect_success 'log --source paints symmetric ranges' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success '--exclude-promisor-objects does not BUG-crash' '
> +	test_must_fail git log --exclude-promisor-objects source-a
> +'
> +
>  test_done
> diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
> index 380e1c1054..eea048e52c 100755
> --- a/t/t8002-blame.sh
> +++ b/t/t8002-blame.sh
> @@ -118,4 +118,8 @@ test_expect_success '--no-abbrev works like --abbrev=40' '
>  	check_abbrev 40 --no-abbrev
>  '
>  
> +test_expect_success '--exclude-promisor-objects does not BUG-crash' '
> +	test_must_fail git blame --exclude-promisor-objects one
> +'
> +
>  test_done

OK. We used to be hitting BUG() which is an abort() in disguise, so must-fail would have caught it without the fix in this patch. Now we would see a more controlled failure.

    ... goes and makes sure that is the case ...

Not really. We were already doing a controlled failure via die(), so these two tests would not have caught the problem in the code before the fix in this patch.

But nevertheless this is a good change; I do not think it is worth grepping for "unrecognized option" to differentiate the two cases.

Thanks.
Previous: Matthew DeVoreNext: Matthew DeVore
Message 4 of 19 in “[RFC 0/2] explicitly support or not support --exclude-promisor-objects”
  1. Matthew DeVoreOct 23, 2018
  2. 1/2 Documentation/git-log.txt: do not show --exclude-promisor-objectsMatthew DeVore, Oct 23, 2018
  3. 2/2 exclude-promisor-objects: declare when option is allowedMatthew DeVore, Oct 23, 2018
  4. Junio C HamanoOct 23, 2018
  5. Matthew DeVoreOct 23, 2018
  6. Junio C HamanoOct 24, 2018
  7. Jeff KingNov 21, 2018
  8. Matthew DeVoreDec 1, 2018
  9. Jeff KingDec 1, 2018
  10. Matthew DeVoreDec 3, 2018
  11. Jeff KingDec 3, 2018
  12. Matthew DeVoreDec 3, 2018
  13. Junio C HamanoDec 4, 2018
  14. revisions.c: put promisor option in specialized structMatthew DeVore, Dec 3, 2018
  15. Jeff KingDec 3, 2018
  16. Matthew DeVoreDec 3, 2018
  17. Matthew DeVoreOct 23, 2018
  18. Junio C HamanoOct 23, 2018
  19. Matthew DeVoreOct 23, 2018

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.