Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gitpython-developers/GitPython
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: gitpython-developers/GitPython
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: experiment-2012
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
Loading
Showing with 22,323 additions and 13,856 deletions.
  1. +1 −0 .gitignore
  2. +7 −3 .gitmodules
  3. +6 −60 README.rst
  4. +30 −2 doc/source/changes.rst
  5. +23 −17 doc/source/intro.rst
  6. +16 −2 doc/source/tutorial.rst
  7. +19 −18 git/__init__.py
  8. +318 −0 git/base.py
  9. +586 −500 git/cmd.py
  10. +435 −393 git/config.py
  11. +0 −61 git/db.py
  12. +6 −0 git/db/__init__.py
  13. +4 −0 git/db/cmd/__init__.py
  14. +878 −0 git/db/cmd/base.py
  15. +16 −0 git/db/cmd/complex.py
  16. +48 −0 git/db/compat.py
  17. +36 −0 git/db/complex.py
  18. +13 −0 git/db/dulwich/__init__.py
  19. +91 −0 git/db/dulwich/complex.py
  20. +848 −0 git/db/interface.py
  21. +4 −0 git/db/py/__init__.py
  22. +481 −0 git/db/py/base.py
  23. +118 −0 git/db/py/complex.py
  24. +261 −0 git/db/py/loose.py
  25. +113 −0 git/db/py/mem.py
  26. +212 −0 git/db/py/pack.py
  27. +79 −0 git/db/py/ref.py
  28. +365 −0 git/db/py/resolve.py
  29. +34 −0 git/db/py/submodule.py
  30. +59 −0 git/db/py/transport.py
  31. +12 −0 git/db/pygit2/__init__.py
  32. +94 −0 git/db/pygit2/complex.py
  33. +332 −328 git/diff.py
  34. +93 −38 git/exc.py
  35. +1 −0 git/ext/async
  36. +0 −1 git/ext/gitdb
  37. +1 −0 git/ext/smmap
  38. +692 −0 git/fun.py
  39. +1 −1 git/index/__init__.py
  40. +1,128 −1,118 git/index/base.py
  41. +298 −291 git/index/fun.py
  42. +149 −147 git/index/typ.py
  43. +68 −61 git/index/util.py
  44. +3 −3 git/objects/__init__.py
  45. +182 −159 git/objects/base.py
  46. +27 −21 git/objects/blob.py
  47. +461 −450 git/objects/commit.py
  48. +187 −184 git/objects/fun.py
  49. +4 −0 git/objects/submodule/__init__.py
  50. +919 −898 git/objects/submodule/base.py
  51. +307 −294 git/objects/submodule/root.py
  52. +88 −77 git/objects/submodule/util.py
  53. +67 −64 git/objects/tag.py
  54. +270 −261 git/objects/tree.py
  55. +286 −276 git/objects/util.py
  56. +278 −146 git/odict.py
  57. +1,006 −0 git/pack.py
  58. +6 −5 git/refs/__init__.py
  59. +79 −238 git/refs/head.py
  60. +168 −0 git/refs/headref.py
  61. +274 −268 git/refs/log.py
  62. +120 −77 git/refs/reference.py
  63. +42 −58 git/refs/remote.py
  64. +652 −611 git/refs/symbolic.py
  65. +80 −83 git/refs/tag.py
  66. +280 −590 git/remote.py
  67. +46 −0 git/repo.py
  68. +0 −3 git/repo/__init__.py
  69. +0 −753 git/repo/base.py
  70. +0 −284 git/repo/fun.py
  71. +698 −0 git/stream.py
  72. +9 −0 git/test/__init__.py
  73. +4 −0 git/test/db/__init__.py
  74. +634 −0 git/test/db/base.py
  75. +4 −0 git/test/db/cmd/__init__.py
  76. +89 −0 git/test/db/cmd/test_base.py
  77. +4 −0 git/test/db/dulwich/__init__.py
  78. +25 −0 git/test/db/dulwich/lib.py
  79. +30 −0 git/test/db/dulwich/test_base.py
  80. +246 −0 git/test/db/lib.py
  81. +4 −0 git/test/db/py/__init__.py
  82. +16 −0 git/test/db/py/test_base.py
  83. +51 −0 git/test/db/py/test_git.py
  84. +36 −0 git/test/db/py/test_loose.py
  85. +31 −0 git/test/db/py/test_mem.py
  86. +76 −0 git/test/db/py/test_pack.py
  87. +60 −0 git/test/db/py/test_ref.py
  88. +4 −0 git/test/db/pygit2/__init__.py
  89. +25 −0 git/test/db/pygit2/lib.py
  90. +30 −0 git/test/db/pygit2/test_base.py
  91. +20 −0 git/test/db/test_base.py
  92. +4 −0 git/test/fixtures/diff_rename_raw
  93. +16 −5 git/test/fixtures/git_config
  94. +4 −0 git/test/fixtures/git_config_values
  95. BIN git/test/fixtures/objects/7b/b839852ed5e3a069966281bb08d50012fb309b
  96. BIN git/test/fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.idx
  97. BIN git/test/fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack
  98. BIN git/test/fixtures/packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.idx
  99. BIN git/test/fixtures/packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.pack
  100. BIN git/test/fixtures/packs/pack-c0438c19fb16422b6bbcce24387b3264416d485b.idx
  101. BIN git/test/fixtures/packs/pack-c0438c19fb16422b6bbcce24387b3264416d485b.pack
  102. +7 −2 git/test/lib/__init__.py
  103. +13 −5 git/test/lib/asserts.py
  104. +212 −0 git/test/lib/base.py
  105. +294 −214 git/test/lib/helper.py
  106. 0 git/test/objects/__init__.py
  107. +16 −0 git/test/objects/lib.py
  108. +23 −0 git/test/objects/test_blob.py
  109. +279 −0 git/test/objects/test_commit.py
  110. +593 −0 git/test/objects/test_submodule.py
  111. +145 −0 git/test/objects/test_tree.py
  112. +2 −0 git/test/performance/__init__.py
  113. 0 git/test/performance/db/__init__.py
  114. +133 −0 git/test/performance/db/looseodb_impl.py
  115. +74 −0 git/test/performance/db/odb_impl.py
  116. +111 −0 git/test/performance/db/packedodb_impl.py
  117. +12 −0 git/test/performance/db/test_looseodb_cmd.py
  118. +13 −0 git/test/performance/db/test_looseodb_dulwich.py
  119. +6 −0 git/test/performance/db/test_looseodb_pure.py
  120. +13 −0 git/test/performance/db/test_looseodb_pygit2.py
  121. +6 −0 git/test/performance/db/test_odb_cmd.py
  122. +13 −0 git/test/performance/db/test_odb_dulwich.py
  123. +6 −0 git/test/performance/db/test_odb_pure.py
  124. +13 −0 git/test/performance/db/test_odb_pygit2.py
  125. +92 −0 git/test/performance/db/test_packedodb_pure.py
  126. +52 −54 git/test/performance/lib.py
  127. 0 git/test/performance/objects/__init__.py
  128. +103 −0 git/test/performance/objects/test_commit.py
  129. +0 −99 git/test/performance/test_commit.py
  130. +0 −70 git/test/performance/test_odb.py
  131. +0 −131 git/test/performance/test_streams.py
  132. +176 −165 git/test/performance/test_utils.py
  133. 0 git/test/refs/__init__.py
  134. +100 −0 git/test/refs/test_reflog.py
  135. +540 −0 git/test/refs/test_refs.py
  136. +0 −36 git/test/test_actor.py
  137. +195 −86 git/test/test_base.py
  138. +0 −23 git/test/test_blob.py
  139. +76 −19 git/test/{test_git.py → test_cmd.py}
  140. +0 −275 git/test/test_commit.py
  141. +66 −35 git/test/test_config.py
  142. +0 −25 git/test/test_db.py
  143. +127 −100 git/test/test_diff.py
  144. +64 −0 git/test/test_example.py
  145. +242 −240 git/test/test_fun.py
  146. +59 −0 git/test/test_import.py
  147. +691 −653 git/test/test_index.py
  148. +245 −0 git/test/test_pack.py
  149. +0 −102 git/test/test_reflog.py
  150. +0 −521 git/test/test_refs.py
  151. +137 −128 git/test/test_remote.py
  152. +0 −609 git/test/test_repo.py
  153. +11 −6 git/test/test_stats.py
  154. +153 −0 git/test/test_stream.py
  155. +0 −547 git/test/test_submodule.py
  156. +0 −144 git/test/test_tree.py
  157. +272 −91 git/test/test_util.py
  158. +29 −0 git/typ.py
  159. +912 −561 git/util.py
  160. +69 −66 setup.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@
