help wantedlibgit2
Repository metrics
- Stars
- (48,709 stars)
- PR merge metrics
- (Avg merge 20d 6h) (157 merged PRs in 30d)
Description
The LibGit2 module could do with some work. Some possible changes
- functions should mirror CLI (command line interface) git functionality when possible
- e.g.
LibGit2.checkoutinstead ofLibGit2.branch! - possible exceptions when CLI does multiple things in one go
- e.g.
- consistent use of
!suffix - use
EnumandFlagEnum(pending #19470) for constants whenever possible - don't swallow errors:
- e.g.
rebase!will silently abort if it fails revparseas well
- e.g.
- Normalize and check path inputs, ref #18724.
- Clean up a few objects which allocate memory in a confusing way:
StrArrayStruct: manually callsLibc.malloc, but then frees via LibGit2git_strarray_freeBuffer: is an immutable object, but needs a finalizerSignatureStruct,GitSignature,Signatureobjects should be simplified
- split out
LibGit2.getinto more usefully-named functions- Maybe via constructors? e.g.
GitBlob(repo::GitRepo, hash::GitHash) - when returning a
GitObject, automatically resolve its type viagit_object_typefunction LibGit2.get(T, repo, oid)should throw an error (TypeError?) if incorrect typeTis used.
- Maybe via constructors? e.g.
- Make
GitConfigobjects act like anAssociative{String,String}(i.e. overloadgetindex/setindex!) - rename
GitAnyObjecttoGitUnknownObject#19935 - rename
OidtoGitHash#19878 - Different types for full
GitHashand short hashes: see https://github.com/JuliaLang/julia/pull/19878#issuecomment-270714556 - More sensible errors and return values
-
LibGit2.fetchshould return nothing (since it will throw an error for any other value) -
LibGit2.reset!andrebaseshould return current HEAD commit -
LibGit2.upstreamandLibGit2.lookup_branchshould throw errors if not found, instead of returningnothing - Don't use "zero"
GitHashobjects as null values.
-
- Support
newbaseoption forrebase!(cf https://github.com/JuliaLang/julia/pull/19651#discussion_r94463640) - Use correct iteration protocol for
Base.next(::LibGit2.Rebase)(or until new iteration protocol is in place) - Combine
LibGit2.ownerandLibGit2.repository - Get rid of a lot of the
withand explicitfinalize/closecalls (pending #19660) - Sensible
showmethods for various objects-
GitBlob -
GitCommit -
GitRemote -
GitSignature -
GitTag -
GitTreeEntry -
GitReference -
GitIndex -
DiffDelta -
DiffFile -
FetchHead -
GitTree -
GitDiff -
GitAnnotated -
GitRebase
-
- Better documentation (#18810)
- what the function/type does
- arguments/output value
- equivalent git CLI command where appropriate
- Better tests:
- More coverage
- Can test behaviour against command line Git
- Consistent handling of
git_*_optionsstructs- Correct handling of memory allocation of pointer fields
- Callback interface
- Rename
isdiffto a more descriptive name (https://github.com/JuliaLang/julia/pull/20155#discussion_r97181726) - get rid of
cat?- It's more or less a wrapper around
content.
- It's more or less a wrapper around
- document status/GitStatus return types and what results mean https://github.com/JuliaLang/julia/pull/20503#issuecomment-278394964
Some of these are breaking, so we may want to get the deprecations in place before 0.6.