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

Re: [RFC] Instruct git-completion.bash that we are in test mode

From
Jean-Noël Avila <avila.jn@gmail.com>
Date
Jan 22, 2013, 08:04 UTC
Message-ID
<50FE47F4.20104@gmail.com>
In-Reply-To
<7vham9dej2.fsf@alter.siamese.dyndns.org>
Le 22/01/2013 05:31, Junio C Hamano a écrit :
> Jeff King <peff@peff.net>  writes:
 >
 >> I really hate to suggest this, but should it be more like:
 >>
 >> if test -z "$FAKE_COMMAND_LIST"; then __git_cmdlist() { git help -a
 >> | egrep '^ [a-zA-Z0-9]' } else __git_cmdlist() { printf '%s'
 >> "$FAKE_COMMAND_LIST" } fi
 >>
 >> That gives us a nice predictable starting point for actually
 >> testing the completion code. The downside is that it doesn't let
 >> us test that we remain compatible with the output of "help -a".
 >
 > Yeah, I think this is simpler and more to the point for the test in
 > t9902. If we really want to test something that is the same as, or
 > at least any closer than this approach (or my "help --standard"), to
 > what the real users use, the test has to become inherently flaky, so
 > I think we should go for the simplicity of this patch shows.

Instead of imposing the list of command, we could use the command list argument to filter the ouput of git help -a. This would ensure that the completions we want to test are still present in the installation while still restricting them to the test case.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 15 in “[RFC] Instruct git-completion.bash that we are in test mode”
  1. Jean-Noël AVILAJan 21, 2013
  2. Junio C HamanoJan 21, 2013
  3. Jeff KingJan 22, 2013
  4. Junio C HamanoJan 22, 2013
  5. Jean-Noël AvilaJan 22, 2013
  6. Junio C HamanoJan 22, 2013
  7. t9902: protect test from stray build artifactsJunio C Hamano, Jan 24, 2013
  8. Jeff KingJan 25, 2013
  9. Jonathan NiederJan 25, 2013
  10. Junio C HamanoJan 25, 2013
  11. Jeff KingJan 25, 2013
  12. Junio C HamanoJan 25, 2013
  13. Jeff KingJan 25, 2013
  14. Junio C HamanoJan 25, 2013
  15. Jeff KingJan 25, 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.