Commit Graph

56 Commits

Author SHA1 Message Date
Carlos Martín Nieto 538a05d55c Remove uses of deprecated git_buf_free 2018-08-08 11:51:51 +02:00
Carlos Martín Nieto 7d29d68644 Second round of keep-alives 2017-07-08 11:38:19 +02:00
Carlos Martín Nieto 5001942b59 Allow building statically via the "static" build tag 2017-04-14 12:36:42 +02:00
Carlos Martín Nieto 97f1722244 Merge pull request #332 from ezwiebel/rebase-wrapper
Rebase wrapper
2017-04-13 20:50:41 +02:00
Carlos Martín Nieto a41e2b6644 Update to 0.25-rc1 2016-11-19 15:09:41 +01:00
ezwiebel a671e67ee8 Took @carlosmn PR review into account 2016-11-01 10:59:32 +11:00
Carlos Martín Nieto 9c5fb973fc Get rid of the with-static.sh script
CGO can perform variable substitution in the directives, so we don't
need to use a script to set up the variables; we can let the go tool do
it for us.
2016-11-01 00:17:51 +01:00
Carlos Martín Nieto a37f7f30ff Panic if libgit2 is not thread-aware
Go calling C is inherently multi-threaded. If libgit2 cannot handle
threading, then we're going to crash at some random point. Crash right
at the start so we know what's happening.
2016-10-31 21:14:08 +01:00
Carlos Martín Nieto 8eb8fa3725 Also remove a pkg-config directive that snuck in 2016-08-27 21:35:26 +02:00
Carlos Martín Nieto 8eaae73f85 Error out if we detect an incompatible libgit2 version
The master version supports only v0.24 so let's enforce that via the
compiler.
2016-04-27 14:53:21 +02:00
Carlos Martín Nieto 2ae7d13ba1 Merge branch 'next' 2016-03-07 11:22:53 +01:00
Calin Seciu 367cd8eb9b Update libgit2 to 821131f
The API changes are:

- `*Remote.Connect`

  ```go
  // from:
  func (o *Remote) Connect(direction ConnectDirection, callbacks *RemoteCallbacks) error
  // to:
  func (o *Remote) Connect(direction ConnectDirection, callbacks *RemoteCallbacks, headers []string) error
  ```

- `*Remote.ConnectFetch` - `headers` was added as above
- `*Remote.ConnectPush` - `headers` was added as above
2015-10-26 16:20:18 +02:00
Carlos Martín Nieto f72db33baf Merge branch 'next' 2015-08-31 13:55:46 +02:00
Carlos Martín Nieto e50203a253 Merge remote-tracking branch 'upstream/master' into next
Conflicts:
	branch.go
2015-06-28 01:32:13 +02:00
Carlos Martín Nieto 36e0a256fe Update to libgit2 b6011e29 2015-06-08 04:11:21 +02:00
Carlos Martín Nieto 85fde1fcfb Merge remote-tracking branch 'origin/master' into next 2015-06-08 04:07:49 +02:00
Mike Edgar af7739787c Add error code matching GIT_EAUTH for authentication failures 2015-06-07 19:20:43 -04:00
Carlos Martín Nieto 7750e85fd1 Introduce an indirection layer for pointers
As the Go runtime can move stacks at any point and the C code runs
concurrently with the rest of the system, we cannot assume that the
payloads we give to the C code will stay valid for any particular
duration.

We must therefore give the C code handles which we can then look up in
our own list when the callbacks get called.
2015-05-22 09:02:24 +02:00
Carlos Martín Nieto e8da5affe7 Link dynamically to libgit2
With libgit2 v0.22 released, we can expect its API and ABI to remain
stable when installed on the system.

Linking dynamically allows us to use the go tool alone to build and
install the package.
2015-01-14 13:52:52 +01:00
Carlos Martín Nieto d57246fb74 Update to libgit2 master
This gets rid of the Push object. All network now goes through the
Remote object.
2015-01-04 17:05:11 +00:00
Carlos Martín Nieto ef83908059 Revert "Make the cgo tool do more linking work" 2014-12-31 19:43:20 +00:00
Carlos Martín Nieto 8f6e13bd08 Make the cgo tool do more linking work
The cgo directives let us do a lot more than I previously thought, so we
can use this to make the building process of git2go go through the go
tool directly rather than via the script.

libgit2 still needs to be built manually, so we do still require make,
but only for building libgit2. Once that's built, any modifications to
git2go's own code can be built with

    go build
2014-12-27 10:59:19 +00:00
Carlos Martín Nieto a9d993f3d1 Remove useless includes 2014-12-11 02:59:07 +01:00
Carlos Martín Nieto 1d759e3697 Update to master 2014-12-03 17:26:55 +01:00
Carlos Martín Nieto 668aa5dae1 Make the constants have types
While Go will assign the correct type to a const block when it
auto-creates the values, assigning makes the const be typeless and will
only gain it in each particular use.

