-
Notifications
You must be signed in to change notification settings - Fork 899
Use Remote.Add and let libgit2 handle default refspec #164
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
I do agree. This was more a reminder/temporary code as the current default in libgit2 doesn't seem to be the correct one (cf The RefSpec). There's even a pending related PR in the libgit2 project. Could you please split this into a separate commit?
It's funny that you mention that, because I was also having a similar kind of thought few days ago. We're dealing with different kind of objects: immutable GitObjects, mutable ones (references, remotes, ...) or hybrid ones (tags, notes). Should we use different verbs when generating mutable objects and immutable ones? I eventually closed this train of thought with something like this "An immutable object is an object that cannot be modified, so the term that one uses to generate it is irrelevant" When @yorah was implementing the Notes API, we debated a bit about I'm ok to change the semantic of the API, from
|
Good catch @nulltoken! I reverted to the default refspec coming from C#, but made a note that it should be removed when that PR goes through. |
As far as |
I'd really like the API to be "predictable". So, if only /cc @dahlbyk @xpaulbettsx @haacked @yorah How do you feel about this? Should we stick with Create? Should we change some of those Create to Add? |
For collections, I prefer Also, if you ever decide to implement |
+1 for Add. Create feels weird on a collection. |
I agree that Now that I think about it Related: should |
I really like what @dahlbyk is suggesting here. We do in fact have I'm +1 on renaming |
Rename them to what? |
|
Needed material for a Git presentation, so... |
(Last commit in that branch is meant to be pulled in after a release with old methods/interfaces marked |
@dahlbyk Nicey :) Some few comments
|
Split out PR for Add/Remove change. Once that's merged, this change gets even easier! |
Looks like @dahlbyk's got this sorted! |
Let's keep it open until the default refspec is actually handled by libgit2 :) |
Conflicts: LibGit2Sharp/RemoteCollection.cs
Ok @nulltoken, in that case I'll make this PR actually use the libgit2 defaults :) We should be good to go with this soon as libgit2/libgit2#737 has been merged. |
I'm a bit reluctant to bind against the latest tip of libgit2 yet, as a slight side effect prevents |
@nulltoken, doesn't change what this PR is trying to do though, so just let it sit until we feel that the tip is stable again. |
Deal ;) |
I like
Add
better thanCreatea
as it matches Git's language and I don't feel like you are creating something in the traditional sense. The remote already exists, you are just adding it to this particular repository.This also makes sure that we don't have defaults in C# code. Whenever possible we should defer for libgit2 for these kinds of things.