summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-05Add support for custom smart transports (#806)lhchavez
This change adds support for git smart transports. This will be then used to implement http, https, and ssh transports that don't rely on the libgit2 library.
2021-09-05Make all non-user-creatable structures non-comparable (#802)lhchavez
This change makes all non-user-creatable structures non-comparable. This makes it easier to add changes later that don't introduce breaking changes from the go compatibility guarantees perspective. This, of course, implies that this change _is_ a breaking change, but since these structures are not intended to be created by users (or de-referenced), it should be okay.
2021-09-04Declare forward-compatibility with libgit2 v1.2.0 #minor (#800)lhchavez
We can't yet ship a fully libgit2 v1.2.0-compatible library due to a missing public symbol, but we can allow the v1.1.0-era codebase to link against libgit2 v1.2.0 in the meantime.
2021-09-04Prepare for the v1.2.0 release (#796)lhchavez
This change adds a few more deprecation messages just before we remove them.
2021-09-04Add DiffIgnoreWitespaceEol and deprecate DiffIgnoreWitespaceEol (#774)Gustav Westling
DiffIgnoreWitespaceEol contains a typo and does not have the same name as it's libgit2 counterpart. Fixes #773
2021-09-04Add `CreateCommitWithSignature` (#782)lhchavez
This change adds the wrapper for `git_commit_create_with_signature`.
2021-09-04Rename the default branch to `main` (#786)lhchavez
We've renamed the default branch from `master` to `main`, so we need to change a bunch of references to that.
2021-09-04Add `Repository.CreateCommitBuffer` (#781)lhchavez
This commit adds the Go binding for `git_commit_create_buffer`. This will be used to support the 1.2.0 commit create callback.
2021-09-03Remove the legacy builders (#776)lhchavez
These builds are no longer working because some of the dependencies now require newer versions of Go. Seems like the ecosystem has moved to Go 1.11+, so we are now forced to follow suit.
2021-04-03add wrapper for git_config_open_default (#758)Vladimir Buzuev
2021-04-03fix buldled static build on Windows/MinGW (#761)Vladimir Buzuev
seems like need more libraries in LDFLAGS: * ws2_32 for socket, connect, htonl, etc * ole32 for CoInitializeEx * rpcrt4 for UuidCreate * crypt32 for CertFreeCertificateContext
2021-04-03Git repository item path (#757)Vladimir Buzuev
add wrapper for `git_repository_item_path`
2021-02-15Make index time fields public (#750)michael boulton
From gorelease: ``` Compatible changes: - IndexTime.Nanoseconds: added - IndexTime.Seconds: added ``` There are no extra tests because there isn't really anything to test closes #304
2021-02-15fix: Use `err` instead of error as a variable name for errors (#746)Suhaib Mujahid
fix #745
2021-02-03Implement git_repository_set_config (#735)Byoungchan Lee
Closes #732
2021-02-03Support git_remote_create_with_opts (#733)Byoungchan Lee
Closes #645
2021-02-02Support git_repository_message, git_repository_message_remove (#734)Byoungchan Lee
Closes #646
2020-12-13Rename the build files (#724)lhchavez
This change renames the build files so they come lexicographically before any source files. This makes the compile errors (due to mismatched libgit2 versions) easier to understand, since the `Build_*.go` files will be tried before the rest, and the `#error` in those files will kick in, leading to a much better experience. This unfortunately goes a bit against the defacto standard of using only lowercase characters in filenames, but the better developer experience (and better self-diagnosis when things go wrong instead of having to open a new issue) is worth the deviation. Fixes: #711 Fixes: #617
2020-12-13Support more MergeBase functions (#720)lhchavez
This change adds support for MergeBaseMany, MergeBasesMany, and MergeBaseOctopus.
2020-12-10More callback refactoring (#713)lhchavez
This change: * Gets rid of the `.toC()` functions for Options objects, since they were redundant with the `populateXxxOptions()`. * Adds support for `errorTarget` to the `RemoteOptions`, since they are used in the same stack for some functions (like `Fetch()`). Now for those cases, the error returned by the callback will be preserved as-is.
2020-12-10Ensure that no pointer handles leak during the test (#712)lhchavez
This change makes sure that pointer handles are correctly cleaned up during tests.
2020-12-06Add `NewCredentialSSHKeyFromSigner` (#706)lhchavez
This change adds `NewCredentialSSHKeyFromSigner`, which allows idiomatic use of SSH keys from Go. This also lets us spin off an SSH server in the tests.
2020-12-06Build improvements (#707)lhchavez
This change makes the test be verbose and use parallelization if possible (when using gmake to build).
2020-12-05Refactor all callbacks (#700)lhchavez
This change is a preparation for another change that makes all callback types return a Go error instead of an error code / an integer. That is going to make make things a lot more idiomatic. The reason this change is split is threefold: a) This change is mostly mechanical and should contain no semantic changes. b) This change is backwards-compatible (in the Go API compatibility sense of the word), and thus can be backported to all other releases. c) It makes the other change a bit smaller and more focused on just one thing. Concretely, this change makes all callbacks populate a Go error when they fail. If the callback is invoked from the same stack as the function to which it was passed (e.g. for `Tree.Walk`), it will preserve the error object directly into a struct that also holds the callback function. Otherwise if the callback is pased to one func and will be invoked when run from another one (e.g. for `Repository.InitRebase`), the error string is saved into the libgit2 thread-local storage and then re-created as a `GitError`.
2020-12-05Mark some symbols to be deprecated #minor (#698)lhchavez
This change introduces the file deprecated.go, which contains any constants, functions, and types that are slated to be deprecated in the next major release. These symbols are deprecated because they refer to old spellings in pre-1.0 libgit2. This also makes the build be done with the `-DDEPRECATE_HARD` flag to avoid regressions. This, together with [gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should make releases safer going forward. 1: More information about how that works at https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
2020-11-28Relax libgit2 minor version check (#696)nmeum
The major version must still be an exact match since libgit2 uses semantic versioning and changes to the major number indicate backwards incompatible changes to the API. Fixes: #695
2020-11-26Expose GIT_CERT_SSH_SHA256 (#690)Hans Duedal
Newer versions of libssh2 use SHA256 fingerprints
2020-11-13Add ReferenceNormalizeName (#681)Segev Finer
2020-11-13Travis-ci: added support for ppc64le (#682)Devendra
Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le. This helps us simplify testing later when distributions are re-building and re-releasing.
2020-11-07Add GIT_BLAME_IGNORE_WHITESPACE flag (#677)Suhaib Mujahid
The `GIT_BLAME_IGNORE_WHITESPACE` blame option flag was introduced in libgit2 v1.1.0 Change type: #minor
2020-11-07Add GIT_BLAME_USE_MAILMAP flag (#676)Suhaib Mujahid
The `GIT_BLAME_USE_MAILMAP` blame option flag was introduced in libgit2 v0.28 Change type: #minor
2020-11-02Use the correct branch name for backporting into v1.0 (#674)lhchavez
This change uses the correct branch name (`release-1.0`) to backport changes into the v1.0 branch.
2020-11-02feat: Implement an option to control hash verification (#671)Suhaib Mujahid
Add a binding to enable/disable hash verification using the `GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION` option. Change type: #minor
2020-10-26Create v31 to support libgit2 v1.1.x (#668)Suhaib Mujahid
The libgit2 `v1.1.0` is released two weeks ago. This PR allows `git2go` to link against the new version.
2020-10-23CI refresh (#666)lhchavez
This change: * Makes the Travis tests only run tip, since the rest of the Go versions are better served by GitHub Actions. * Use Go 1.15 in the CI. This has been released for a while.
2020-10-23apply: Add bindings for git_apply_to_tree (#657)Sami Hiltunen
Adds bindings to the git_apply_to_tree function that allows applying a diff directly to a tree.
2020-10-22Make `TestApplyDiffAddFile()` explicitly `.Free()` stuff (#661)lhchavez
This change adds explicit `.Free()` calls in `TestApplyDiffAddFile()`. It was discovered in #657 that some objects were not explicitly being freed, so this fixes that!
2020-10-22refactor: Use undeprecated options init (#656)Suhaib Mujahid
This PR move form linking against the deprecated `init_options` functions to the renamed `options_init` functions. For more context see libgit2/libgit2@0b5ba0d744e69da5dc8c08d167c83dd87ed83af2 and libgit2/libgit2@c6184f0c4b209e462bf3f42ab20df2d13d8ee918.
2020-10-22repository: Implement wrappers for `git_object_lookup_prefix` (#658)Patrick Steinhardt
While we already have wrappers for `git_object_lookup`, there are none yet for the prefixed variant where only the first n bytes of the OID are used for the lookup. This commit adds them.
2020-09-30feat: Enable change the system install path (#653)Suhaib Mujahid
#### Problem: The current `CMAKE_INSTALL_PREFIX` value for the `system` build mode is `/usr`. However, in`macOS` as an example, you cannot write to `/usr` without `sudo` permission. #### Proposed solution: Enable changing the value to `/usr/local` (or any other path). This change makes the script use the value of the environment variable `SYSTEM_INSTALL_PREFIX` to select the installation path. If the variable is not set, it fallback to the path `/usr`.
2020-09-30Enable set the VENDORED_PATH for libgit2 (#650)Suhaib Mujahid
### What this change is doing? This change aims to enable us to set the `VENDORED_PATH` as an environment variable and failback to the default value if the environment variable is not set. Thus, this change should not break current behavior. ### Why we need this? This will enable using the script to build libgit2 form source code downloaded manually. Example: ```sh LIBGIT2_VER="1.0.1" DOWNLOAD_URL="https://codeload.github.com/libgit2/libgit2/tar.gz/v${LIBGIT2_VER}"" LIBGIT2_PATH="${HOME}/libgit2-${LIBGIT2_VER}" wget -O "${LIBGIT2_PATH}.tar.gz" "$DOWNLOAD_URL" tar -xzvf "${LIBGIT2_PATH}.tar.gz" VENDORED_PATH=$LIBGIT2_PATH sh ./script/build-libgit2.sh --static ```
2020-09-29Add a ReInit function (#647)Jesse Hathaway
libgit2 stores the lookup paths for gitconfig files in its global state. This means that after a program changes its effective uid libgit2 will still look for gitconfig files in the home directory of the original uid. Expose a way to call C.git_libgit2_init so a user can reinitialize the libgit2 global state.
2020-09-18merge: Expose recursion limit merge option (#642)Patrick Steinhardt
The `recursion_limit` merge option provided by libgit2 is currently not exposed and thus inaccessible to Git2Go users. Let's expose it to let users control creation of recursive merge bases.
2020-08-18Add support for creating signed commits and signing commits during a rebase ↵michael boulton
(#626)
2020-08-18More diff functionality (#629)michael boulton
This PR adds - The ability to apply a Diff object to the repo - Support for git_apply_hunk_cb and git_apply_delta_cb callbacks in options for applying the diffs - The ability to import a diff from a raw buffer (for example, one exported by ToBuf) into a Diff object associated with the repo - Tests for the above
2020-08-16Add two more GitHub Actions workflows (#633)lhchavez
This change adds: * `tag.yml`: Creates a new tag every time the master or a release branch is pushed. * `backport.yml`: Creates a cherry-pick in older release branches to keep them up to date with little cost.
2020-08-15Refresh the GitHub Actions CI (#632)lhchavez
This change: * Builds the library with Go 1.14, too. * Builds the non-legacy tests with Ubuntu Focal (20.04). * Adds testing for system-wide libraries, both static and dynamic versions. * Fixes a typo in the README.
2020-08-14Fix null pointer dereference in status.ByIndex (#628)michael boulton
`git_status_byindex` can return a null pointer if there is no statuses.
2020-07-30Add support for git_blob_is_binary (#625)Yuichi Watanabe
This adds IsBinary() func to Blob struct, which simply returns the result of git_blob_is_binary function. Refs: https://libgit2.org/libgit2/#HEAD/group/blob/git_blob_is_binary Issue: Add support for git_blob_is_binary #426 Fixes: #426
2020-07-25Fix installation of libgit2 into wrong libdir (#624)Patrick Steinhardt
Upstream libgit2 has migrated to use the GNUInstallDirs module to decide where things will be installed to by default. While it improves consistency with the host system, we're not really after that when building the vendored libgit2 library, and in fact libgit2.{a,pc} may now be installed into a different directory than before as it started to depend on the host platform. Fix this by explicitly specifying that we want the library and pkgconfig file to be installed into a plain "lib/" directory.