168 Commits

Author SHA1 Message Date
J. David Ibáñez
8a6e61551c Merge remote-tracking branch 'Sheeo/master' 2015-01-19 13:56:32 +01:00
J. David Ibáñez
126308403b Get ready to release v0.22.0 2015-01-16 16:35:19 +01:00
J. David Ibáñez
b538163536 Merge remote-tracking branch 'carlos/development'
Conflicts:
	pygit2/remote.py
2015-01-16 11:16:02 +01:00
J. David Ibáñez
9c9b925da8 Revert "Mentioning libssh2 in remote's pydoc"
This reverts commit e807ad43d725da06bfc34187b387270baea74887.
2015-01-16 10:24:06 +01:00
Carlos Martín Nieto
d0b00e3124 Add support for libgit2 feature detection
This lets us ask the library whether it supports threading, https and
ssh.
2015-01-14 20:47:47 +01:00
Matthew Duggan
b2abfdec9e Note that Refspec constructor is internal. Fix typo. 2015-01-12 18:23:03 -08:00
Matthew Duggan
34fb1c00eb Make it explicit that respecs are added as strings. 2015-01-12 18:22:25 -08:00
Matthew Duggan
5a06cd2688 Make it explicit what to do when no passphrase is needed 2015-01-12 18:20:07 -08:00
Carlos Martín Nieto
66d55aee7e Add certificate callback for clone
We do not pass anything as the certificate, as there doesn't seem to be
anything sensible for checking it.
2015-01-12 18:39:21 +01:00
Carlos Martín Nieto
f68b266e60 Remote: generalize push()
Move to use git_remote_push() instead of doing the steps ourselves. We
also change to accept a list of refspecs instead of just the one refspec
for the push method.

As part of this, we no longer error out if the server rejected any
updates, as this is a different concern from whether the push itself
failed or not. We do still error out if we attempt to push non-ff
updates.
2015-01-12 18:39:21 +01:00
Carlos Martín Nieto
1dbf94011a Migrate to 0.22
Apart from the usual API changes, we now need to introduce the concept
of whether we still own the C object underneath our Repository and
Remote objects.

When using the custom callbacks for repository and remote creation
during clone, we pass the pointer and thus ownership of the object back
to the library. We will then get the repository back at the end.

We return the object which was handed to us rather than opening the
repository again with the local path as there is now a much higher
chance that the cloned repository does not use the standard backends.
2015-01-12 18:39:21 +01:00
Lukas Fleischer
4cbfade973 Fix data type of options in init_repository()
Initializers for the char * fields of the git_repository_init_options
structure must be cdata pointers.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2015-01-10 21:30:26 +01:00
Kevin KIN-FOO
e807ad43d7 Mentioning libssh2 in remote's pydoc 2014-12-30 16:34:15 +01:00
Michael Sondergaard
df0e11726e Make pygit work in a frozen environment 2014-11-26 06:04:40 +01:00
J. David Ibáñez
beff871923 Minor styling 2014-11-12 10:21:47 +01:00
Carlos Martín Nieto
b80103b017 Introduce RemoteCollection
This lets us look up remotes by name, which is not possible by just
returning the list of remotes.

Move remote creation to Repostiory.remotes.create() and keep the old
Repository.create_remote() for compatibility, delegating to this new
way.

Existing code should keep working, but this moves us towards what we'd
need for a better interface in 0.22 which makes remote renaming and
deleting work with a name rather than an instance and would make sense
to exist as part of an Remote.remotes object.
2014-11-11 19:57:22 +01:00
J. David Ibáñez
21e2102e7c Get ready for 0.21.4 release 2014-11-04 17:49:43 +01:00
J. David Ibáñez
cb310316bf docs: fix build errors in the blame chapter 2014-11-03 18:53:38 +01:00
Carlos Martín Nieto
ab52904c5d Merge branch 'push-callback' 2014-11-03 13:27:53 +01:00
chengyuhang
45be961d60 set remote callback before push 2014-11-03 13:27:33 +01:00
J. David Ibáñez
1f0466fe49 Merge remote-tracking branch 'carlos/merge-commits' 2014-10-31 10:28:08 +01:00
J. David Ibáñez
8e933c8019 issue#441: change modulename to include hash of source
This should make it work both for users and developers.
2014-10-30 19:41:25 +01:00
J. David Ibáñez
94f650a41d Fix (again) the chicken-and-egg problem with cffi
Broken with previous commits :)
2014-10-30 17:59:38 +01:00
Carlos Martín Nieto
bc8b29b4f3 Repository: allow passing a favor option to merge_commits
I've gone with taking a string and converting it because the depth of
the namespacing in the libgit2 name is rather large and we don't care
about the global namespace that C has; and this also lets us pass the
same as the '-X' option to git-merge.
2014-10-30 16:21:22 +01:00
Carlos Martín Nieto
3b27e16d08 Add Repository.merge_commits()
This allows you to merge arbitrary commits, returning an index, which is
useful when dealing with bare repos in which we want to merge.
2014-10-30 15:04:51 +01:00
J. David Ibáñez
01067cb77f Make cffi extension name to be constant
This should fix issue #441
2014-10-29 12:33:02 +01:00
J. David Ibáñez
93dd545069 Fix import error introduced in previous commit 2014-10-29 12:05:19 +01:00
J. David Ibáñez
e325c51203 Refactor code to get the path to libgit2 2014-10-28 16:31:53 +01:00
W. Trevor King
149bb1e9e2 index: Add missing 'tree' entry to diff_to_tree docstring argspec
It's been missing since the original argspec was added with 5ed9eb4
(Add documentation for conflicts and fixup Index, 2014-07-10).
2014-10-26 15:37:15 -07:00
Carlos Martín Nieto
b8efdde626 Merge pull request #434 from carlosmn/diff-refactor
Repository: make use of peel for diff()
2014-10-10 11:57:18 +02:00
Carlos Martín Nieto
fa20589fe9 Merge pull request #424 from kyriakosoikonomakos/ssh-agent
authenticate using ssh agent
2014-10-10 11:44:05 +02:00
Carlos Martín Nieto
59da03476e Repository: make use of peel for diff()
Instead of trying to reimplement parts of it, make use of Object.peel()
and Reference.peel() to get to a Blob or Tree.
2014-10-07 20:27:01 +02:00
J. David Ibáñez
510f6174f1 Fix Repository.diff for references an empty trees
This should fix issue #432

