Re: [PATCH 04/26] upload-pack: convert to a builtin
From: Junio C Hamano <hidden>
Date: 2018-02-21 23:35:57
Jonathan Nieder [off-list ref] writes:
For defense in depth, it would be comforting if the git wrapper had some understanding of "don't support --help in handle_builtin when invoked as a dashed command". That is, I don't expect that anyone has been relying on git-add --help acting like git help add instead of printing the usage message from git add -h
Sounds like a neat trick.
It's a little fussy because today we rewrite "git add --help" to "git-add --help" before rewriting it to "git help add"; we'd have to skip that middle hop for this to work.
I do not quite get this part. "git add --help" goes through run_argv() and then to handle_builtin() which is what does this "git help add" swapping. "git-add --help" does get thrown into the same codepath by pretending as if we got "add --help" as an argument to "git" command, and that happens without going through run_argv(), so presumably we can add another perameter to handle_builtin() so that the callee can tell these two invocation sites apart, no?
I don't think that has to block this patch or series, though --- it's just a separate thought about hardening.
Yeah, I agree with this assessment.