Commit Graph

32 Commits

Author SHA1 Message Date
lhchavez dbe032c347
Make all non-user-creatable structures non-comparable (#802)
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-05 13:59:36 -07:00
lhchavez 15434610fe
Add `CreateCommitWithSignature` (#782)
This change adds the wrapper for `git_commit_create_with_signature`.
2021-09-04 13:49:01 -07:00
lhchavez fbaf9d1d1a
Add `Repository.CreateCommitBuffer` (#781)
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-04 13:04:58 -07:00
michael boulton 7d4453198b
Add support for creating signed commits and signing commits during a rebase (#626) 2020-08-18 09:25:31 -07:00
Takuji Shimokawa fe0f562cc0 Add Commit.MessageEncoding() method. 2019-05-10 20:31:01 +09:00
Carlos Martín Nieto 538a05d55c Remove uses of deprecated git_buf_free 2018-08-08 11:51:51 +02:00
Carlos Martín Nieto 7f685a6ee6 Add Objecer interface
We do want to be able to accept generic objects in functions. Add this interface
so we can accept that instead of specific object types.
2017-07-08 22:53:50 +02:00
Carlos Martín Nieto 58334cf604 First round of mass keep-alive additions 2017-07-08 09:11:38 +02:00
Carlos Martín Nieto 0e9336be3f commit: add keep-alives for those that need conversion to pointer receivers
We can't work on the copies here, we need to have pointer receivers so we know
we're keeping alive the object whose finalizer would free the unmanaged memory
we're working with.
2017-07-07 23:36:04 +02:00
Carlos Martín Nieto 5d466ffbc0 commit: add thread locking to signature extraction 2017-07-07 23:24:54 +02:00
KatolaZ f7e15669c8 Added Commit.ExtractSignature to wrap git_commit_extract_signature 2017-07-06 08:40:58 +01:00
Karsten Dambekalns d2b8c99ba7 Add method to fetch raw commit message
The existing `Commit.Message()` returns the trimmed commit message. In some cases
it is important to retrieve the exact commit message, even if it contains surrounding
newlines.

This adds a new `Commit.RawMessage()` to be able to do that.
2016-09-09 15:27:07 +02:00
Carlos Martín Nieto b7159b0cd4 Move from an Object interface to a type
An Object should be about representing a libgit2 object rather than
showing which methods it should support.

Change any return of Object to *Object and provide methods to convert
between this and the particular type.
2015-08-04 14:47:10 +02:00
Mark Probst 43102043fb Add Commit.Amend 2015-03-23 12:02:16 -07:00
Mark Probst 9eae50f29a Add commit summary getter 2015-03-04 15:53:00 -08:00
Mark Probst e439b931a6 Default signature 2015-03-04 15:52:57 -08:00
Carlos Martín Nieto a9d993f3d1 Remove useless includes 2014-12-11 02:59:07 +01:00
Carlos Martín Nieto 8a73c75f1a Keep a pointer to the repository in the objects and references
Otherwise, the garbage collector might decide it's a good idea to throw
away the repository instance while the C object still has a pointer to
it. Hilarity ensues.
2014-05-26 09:28:07 +02:00
Carlos Martín Nieto a06f4a030a Adjust to Go tip changes
It does not like breaking aliasing rules, so let's keep a casted pointer
for when libgit2 wants that.
2014-04-01 12:36:44 +02: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
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
Artiom Di 5e30c192e9 Fix memleak for Config and parent commit objects 2013-11-14 15:24:43 +02:00
Vicent Martí 62f65d071d Merge pull request #13 from libgit2/polymorphism-take-2
My take on polymorphism
2013-06-13 10:15:36 -07:00
Axel Wagner 543a6a87af Implement Parent()-functions for Commits 2013-05-21 23:18:02 +02:00
Vicent Marti 2bf17ba2f1 Ok, now with shared base object 2013-04-18 00:54:46 +02:00
Vicent Marti d190d8a6b3 Take 2 on polymorphism 2013-04-16 23:04:35 +02:00
Carlos Martín Nieto 32a62bb01a Use time.Time in the Signature struct 2013-03-06 20:28:39 +01:00
Vicent Marti 20e2528478 Repository.CreateCommit 2013-03-06 16:59:45 +01:00
Carlos Martín Nieto d43561fbf7 Free Git objects via finalizers or manually
Provide a manual way of freeing objects, but set finalizers for them
in case the user does not want to worry about memory management, which
would be useful for commits or trees, which sare typically small.

When the objects are freed manually, the finalizer is unset to avoid
double-freeing, mimicking what the go runtime does.
2013-03-06 01:47:53 +01:00
Carlos Martín Nieto dce75a8974 Introduce Signature
It brings the data into go-land so we don't have to worry about the
commit being there. It stores the data we get from git and provides a
Time() function to get a time.Time struct.
2013-03-05 23:18:07 +01:00
Vicent Marti b1d50b70ea Initial commit 2013-03-05 20:53:04 +01:00