Hi, On Tue, 30 May 2017, Jeff King wrote: > 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 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 > > > --- > > > 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