/dist
/doc/_build
nbproject
.nosebazinga
10 changes: 7 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[submodule "gitdb"]
path = git/ext/gitdb
url = git://github.com/gitpython-developers/gitdb.git
[submodule "async"]
path = git/ext/async
url = http://github.com/gitpython-developers/async.git
branch = master
[submodule "smmap"]
path = git/ext/smmap
url = http://github.com/Byron/smmap.git
branch = master
66 changes: 6 additions & 60 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,63 +1,9 @@
==========
GitPython
==========
===================
DEPRECATION WARNING
===================

GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing.
This branch contains an abandoned experiment which aimed to change the architecture of git-python entirely. However, as it was never finished, it was good for quite a bit of confusion only.

It provides abstractions of git objects for easy access of repository data, and additionally allows you to access the git repository more directly using either a pure python implementation, or the faster, but more resource intensive git command implementation.
For the most recent state, please refer to the default branch you find on github.

The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming.

REQUIREMENTS
============

* Git ( tested with 1.7.3.2 )
* Python Nose - used for running the tests
* Mock by Michael Foord used for tests. Requires 0.5

INSTALL
=======
If you have downloaded the source code:

python setup.py install

or if you want to obtain a copy more easily:

easy_install gitpython

A distribution package can be obtained for manual installation at:

