Document giterr_last() use only after error. #4772#4773
Conversation
|
I'd like to tweak the wording here just a touch:
"Undefined behavior" is, I think, a bit strong and suggests to the reader that it's C-like UB where you might crash or demons might fly out of your nose. Also, I'd say "function" or "API" instead of "method" because we're kicking it old-school C. Perhaps something more like:
We should also update the API documentation as well, it indicates that |
|
That is a lot better. I will push update. |
|
I have added API documentation, and reworded as requested. Feel free to prioritize other stuff over this. It is minor change from an outsider :) |
|
It looks like the VSTS build is a false negative if I understand the output right. |
pks-t
left a comment
There was a problem hiding this comment.
Two more proposed changes, but otherwise this looks good to me. Thanks for working on it!
I have added API documentation, and reworded as requested. Feel free to prioritize other stuff over this. It is minor change from an outsider :)
We've all started as outsiders doing minor changes at some point in time, so we try to keep feedback loops for new contributors as short as possible to hopefully incentivise them and become insiders :P That being said, it doesn't always work out -- time is limited, unfortunately.
| Otherwise this should return a `git_error` object indicating the class | ||
| of error and the error message that was generated by the library. | ||
| Do not use this function unless the prior call to a libgit2 API | ||
| returned an error, as it can give misleading results. |
There was a problem hiding this comment.
"as it can otherwise give misleading results." Just to make sure that it may only be misleading in this exact case ;)
There was a problem hiding this comment.
Good point. Word added.
| * | ||
| * The default behaviour of this function is to return NULL if no previous error has occurred. | ||
| * However, libgit2's error strings are not cleared aggressively, so a prior | ||
| * (unrelated) error may be returned. This can avoided by only calling |
There was a problem hiding this comment.
"This can be avoided". Missing "be"
There was a problem hiding this comment.
This is embarrassing, fix pushed :)
|
Thanks, @RandomSort! |
Hi, thank you for your awesome work.
This is a trivial documentation addition.
I'll be happy to rework it if it does not fit your wishes.