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

Re: [PATCH v3] peel_onion(): add support for <rev>^{tag}

From
RHRichard Hansen <rhansen@bbn.com>
Date
Sep 3, 2013, 19:39 UTC
Message-ID
<52263AFD.3060308@bbn.com>
In-Reply-To
<CAPig+cRQP5CGz_1ckf5Qr6HcB+OvWHNPtGQ8RxWdqTZK0fRo2w@mail.gmail.com>
On 2013-09-03 15:03, Eric Sunshine wrote:
Show 31 quoted lines
> On Tue, Sep 3, 2013 at 1:37 PM, Richard Hansen <rhansen@bbn.com> wrote:
>> diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
>> index eaefc77..5771cbd 100755
>> --- a/t/t1511-rev-parse-caret.sh
>> +++ b/t/t1511-rev-parse-caret.sh
>> @@ -54,6 +61,26 @@ test_expect_success 'ref^{tree}' '
>>         test_must_fail git rev-parse blob-tag^{tree}
>>  '
>>
>> +test_expect_success 'ref^{tag}' '
>> +       echo $BLOB_TAG_SHA1 >expected &&
>> +       git rev-parse --verify blob-tag^{tag} >actual &&
>> +       test_cmp expected actual &&
>> +       echo $TREE_TAG_SHA1 >expected &&
>> +       git rev-parse --verify tree-tag^{tag} >actual &&
>> +       test_cmp expected actual &&
>> +       echo $COMMIT_TAG_SHA1 >expected &&
>> +       git rev-parse --verify commit-tag^{tag} >actual &&
>> +       test_cmp expected actual &&
>> +       echo $TAG_TAG_SHA1 >expected &&
>> +       git rev-parse --verify tag-tag^{tag} >actual &&
>> +       test_cmp expected actual &&
>> +       test_must_fail git rev-parse --verify $BLOB_SHA1^{tag} &&
>> +       test_must_fail git rev-parse --verify $TREE_SHA1^{tag} &&
>> +       test_must_fail git rev-parse --verify $COMMIT_SHA1^{tag} &&
>> +       test_must_fail git rev-parse --verify rev^{tag} &&
>> +       true
>> +'
> 
> The unnecessary trailing "&& true" is unusual. Such form is not used
> elsewhere in this file, or in any script in the test suite.

True. I can take it out, and while I'm at it simplify the test case to what Peff suggested.

I'm in the habit of using that idiom because (1) I won't break things if I forget to add/remove '&&' when I add/remove lines in a future commit, and (2) it simplifies conflict resolution if two commits touch the same list of stuff.

-Richard
Previous: Eric Sunshine
Message 4 of 4 in “peel_onion(): add support for <rev>^{tag}”
  1. peel_onion(): add support for <rev>^{tag}Richard Hansen, Sep 3, 2013
  2. Jeff KingSep 3, 2013
  3. Eric SunshineSep 3, 2013
  4. Richard HansenSep 3, 2013

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.