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

Re: [PATCHv3] checkout: do not mention detach advice for explicit --detach option

From
Jeff King <peff@peff.net>
Date
Aug 12, 2016, 16:28 UTC
Message-ID
<20160812162825.omk23srrbx6ofizc@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kaOHdLrPownWdnZQSEzG6P6-iZqx2xu3MEG51DZU1U+Cg@mail.gmail.com>
On Fri, Aug 12, 2016 at 08:51:43AM -0700, Stefan Beller wrote:
Show 9 quoted lines
> > Hmm. Using "!test_cmp" seems weird to me, just because it would falsely
> > claim success if something else unexpected changes. Our usual method for
> > making sure some particular output does not appear is "test_i18ngrep"
> > with a liberal pattern.
> 
> and I advanced the liberal a bit more. ;)
> So maybe we'd be looking that no 'detached HEAD' occurs?
> 
>     test_i18ngrep ! "'detached HEAD'" actual

I was thinking maybe "advice:" to look for any advice, but at this point we are guessing about what might change in the future.

Show 5 quoted lines
> I think testing that we do not give out advice (i.e. behave the same as if
> not giving out advice) is best tested to just compare the output to
> the output of "git -c advice.detachedHead=false ...", which is what I do here.
> This seems to be future proof to me no matter how we reword the advice or
> the actual message on checkout?

Yeah, I guess that is reasonable. I thought at first you were comparing more distinct commands, but if only the one thing is changing, that seems reasonable.

You may also want to grab stderr, too (I'm actually surprised advice goes to stdout and not stderr, and that is something that seems plausible to change in the future).

-Peff
Previous: Stefan BellerNext: Junio C Hamano
Message 4 of 5 in “[PATCHv3] checkout: do not mention detach advice for explicit --detach option”
  1. Stefan BellerAug 12, 2016
  2. Jeff KingAug 12, 2016
  3. Stefan BellerAug 12, 2016
  4. Jeff KingAug 12, 2016
  5. Junio C HamanoAug 12, 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.