Make each constant in the blocks have an assigned type.
2014-10-28 11:29:31 +01:00
Carlos Martín Nieto aabeb7f585 Really build statically 2014-06-07 15:43:05 +02:00
Carlos Martín Nieto 29a983b68f Switch default to static linking
Build in libgit2 statically into git2go by default, removing the need
for the right version to be available as a shared object.

We do still need to link dynamically against OpenSSL and LibSSH2.
2014-06-03 17:47:53 +02:00
Carlos Martín Nieto 5809f03108 Merge commit 'refs/pull/72/head' of github.com:libgit2/git2go
Conflicts:
	git.go
	wrapper.c
2014-04-26 20:51:21 +02:00
Jesse Ezell b00cb1a343 Merge remote-tracking branch 'libgit/master' into add-basic-diff-patch 2014-04-04 00:30:05 -07:00
Jesse Ezell 8982f4b3be adjust comments on error messages to standard godoc style 2014-04-04 00:14:31 -07:00
Jesse Ezell b660db0a4b make it possible to handle errors 2014-04-02 10:31:48 -07:00
Carlos Martín Nieto b2a2a279d9 Add a settings package
This lets us modify the libgit2-wide options/settings.
2014-03-25 09:27:05 +01:00
Jesse Ezell 37964e878f merge with latest 2014-03-20 22:02:19 -07:00
Jesse Ezell d0b334b244 cleanup and refactor diff / patch 2014-03-20 21:56:41 -07:00
Carlos Martín Nieto b82a72a9ce Oid: fix IsZero()
We need to compare against the number zero, not its ASCII value.
2014-03-19 03:58:02 +01:00
Carlos Martín Nieto 0bb73e43a8 Oid: use Go's conversion functions
Go already has all the necessary pieces for encoding and decoding hex
strings. Using them let's us avoid going into C land.

Benchmarks show this takes about half the time as using libgit2's
functions.
2014-03-19 03:57:36 +01:00
Carlos Martín Nieto c243c31f7d Oid: remove Bytes()
This is not needed. We can do id[:] to get a slice.
2014-03-19 03:56:50 +01:00
Carlos Martín Nieto c9c7c1e779 Oid: make NewOid take a string
This is the most common way of having an id that's not in Oid form, so
let's make it the "default" and rename to NewOidFromBytes() the one that
takes []byte.
2014-03-19 03:56:50 +01:00
Carlos Martín Nieto b6703d4767 Oid: make the type directly [20]byte
There is no need for a struct with a single field. An Oid is 20 bytes
which hold the binary representation of the hash, so let's use that
directly. Go lets us have methods on this new type just the same.
2014-03-19 03:56:50 +01:00
Jesse Ezell e2db9b16cd merge latest, cleanup error handling, add thread locks 2014-02-26 10:41:20 -08:00
Jesper Hansen 499f52a354 Added git error code to the error object. 2014-02-26 16:10:00 +01:00
Carlos Martín Nieto 1b09b03c0e Merge commit 'refs/pull/53/head' of github.com:libgit2/git2go
On top: fix git_buf handling and rename signature

This fixes #57, #54.

Conflicts:
	git.go
	reference.go
	repository.go
	submodule.go
2014-02-23 15:31:22 +01:00
Aidan Nulman f66502aaf4 update git2go to support latest libgit2 development commit (id: 66af84) 2014-01-29 18:01:26 -05:00
Jason Toffaletti e825d66fba work in progress wrapping git_clone 2014-01-04 00:40:21 +00:00
Carlos Martín Nieto a40bdfd420 Lock the OS thread when acessing errors
The library stores error information in thread-local storage, which
means we need to make sure that the Go runtime doesn't switch OS
threads between the time we call a function and th time we attempt to
retrieve the error information.
2013-12-18 16:18:32 +01:00
Carlos Martín Nieto a33875f9c5 Packbuilder: compilation fixes
Don't name the return values, as they conflict with the names we want
inside and the types don't match what we want to have inside. We need
them to be two-way channels in the function, and then pass
unidirectional references to the different functions.
2013-06-17 01:55:36 +02:00
Vicent Martí 09424744a1 Merge pull request #25 from carlosmn/error-nil
Catch nil error instances
2013-06-13 10:14:31 -07:00
Vicent Martí 7823b14266 Merge pull request #26 from carlosmn/ref-iter
Implement a reference iterator
2013-06-13 10:14:09 -07:00
Carlos Martín Nieto 931f187301 Implement a reference iterator
Wrap the reference iterators, and provide a Iter() function to get
them through a channel.
2013-05-23 11:13:42 +02:00
Axel Wagner 535a178afa Implement ShortenOids 2013-05-21 23:03:11 +02:00