168 Commits

Author SHA1 Message Date
J. David Ibáñez
d63c2d4fd7 Merge remote-tracking branch 'carlos/diff-stats' 2015-04-29 10:47:21 +02:00
Carlos Martín Nieto
5b50579790 Add a recipe for git clone --mirror
It's not necessarily obvious how to perform a mirror, so add a recipe
which tells what git does as well as provide example code of how to
perform the same steps in pygit2.
2015-04-28 19:53:39 +02:00
Carlos Martín Nieto
42d81e33ec Add DiffStats
This wraps git_diff_stats and can be retrieved through a Diff. It
includes a formatting method.
2015-04-28 16:21:56 +02:00
J. David Ibáñez
c072a77e4b Merge remote-tracking branch 'rmoehn/diff-iter' 2015-04-23 12:45:44 +02:00
Richard Möhn
1b9cb54927 Add hint to Diff.__iter__()
I'm not the guy who looks at examples in the first place and I guess
there are other people like me. When I wanted find out how to get
information out of a Diff, I looked at the documented methods and didn't
find anything. Only later @cmn showed me the [p for p in diff] example
in the documentation. Add a short piece of information that gives a hint
to those who prefer the dry API docs.
2015-04-23 16:38:55 +09:00
Richard Möhn
b3025e3fe1 Add git-cherry-pick recipes
Add the way that worked for me. Not sure if it is idiomatic. When doing
the convenience-mode cherry-pick, the repo remains in cherry-picking
mode afterwards. I've already added an issue for this.
2015-04-22 17:14:45 +09:00
Patrick Steinhardt
f923e20f2d submodule: reimplement with Python CFFI.
The submodule type has been implemented as a C type. When opening
a submodule's repository this leads to the bug that instead of an
actual pygit2.Repository being instantiated we only create an
object of the C Repository type.

As this is not trivially fixed within the C code, reimplement the
submodule type as a Python interface with CFFI. As submodules
provide no functionality that is usually accessed repeatedly the
code paths should not prove performance critical. In addition,
maintainability is improved by this reimplementation.
2015-04-16 11:36:41 +02:00
Vladimir Rutsky
ca39a65054 fix typo: "Troobleshooting" 2015-03-30 14:19:58 +03:00
J. David Ibáñez
50a70086bf Merge remote-tracking branch 'pks/submodules' 2015-03-09 19:06:44 +01:00
Kaarel Kitsemets
2d3f9d8e55 Added info about pkg-config being an optional requirement 2015-03-07 12:44:32 +02:00
Patrick Steinhardt
404645042b Add Submodule type. 2015-03-04 14:10:41 +01:00
kitsemets
ef67c36d8c docs/install.rst: added pkg-config as a dependency for building libgit2. Without pkg-config it is not possible to build libgit2 with ssh support. 2015-02-26 16:00:27 +02:00
J. David Ibáñez
fbb11775a3 Update changelog 2015-02-14 21:27:34 +01:00
J. David Ibáñez
82d5214321 Merge remote-tracking branch 'rmoehn/master' 2015-02-13 16:30:54 +01:00
Richard Möhn
1cb62ab578 git-show recipe: Add the easy Python 3 way
As @jdavid pointed out, Python 3 already provides a tzinfo subclass for
fixed UTC offsets. Incorporate this in the recipe. Leave the old code
with the self-made class, since many people are working with Python 2
and it is harder to find out there.
2015-02-13 13:46:41 +01:00
Richard Möhn
69f539851b Clarify comments in git-show recipe 2015-02-13 09:03:16 +01:00
J. David Ibáñez
94be744ba6 docs: remove reference to LIBGIT2 in OS X notes
As disscussed in PR #448
2015-02-12 09:32:58 +01:00
J. David Ibáñez
40946cd795 Merge remote-tracking branch 'holgi/master' 2015-02-12 09:32:18 +01:00
Richard Möhn
2b2beb8094 Correct git-show recipe
Make the diff generation more idiomatic and fix the assembling of the
timestamp. git-show normally prints the author time, so use this instead
of the commit time. Also fix how tzinfo is obtained. Of course we have
to use the author's time zone and not some fixed one as I had written
before.
2015-02-12 09:08:24 +01:00
Richard Möhn
c87d28c9a8 Update git-show recipe
I couldn't get the diff as shown in the git-show recipe. Therefore
update it to what I think it should be. Maybe there is a better way.