By the way make the code a little more robust.
2014-10-07 18:59:04 +02:00
Ash Berlin
9aa39aafbc Use ssh_agent when pub+priv key are None, not based on the class 2014-10-07 09:48:47 +01:00
Alexander Bayandin
548ba1ab84 Fix typo 2014-09-16 18:37:45 +04:00
Kyriakos Oikonomakos
3e87adaccd authenticate using ssh agent 2014-09-15 18:14:20 +01:00
J. David Ibáñez
c997037c7b Get ready for 0.21.3 release 2014-09-15 12:39:27 +02:00
Carlos Martín Nieto
7d34d2bb27 Use the initializer for repository init options 2014-09-13 18:58:36 +02:00
Carlos Martín Nieto
63377aad78 Properly initialize the clone options
libgit2 provides an initialization function to set sane defaults. Use
that instead of setting the version by hand, as that's not the only
thing it does.

Using C.git_clone_init_options() sets the checkout strategy to SAFE,
which will checkout the files after the clone, instead of the implicit
NONE which we're setting by hand.

This fixes #425,
2014-09-13 18:58:36 +02:00
Carlos Martín Nieto
ab730cb1d4 Provide a method to write a tree to an archive
Add Repository.write_archive() to write a given tree to an archive. As
there are many customisation options, we only provide a method to write
to an archive which is created by the user.
2014-09-06 18:59:15 +02:00
J. David Ibáñez
82167827bc Merge remote-tracking branch 'carlos/reference-update' 2014-09-05 17:11:32 +02:00
Carlos Martín Nieto
a3e7a115f4 Provide method for deleting a remote
Fixes #418
2014-09-04 15:57:05 +02:00
Carlos Martín Nieto
747e7c2136 Repository: make head read-only and introduce set_head()
Following from the previous commits, make 'head' read-only and provide a
method to update head while providing a message.

The checkout() codepath which switches branches has been updated to
provide a reflog entry which mimics git's.
2014-09-04 01:58:05 +02:00
Carlos Martín Nieto
70256d1a00 remote: clear self handle only on error
When setting the callbacks fails, we want to clear self._self_handle so
we don't leak a pointer to ourselves.

The current code used a 'finally' clause which clears it
unconditionally, which means that by the time the fetch starts, we have
no guarantee that the handle will be valid.

Replace that with an except and re-raise to make sure we only clear it
here if there was an error.
2014-09-03 19:06:34 +02:00
Carlos Martín Nieto
cd08425927 Move blame to cffi
This requires fairly little work on the pygit2 side to kick off all the
searching on the libgit2 side, so it's a fairly good candidate.

This changes the return value for the commit ids to Oid instead of
strings, which is what we generally try to return.
2014-08-31 22:35:32 +02:00
J. David Ibáñez
a53d8b2213 Merge remote-tracking branch 'djmattyg007/doc_fixes' 2014-08-26 10:31:53 +02:00
J. David Ibáñez
fe5c9d68c3 Merge remote-tracking branch 'djmattyg007/branches_are_references' 2014-08-26 10:15:33 +02:00
J. David Ibáñez
617dd34f5e Merge remote-tracking branch 'carlos/checkout-branch' 2014-08-26 10:09:32 +02:00
J. David Ibáñez
dad9bc3612 Merge remote-tracking branch 'mduggan/remote-refcount-fix' 2014-08-26 10:02:07 +02:00
Matthew Duggan
2f2d4005c7 Ensure self handle stays alive - keeping it in callbacks is not enough. 2014-08-25 22:39:16 +09:00