You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a couple of issues with the current implementation (or the docs) of LibGit2:
Functions like LibGit2.add! take a files argument, which must be (as per here)
relative to the repos cwd and
separated by forward slashes.
Since there are no docs for the functions libgit2/index.jl that's a bit of a usability problem which e.g. caused PkgDev.tag to not work on Windows (see JuliaLang/PkgDev.jl#28).
I'd suggest to either
normalize paths to use forward slashes,
either error when an absolute path is input or try to resolve it to a path relative to the repos cwd (which should mostly be it's root),
document the above, and
test those cases.
or
document that the path passed to those functions needs to conform to the conditions above and
throw an error if they don't (instead of silently failing to do anything), and
test those cases.
I can look into preparing a PR for either of the above if someone decides what to do, but maybe someone more familiar with the codebase would be better suited to do that.
We should attempt to identify which of these limitations come from the c library and which are self inflicted bugs. Command line git lets you use abs paths but errors if you try to add something that's not inaide the current repo, right?
See here and here: libgit2 only allows you to use forward slashes in functions that take git paths (as opposed to filesystem paths), so it's mostly a limitation (or decision, rather) with the c library. I'd argue we should be working around that though.
Good find. I agree with you and think we should try to do some obvious manipulations before sending to the c library in the bindings instead of needing every user to test and work around the same issues (or all hit this problem if they don't)
There are a couple of issues with the current implementation (or the docs) of
LibGit2
:Functions like
LibGit2.add!
take afiles
argument, which must be (as per here)Since there are no docs for the functions
libgit2/index.jl
that's a bit of a usability problem which e.g. causedPkgDev.tag
to not work on Windows (see JuliaLang/PkgDev.jl#28).I'd suggest to either
or
I can look into preparing a PR for either of the above if someone decides what to do, but maybe someone more familiar with the codebase would be better suited to do that.
cc @tkelman
The text was updated successfully, but these errors were encountered: