-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LibGit2 refactor #19839
Comments
I should say that I would love some help with this if anyone is keen. |
Maybe add a
item to that list. |
Currently we have
The |
One issue that has arisen a couple of times now (e.g. JuliaLang/PkgDev.jl#101) is how to check if an object is in a repo, then do or not do something, e.g. in calls to The old code would return Two possible options, neither of which I'm particularly keen on:
Any better ideas? Or preferences on which is the least worst? |
always returning |
any suggestions for such a name? |
|
|
|
|
Does this mean that |
The other problem is that you often want to know the reason why the field is null, e.g. https://github.com/JuliaLang/julia/pull/20752/files#diff-82889f262e9bc3ab1b675224c253a830R163 What if we were to define a special
and we were to create lower-level "try" interfaces based on this? |
Not really a libgit2-specific concept, but would certainly be useful here. Ref https://github.com/iamed2/ResultTypes.jl |
Here's a confusing one that I came across in #20916:
On the other hand, the libgit2 Too late for 0.6, but it would be nice to have a better and more consistent way to handle this. |
I think the trying to emulate the |
Another one: in a couple of places it is useful to immediately Two options:
|
The LibGit2 module could do with some work. Some possible changes
LibGit2.checkout
instead ofLibGit2.branch!
!
suffixEnum
andFlagEnum
(pending RFC: EnumSet type #19470) for constants whenever possiblerebase!
will silently abort if it failsrevparse
as wellStrArrayStruct
: manually callsLibc.malloc
, but then frees via LibGit2git_strarray_free
Buffer
: is an immutable object, but needs a finalizerSignatureStruct
,GitSignature
,Signature
objects should be simplifiedLibGit2.get
into more usefully-named functionsGitBlob(repo::GitRepo, hash::GitHash)
GitObject
, automatically resolve its type viagit_object_type
functionLibGit2.get(T, repo, oid)
should throw an error (TypeError
?) if incorrect typeT
is used.GitConfig
objects act like anAssociative{String,String}
(i.e. overloadgetindex
/setindex!
)GitAnyObject
toGitUnknownObject
Deprecate GitAnyObject -> GitUnknownObject #19935Oid
toGitHash
RFC: Rename LibGit2.Oid to LibGit2.GitHash #19878GitHash
and short hashes: see RFC: Rename LibGit2.Oid to LibGit2.GitHash #19878 (comment)LibGit2.fetch
should return nothing (since it will throw an error for any other value)LibGit2.reset!
andrebase
should return current HEAD commitLibGit2.upstream
andLibGit2.lookup_branch
should throw errors if not found, instead of returningnothing
GitHash
objects as null values.newbase
option forrebase!
(cf Throw error on aborted rebase #19651 (comment))Base.next(::LibGit2.Rebase)
(or until new iteration protocol is in place)LibGit2.owner
andLibGit2.repository
with
and explicitfinalize
/close
calls (pending Attach finalizers to LibGit2 methods #19660)show
methods for various objectsGitBlob
GitCommit
GitRemote
GitSignature
GitTag
GitTreeEntry
GitReference
GitIndex
DiffDelta
DiffFile
FetchHead
GitTree
GitDiff
GitAnnotated
GitRebase
git_*_options
structsisdiff
to a more descriptive name (fix some LibGit2 errors #20155 (comment))cat
?content
.Some of these are breaking, so we may want to get the deprecations in place before 0.6.
The text was updated successfully, but these errors were encountered: