180 Commits

Author SHA1 Message Date
J. David Ibáñez
adb351f7b3 Show at least git error code when no git error message is available
Should help resolving issue #494
2015-02-20 11:35:10 +01:00
J. David Ibáñez
7130df3a5e Get back iter(Blame)
Was lost in commit cd0842592
2015-02-12 13:02:04 +01:00
J. David Ibáñez
d64dd15bd2 Merge remote-tracking branch 'carlos/merge-trees' 2015-02-10 09:34:49 +01:00
Carlos Martín Nieto
fcd4b9446b Introduce Repository.merge_trees()
This is the function which does the work for Repository.merge_commits()
and allows us more direct control over which trees we want to merge,
including trees which do not belong to commits.
2015-02-09 21:21:28 +01:00
J. David Ibáñez
fa380c0adb Merge remote-tracking branch 'gandalf/archive_enh'
Conflicts:
	pygit2/repository.py
2015-02-07 20:35:45 +01:00
J. David Ibáñez
30e57e13e3 Merge remote-tracking branch 'carlos/ahead-behind' 2015-02-07 08:27:26 +01:00
Carlos Martín Nieto
0ba17a5b46 Safer handling of string arrays
We need to keep hold of the strings which we create. We must also hold
on to the array of strings which we assing to our git_strarray.

We were not doing the latter, which meant that our strings may have been
freed too early, leaving us with with memory access errors (though often
not leading to a crash due to the custom allocator in python).

As we need to keep hold of two/three pieces of information, this looks
like a good place to introduce a context manager. This allows us to
keep these pointers alive without burdening the call sites with a return
of multiple objects they have no use for.
2015-02-06 03:51:05 +01:00
Carlos Martín Nieto
4709cae1a1 Add Repository.ahead_behind()
This lets us ask how many diverging commits each side of two histories
have.
2015-02-06 01:26:26 +01:00
J. David Ibáñez
7f21f6eb63 Expose the pygit2.GIT_REPOSITORY_INIT_* constants
Fixes #483
2015-02-01 10:53:19 +01:00
Alok Singhal
f5a5dfc18a Use "prefix" instead of "root_path" in write_archive 2015-01-30 10:15:08 -08:00
Alok Singhal
3ee1c798b2 Add an option to specify root path when creating archives 2015-01-29 08:46:50 -08:00
Alok Singhal
9771adf862 Fix handling of symlinks in write_archive(). 2015-01-29 08:35:27 -08:00
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