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
Flag options in describe.h as being optional #4587
Conversation
I think our "canonical" phrasing is "Can be NULL". Maybe something more to the point, like "Can be NULL, see git_(describe_)?_init_options for the default." |
@tiennou Thank you for the review. Which would you prefer?
|
Oooh a vote 😉. I say 2 ! |
We should say that it may be We probably shouldn't point people to Personally, I think keeping it succinct - like "the lookup options (or null for defaults)" is adequate. But I also realize that we probably don't have any strict commonality amongst the various things that take options, so ... 🤷♂️ |
The most common style we have in our code base is either "Structure with options to influence whatever or NULL for defaults." or "Options for whatever, or NULL for {defaults,default options}". I'd say "Options for whatever, or NULL for defaults" is the best way to go. It's short, concise, already used and one knows what to expect |
The git_describe_options in git_describe_commit and git_describe_workdir and the git_describe_format_options in git_describe_format are optional and can be NULL. State this in the documentation to make people's lives easier when calling these functions. Signed-off-by: Remy Suen <remy.suen@gmail.com>
Is the new version (db90e95) I made okay? |
It is. Thanks for this PR! |
Both
git_describe_options
andgit_describe_formatting_options
are sanitized before they are actually used. They should be noted as being optional in the documentation.libgit2/src/describe.c
Lines 641 to 654 in 5585e35
libgit2/src/describe.c
Lines 767 to 778 in 5585e35