http://pypi.python.org/pypi/GitPython

SOURCE
======

GitPython's git repo is available on GitHub, which can be browsed at:

https://github.com/gitpython-developers/GitPython

and cloned using:

git clone git://github.com/gitpython-developers/GitPython.git git-python


DOCUMENTATION
=============
The html-compiled documentation can be found at the following URL:

http://packages.python.org/GitPython/

MAILING LIST
============
http://groups.google.com/group/git-python

ISSUE TRACKER
=============
Issues are tracked on github:

https://github.com/gitpython-developers/GitPython/issues

LICENSE
=======

New BSD License. See the LICENSE file.
Thank you.
32 changes: 30 additions & 2 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
@@ -4,8 +4,36 @@ Changelog

NEXT
====
* Blob Type
* Added mode constants to ease the manual creation of blobs
* ### Class Renames ###

* Renamed **GitCmdObjectDB** to **CmdGitDB** (analogue to **PureCmdDB**)

* ### Interface Changes ###

* **SymbolicReference**

* object_binsha property added

* **Blob** Type

* Added mode constants to ease the manual creation of blobs

* **Repo** (i.e. **HighLevelRepository**) now supports a progress instance to be provided for its ``clone()`` and ``clone_from`` methods.

* ### Module Changes ###

* Removed rev_parse function from git.repo.fun - the respective functionality is available only through the repository's rev_parse method, which might in turn translate to any implementation.

* ### Git Cmd ###

* Added ``version_info`` property to git command, returning a tuple of version numbers.
* Added GIT_PYTHON_GIT_EXECUTABLE environment variable, which can be used to set the desired git executable to be used. despite of what would be found in the path.
* GIT_PYTHON_TRACE is now set on class level of the Git type, previously it was a module level global variable.
* GIT_PYTHON_GIT_EXECUTABLE is a class level variable as well.

* ### Exceptions ###

* There is a new common base for all exceptions git-python will throw, namely `GitPythonError`.

0.3.1 Beta 2
============
40 changes: 23 additions & 17 deletions doc/source/intro.rst
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Requirements
* `GitDB`_ - a pure python git database implementation

* `async`_ - asynchronous task scheduling

* `Python Nose`_ - used for running the tests
* `Mock by Michael Foord`_ used for tests. Requires version 0.5

@@ -36,9 +36,9 @@ Installing GitPython is easily done using
`setuptools`_. Assuming it is
installed, just run the following from the command-line:

.. sourcecode:: none
.. sourcecode:: console

# easy_install GitPython
$ easy_install GitPython

This command will download the latest version of GitPython from the
`Python Package Index <http://pypi.python.org/pypi/GitPython>`_ and install it
@@ -54,10 +54,10 @@ here:
Alternatively, you can install from the distribution using the ``setup.py``
script:

.. sourcecode:: none
.. sourcecode:: console

$ python setup.py install

# python setup.py install

.. note:: In this case, you have to manually install `GitDB`_ and `async`_ as well. It would be recommended to use the :ref:`git source repository <source-code-label>` in that case.

Getting Started
@@ -80,21 +80,27 @@ Source Code

GitPython's git repo is available on GitHub, which can be browsed at:

* https://github.com/gitpython-developers/GitPython
* https://github.com/gitpython-developers/GitPython

and cloned using:

.. sourcecode:: console

$ git clone git://github.com/gitpython-developers/GitPython.git git-python

Initialize all submodules to obtain the required dependencies with:

and cloned using::
.. sourcecode:: console

$ git clone git://github.com/gitpython-developers/GitPython.git git-python
Initialize all submodules to obtain the required dependencies with::
$ cd git-python
$ git submodule update --init --recursive
Finally verify the installation by running the `nose powered <http://code.google.com/p/python-nose/>`_ unit tests::

Finally verify the installation by running the `nose powered <http://code.google.com/p/python-nose/>`_ unit tests:

.. sourcecode:: console

$ nosetests

Mailing List
============
http://groups.google.com/group/git-python
@@ -104,7 +110,7 @@ Issue Tracker
The issue tracker is hosted by github:

https://github.com/gitpython-developers/GitPython/issues

License Information
===================
GitPython is licensed under the New BSD License. See the LICENSE file for
18 changes: 16 additions & 2 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
@@ -146,9 +146,9 @@ Index Objects are objects that can be put into git's index. These objects are tr
''
hct.trees[0].path # the first subdirectory has one though
'dir'
htc.mode # trees have the mode of a linux directory
oct(htc.mode) # trees have the mode of a linux directory
040000
'%o' % htc.blobs[0].mode # blobs have a specific mode though comparable to a standard linux fs
oct(htc.blobs[0].mode) # blobs have a specific mode though comparable to a standard linux fs
100644
Access blob data (or any object data) directly or using streams::
@@ -412,6 +412,20 @@ The special notion ``git.command(flag=True)`` will create a flag without value l

If ``None`` is found in the arguments, it will be dropped silently. Lists and tuples passed as arguments will be unpacked recursively to individual arguments. Objects are converted to strings using the str(...) function.

Git Command Debugging and Customization
***************************************

Using environment variables, you can further adjust the behaviour of the git command.

* **GIT_PYTHON_TRACE**

* If set to non-0, all executed git commands will be printed to stdout.
* if set to *full*, the executed git command will be printed along with its output.

* **GIT_PYTHON_GIT_EXECUTABLE**

* If set, it should contain the full path to the git executable, e.g. *c:\\Program Files (x86)\\Git\\bin\\git.exe* on windows or */usr/bin/git* on linux.

And even more ...
*****************

37 changes: 19 additions & 18 deletions git/__init__.py
Original file line number Diff line number Diff line change
@@ -13,15 +13,17 @@

#{ Initialization
def _init_externals():
"""Initialize external projects by putting them into the path"""
sys.path.append(os.path.join(os.path.dirname(__file__), 'ext', 'gitdb'))

try:
import gitdb
except ImportError:
raise ImportError("'gitdb' could not be found in your PYTHONPATH")
#END verify import

"""Initialize external projects by putting them into the path"""
ext_base = os.path.join(os.path.dirname(__file__), 'ext')
for package in ('async', 'smmap'):
sys.path.append(os.path.join(ext_base, package))
try:
__import__(package)
except ImportError:
raise ImportError("%r could not be found in your PYTHONPATH" % package)
# END verify import
# END handle external import

#} END initialization

#################
@@ -37,18 +39,17 @@ def _init_externals():
from git.exc import *
from git.db import *
from git.cmd import Git
from git.repo import Repo
from git.remote import *
from git.index import *
from git.repo import Repo
from git.util import (
LockFile,
BlockingLockFile,
Stats,
Actor
)
LockFile,
BlockingLockFile,
Stats,
Actor
)

#} END imports

__all__ = [ name for name, obj in locals().items()
if not (name.startswith('_') or inspect.ismodule(obj)) ]

__all__ = [name for name, obj in locals().items()
if not (name.startswith('_') or inspect.ismodule(obj))]
Loading