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

Re: [PATCH v3 7/8] branch.c: use 'ref-filter' APIs

From
Karthik Nayak <karthik.188@gmail.com>
Date
Aug 24, 2015, 18:10 UTC
Message-ID
<CAOLa=ZQzV5NB78593r+qXMvS249OBOkRK+ofU30AFzcf97+hsw@mail.gmail.com>
In-Reply-To
<xmqqtwro4mpu.fsf@gitster.dls.corp.google.com>
On Mon, Aug 24, 2015 at 11:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>>>>  test_expect_success 'git branch shows badly named ref' '
>>>>         cp .git/refs/heads/master .git/refs/heads/broken...ref &&
>>>>         test_when_finished "rm -f .git/refs/heads/broken...ref" &&
>>>> -       git branch >output &&
>>>> +       git branch 2>output &&
>>>>         grep -e "broken\.\.\.ref" output
>>>>  '
>>>
>>> Maybe the test could be renamed to 'git branch warns about badly named
>>> ref' and maybe you could also check that "broken\.\.\.ref" is not
>>> printed on stdout.
>>
>> The name change sounds reasonable, do we really need to check for it in the
>> stdout?
>
> I think Christian meant "we should check in both", i.e.
>
>         git branch >output 2>error &&
>         grep "broken\.\.\.ref" error &&
>         ! grep "broken\.\.\.ref" output
>
> or something like that.  That way, you are effectively specifying in
> the test that badly named refs must not be included in the output,
> so somebody who changes that in the future needs to justify why
> including them in the output is a good idea when updating the test.
>
Ah! okay, I get what you're saying. Should I reroll it? Or a squash in?
-- 
Regards,
Karthik Nayak
Previous: Junio C HamanoNext: Karthik Nayak
Message 12 of 13 in “port the filtering part of ref-filter to branch.c”
  1. 0/8 port the filtering part of ref-filter to branch.cKarthik Nayak, Aug 22, 2015
  2. 1/8 branch: refactor width computationKarthik Nayak, Aug 22, 2015
  3. 2/8 branch: bump get_head_description() to the topKarthik Nayak, Aug 22, 2015
  4. 3/8 branch: roll show_detached HEAD into regular ref_listKarthik Nayak, Aug 22, 2015
  5. 4/8 branch: move 'current' check down to the presentation layerKarthik Nayak, Aug 22, 2015
  6. 5/8 branch: drop non-commit error reportingKarthik Nayak, Aug 22, 2015
  7. 6/8 branch.c: use 'ref-filter' data structuresKarthik Nayak, Aug 22, 2015
  8. 7/8 branch.c: use 'ref-filter' APIsKarthik Nayak, Aug 22, 2015
  9. Christian CouderAug 22, 2015
  10. Karthik NayakAug 22, 2015
  11. Junio C HamanoAug 24, 2015
  12. Karthik NayakAug 24, 2015
  13. 8/8 branch: add '--points-at' optionKarthik Nayak, Aug 22, 2015

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.