-
Notifications
You must be signed in to change notification settings - Fork 2.5k
pack: rename git_packfile_stream_free
#4436
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
Conversation
Not sure I agree here, what about I don't really mind that these are |
Huh, you're correct about those. I don't mind to find a better term than I don't really have good alternatives. Some things that came to my mind:
I think I like wipe the best. It shows that it is being cleaned up somehow, but with wiping you don't remove the structure itself. Opinions? I also definitly agree about being consistent. I didn't think of those other occurrences. |
Hm. I know where you're coming from but this has never bothered me in that way, I don't think. Curious about @carlosmn's opinions. Note also that If we do make a change, what about |
Dispose would be fine with me, sure. And yeah, the |
OK. I'm leaning towards thinking that this makes sense. I think that I prefer I'm also okay with adding |
As I'm the one pushing towards that direction, I'm definitly in favor of your proposal. I don't know about removing the |
91717e0
to
853f3a7
Compare
I've made your proposed change with regards to |
include/git2/common.h
Outdated
__attribute__((deprecated)) \ | ||
func | ||
#elif defined(_MSC_VER) | ||
# define GIT_EXTERN(func) __declspec(deprecated) func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a copy/paste error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cough Embarrassing.
include/git2/common.h
Outdated
#elif defined(_MSC_VER) | ||
# define GIT_EXTERN(func) __declspec(deprecated) func | ||
#else | ||
# define GIT_EXTERN(func) func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
853f3a7
to
80810cf
Compare
80810cf
to
08f2ff4
Compare
Ugh, sorry, I wish I had gotten around to this sooner before there were conflicts. If you could fix those up quickly I'll merge this. 👍 I'm really happy that we're deprecating this nicely and not breaking anything. 😀 |
The function `git_packfile_stream_free` frees all state of the packfile stream without freeing the structure itself. This naming makes it hard to spot whether it will try to free the pointer itself or not, causing potential future errors. Due to this reason, we have decided to name a function freeing state without freeing the actual struture a "dispose" function. Rename `git_packfile_stream_free` to `git_packfile_stream_dispose` as a first example following this rule.
08f2ff4
to
ecf4f33
Compare
Ugh, sorry, I wish I had gotten around to this sooner before
there were conflicts. If you could fix those up quickly I'll
merge this.
No worries. Fixing conflicts is trivial to do for this PR.
I'm really happy that we're deprecating this nicely and not
breaking anything.
Yup. I think the deprecation-macro is an important step going
forward for v1.0, as well. While we cannot really change APIs
anymore, we should still notify users that something better is
available.
I've rebased the PR on latest master.
|
The function
git_packfile_stream_free
frees all state of the packfilestream without freeing the structure itself. Thus, the function is
misnamed, as we usually call such a function a "clear" function. Rename
it to make clear that in fact it does not free the structure.