Also add a section on how to assemble a git show-like message. It took
me quite some searching in the Python docs to find out how to do it,
especially the date and time part. So this might save people time. I
wanted to add something that gives me a git show --stat equivalent, but
couldn't figure it out.
2015-02-11 18:00:00 +01:00
Carlos Martín Nieto
d4da228c0e Add documentation for merge_commits() and merge_trees() 2015-02-09 21:25:33 +01:00
J. David Ibáñez
718a2df1d5 Fix building the docs 2015-02-07 08:37:41 +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
e7fdaf2510 Fix link to travis image (use master) 2015-01-23 23:19:13 +01:00
J. David Ibáñez
061961f119 Rename pygit2.Hunk to pygit2.DiffHunk
Comes from PR #346
2015-01-23 13:38:13 +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
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
52ac41a362 Make it explicit that Refspec objects are not for construction 2015-01-12 18:20:11 -08:00
Carlos Martín Nieto
78695aa93a Change required version to 0.22 2015-01-12 20:00:17 +01:00
Richard Möhn
22d1aef50d Remove obsolete git-branch recipe
The git-branch recipe says: »Note that the next release will probably
allow repo.listall_branches().« Concluding from the README,
Repository.listall_branches() was included in some release prior to
0.20.0, so at least that statement is obsolete.

However, since pygit2.org brings up fairly accurate results for a search
on »list all branches«, I figured that the whole recipe isn't needed
anymore. Therefore delete it.
2015-01-05 10:27:43 +01:00
Kevin KIN-FOO
aff3a64e2d Mention libssh2 in installation#requirements
Fixes #456
2014-12-30 16:08:07 +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
Holger Frey
d4fc7010b3 Added installing on OS X 2014-11-09 10:39:07 +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
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
7653d12c72 docs: review install section 2014-10-30 13:45:54 +01:00
J. David Ibáñez
6bb2b369fa Merge remote-tracking branch 'wking/instaleld-typo' 2014-10-28 09:25:42 +01:00
J. David Ibáñez
7daa95a3a5 Merge remote-tracking branch 'wking/install-filing-typo' 2014-10-28 09:23:52 +01:00
W. Trevor King
6677de82c2 docs/install: Fix 'instaleld' -> 'installed' typo 2014-10-27 21:36:06 -07:00
W. Trevor King
8ca75e2744 docs/install: Fix 'filling un' -> 'filing a' typo 2014-10-27 21:31:55 -07:00
W. Trevor King
05c570c3fc docs/working-copy: Replace 'del index[path]' with index.remove(path)
Catch up with b12a5960 (Remove "del index[xxx]" from the API,
2013-05-02).
2014-10-27 21:03:37 -07:00
W. Trevor King
120fdedb5a docs/merge: default_signature is an attribute, not a method
Avoid:

  >>> repo.default_signature()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: '_pygit2.Signature' object is not callable
2014-10-26 16:36:34 -07:00
Carlos Martín Nieto
b98e9e85de Reference: implement peel()
This makes both objects and references peelable via the same interface,
simplifying how to get to the wanted type.
2014-10-07 20:27:01 +02:00
J. David Ibáñez
6831983a26 docs: now "pip install pygit2" installs cffi first
This was fixed in PR#407
2014-09-24 09:33:25 +02:00
Soasme
8bb263559d Fix typo pìp to pip 2014-09-24 09:53:39 +08: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
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
Carlos Martín Nieto
70410349ff Update reference documentation 2014-08-28 01:25:21 +02:00