New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid checking for -h
in commands that already use the parse-options API
#1125
Comments
Hey @dscho I would like to try this :) |
Sure, go ahead! |
Hi @dscho , I have a question though. Say for
Here if But if I remove those two lines ( i.e. the if check for So, would it be good to remove the "unnecessary" |
@Abhra303 I opened this ticket because it has been suggested on the Git mailing list that this But now that I think of it, in particular in the context of So if you ask me, actually: because you asked me, I would say no, it's not worth the effort to work on this. There are other, more rewarding micro projects, e.g. #636, or even vetting return values so that Now, I opened this ticket, and since I now finally made up my mind that I'd rather not see time spent on this, I better close it, eh? |
Yeah, certainly! I am also in favour of closing it :) |
From https://lore.kernel.org/git/CABPp-BG1UXDLVh4_F_TQJmiM4=fFMOLFo5k27=MghbBPWPkL7A@mail.gmail.com/:
It would appear that we have quite a few places where we use the parse-options API yet check (unnecessarily) for
-h
:And indeed, https://github.com/git/git/blob/v2.35.0/builtin/am.c#L2427-L2428 seems to do exactly that.
Let's fix those, and while at it, enhance the
static-analysis
job of Git's CI to find new code that introduced unnecessary-h
checking.The text was updated successfully, but these errors were encountered: