-
Notifications
You must be signed in to change notification settings - Fork 899
Register custom filters #854
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
b1df1be
to
c4777d3
Compare
233b14d
to
18085bc
Compare
[StructLayout(LayoutKind.Sequential)] | ||
internal class GitFilter | ||
{ | ||
public uint version; |
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 we should set this to 1
. It's not supposed to be passed in by the user.
using LibGit2Sharp.Core; | ||
using LibGit2Sharp.Core.Handles; | ||
|
||
namespace LibGit2Sharp |
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.
Cheating.... 😜
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.
lol.
I think I might wait until your branches have been merged to fix these build failures up properly. That sound ok?
Ok, I think this is all the outstanding feedback addressed. Would love some more 👀 on this |
/// </summary> | ||
/// <param name="filterForAttributes">The filterForAttributes that this filter was created for.</param> | ||
/// <param name="filterSource">The source of the filter</param> | ||
/// <returns>0 if successful and -30 to skip and pass through</returns> |
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.
Maybe the comments could refer to GitErrorCode.PassThrough
instead of an actual number?
Looks clean to me. I'll take a (fresher) look tomorrow. We'd still need libgit2/libgit2#2892 to be merged (and update the libgit2 binaries) before pulling this in . Very awesome job for someone with a "rusty knowledge of C" who stated "this is the first time I have looked at libgit2sharp in any great detail" 😜 |
/// </summary> | ||
Clean = (1 << 0), | ||
} | ||
} |
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.
nit: trailing newline
See #958 for a potential improvement proposal |
this.gitBufPointer = gitBufPointer; | ||
|
||
//Preallocate the buffer | ||
Proxy.git_buf_grow(gitBufPointer, 1024); |
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.
As pointed out by @carlosmn , let's make this 4096
f0f5a46
to
b2639f6
Compare
9d2ca7b
to
17dd29e
Compare
17dd29e
to
c1036eb
Compare
Update libgit2 to fb2f3a7 libgit2/libgit2@e0902fb...fb2f3a7
@ammeep I've added a tiny commit to get the feedback from AppVeyor when time's ready. When updating libgit2 binaries, we tend to stick to a convention that ease further troubleshooting and use this kind of message
|
Ooops, sorry @nulltoken I'll fix that up 🔜 Right now I'm trying to figure out the support for our ✨ new streaming bindings. Once that's one I'll rebase the whole thing again 👍 |
@ammeep No need to be sorry! It's an (undocumented) convention 😉 Thanks for this amazing work! |
I want to expose an API for registering custom clean and smudge filters via libgit2.
My knowledge of C is rusty, and this is the first time I have looked at libgit2sharp in any great detail. So, I'm going to open this PR early, in the hopes that if anyone has time to spot anything terrible I do along the way they will be able to point me in the right direction 🙏
Todo