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

Re: [PATCH 6.5?/8] version: move --build-options to a test helper

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 31, 2017, 15:27 UTC
Message-ID
<alpine.DEB.2.21.1.1705311726110.3610@virtualbox>
In-Reply-To
<20170530210530.o5gbz2k24wxrfner@sigill.intra.peff.net>
Hi,
On Tue, 30 May 2017, Jeff King wrote:
Show 35 quoted lines
> On Tue, May 30, 2017 at 08:45:53PM +0000, Ævar Arnfjörð Bjarmason wrote:
> 
> > On Tue, May 30, 2017 at 7:17 AM, Jeff King <peff@peff.net> wrote:
> > > The "git version" command didn't traditionally accept any
> > > options, and in fact ignores any you give it. When we added
> > > simple option parsing for "--build-options" in 6b9c38e14, we
> > > didn't improve this; we just loop over the arguments and
> > > pick out the one we recognize.
> > >
> > > Instead, let's move to a real parsing loop, complain about
> > > nonsense options, and recognize conventions like "-h".
> > >
> > > Signed-off-by: Jeff King <peff@peff.net>
> > > ---
> > > I assume nobody was running "git version --foobar" and expecting it to
> > > work. I guess we could also complain about "git version foobar" (no
> > > dashes), but this patch doesn't. Mainly I wanted the auto-generated
> > > options list.
> > 
> > Looks good to me. I started hacking this up the other day, but then
> > thought "wait a minute, isn't this just a test helper?" and wrote this
> > which I've rebased on top of your change.
> > 
> > I may be missing something here but isn't this a much straightforward
> > way to accomplish this, or is this used by some external program
> > outside of git.git that's going to rely on --build-options output?
> 
> My intent in putting it into the actual git binary was that it could
> also be useful for collecting build-time knobs from users (who may be
> using a binary package). Like:
> 
>   http://public-inbox.org/git/20160712035719.GA30281@sigill.intra.peff.net/
> 
> We haven't filled in that NEEDSWORK yet, but I'd rather see us go in
> that direction than remove the option entirely.
FWIW it also helped Git for Windows.

The two additional bits we added to the build options (the commit from which Git was built and the architecture) did not hurt one bit, either.

In other words, it would make my life a lot harder if --build-options were moved to a test helper that does not ship with the end product.

Ciao, Dscho

Previous: Jeff KingNext: Jeff King
Message 14 of 38 in “[Bug] setup_git_env called without repository”
  1. Zero KingMay 29, 2017
  2. Ævar Arnfjörð BjarmasonMay 29, 2017
  3. Jeff KingMay 29, 2017
  4. 0/8 consistent "-h" handling in builtinsJeff King, May 30, 2017
  5. 1/8 am: handle "-h" argument earlierJeff King, May 30, 2017
  6. Junio C HamanoMay 30, 2017
  7. 2/8 credential: handle invalid arguments earlierJeff King, May 30, 2017
  8. 3/8 upload-archive: handle "-h" option earlyJeff King, May 30, 2017
  9. 4/8 remote-{ext,fd}: print usage message on invalid argumentsJeff King, May 30, 2017
  10. 5/8 submodule--helper: show usage for "-h"Jeff King, May 30, 2017
  11. 6/8 version: convert to parse-optionsJeff King, May 30, 2017
  12. version: move --build-options to a test helperÆvar Arnfjörð Bjarmason, May 30, 2017
  13. Jeff KingMay 30, 2017
  14. Johannes SchindelinMay 31, 2017
  15. Jeff KingMay 31, 2017
  16. Johannes SchindelinMay 31, 2017
  17. Ævar Arnfjörð BjarmasonMay 31, 2017
  18. Jeff KingMay 31, 2017
  19. 7/8 git: add hidden --list-builtins optionJeff King, May 30, 2017
  20. 8/8 t0012: test "-h" with builtinsJeff King, May 30, 2017
  21. Junio C HamanoMay 30, 2017
  22. Jeff KingMay 30, 2017
  23. Junio C HamanoMay 30, 2017
  24. Jeff KingMay 30, 2017
  25. Junio C HamanoMay 30, 2017
  26. Jeff KingMay 30, 2017
  27. Jeff KingMay 30, 2017
  28. Junio C HamanoMay 30, 2017
  29. Junio C HamanoJun 1, 2017
  30. Jeff KingJun 1, 2017
  31. Junio C HamanoJun 1, 2017
  32. Junio C HamanoJun 1, 2017
  33. Jeff KingJun 1, 2017
  34. Junio C HamanoJun 1, 2017
  35. Jeff KingJun 1, 2017
  36. Jonathan NiederJun 13, 2017
  37. Jeff KingJun 14, 2017
  38. Junio C HamanoMay 30, 2017

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.