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

Re: [RFC PATCH v4] revision: new rev^-n shorthand for rev^n..rev

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 26, 2016, 22:11 UTC
Message-ID
<xmqqbmzapaza.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160926204959.26007-1-vegard.nossum@oracle.com>
Vegard Nossum <vegard.nossum@oracle.com> writes:
Show 23 quoted lines
> +test_expect_success 'rev-parse merge^-0' '
> +	test_must_fail git rev-parse merge^-0
> +'
> +
> +test_expect_success 'rev-parse merge^-3' '
> +	test_must_fail git rev-parse merge^-3
> +'
> +
> +test_expect_success 'rev-parse merge^-^' '
> +	test_must_fail git rev-parse merge^-^
> +'
> +
> +test_expect_success 'rev-list merge^-0' '
> +	test_must_fail git rev-list merge^-0
> +'
> +
> +test_expect_success 'rev-list merge^-3' '
> +	test_must_fail git rev-list merge^-3
> +'
> +
> +test_expect_success 'rev-list merge^-^' '
> +	test_must_fail git rev-list merge^-^
> +'

This seems to be testing failure cases fairly thoroughly, which is a good sign. One thing not tested is "merge^-1x" to ensure that no change mistakenly will break the strtoul() check you have to parse the parent number in the future, but other than that (and possibly reusing the set-up of an already existing test), I am fairly happy with the tests in this patch.

Thanks.
Previous: Jeff King
Message 5 of 5 in “revision: new rev^-n shorthand for rev^n..rev”
  1. revision: new rev^-n shorthand for rev^n..revVegard Nossum, Sep 26, 2016
  2. Junio C HamanoSep 26, 2016
  3. Junio C HamanoSep 26, 2016
  4. Jeff KingSep 27, 2016
  5. Junio C HamanoSep 26, 2016

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.