Conversation
src/remote.c
Outdated
There was a problem hiding this comment.
We have to_unicode for this which works across verisions.
|
I think the API will be more intuitive if using a getset instead of a method, so: Please update the documentation: Thanks! |
|
I fixed most of the issues here, except probably the most important, the API. I see one problem with your proposal, while this would work: remote.fetch_refspecs = ['xxx:xxxx','yyyy:zzzz']This would not produce the expected result: remote.fetch_refspecs[0] = 'xxxx:xxxx'which a user of the library might use, as this is correct: print remote.fetch_refspecs[0]
>>> 'xxxx:xxxx' IMHO a list where you could do remote.fetch_refspecs[0] = 'xxxx:xxx'
# or even
remote.fetch_refspec.append('xxxx:xxxx')
remove.fetch_refspec.remove('yyyy:yyyy')would be nicer, though I would leave it for a future PR (comments on this are welcome) BTW I don't know if the attribute |
|
Then it should be |
|
I think that fixes all the comments, adding better error treatment and making the API symmetric. |
|
After merging I get this error: |
|
Upssss. Sorry about it. |
|
Thanks a lot for your patience :-D |
|
Thank you for contributing. Note I have fixed error handling. The Python functions already set an exception whenever there is an error, so you only need to set the exception for anything else. |
|
I see the changes, thanks a lot. Still learning how to do proper python exceptions :-) |
New attempt to provide refspec API with pygit, now using the new functions in libgit 0.20
It will expose:
the attributes
returning a list of strings with the refspecs
the methods
setting a list of strings a new refspecs