Skip to content

Commit c209134

Browse files
committed
Merge branch 'master' into exp_git_dir
2 parents 76ac61a + 0dd56ad commit c209134

27 files changed

+109
-131
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ exists in `Git\mingw64\libexec\git-core\`; CYGWIN has no daemon, but should get
8383
with MINGW's.
8484

8585
The easiest way to run tests is by using [tox](https://pypi.python.org/pypi/tox)
86-
a wrapper around virtualenv. It will take care of setting up environnements with the proper
86+
a wrapper around virtualenv. It will take care of setting up environments with the proper
8787
dependencies installed and execute test commands. To install it simply:
8888

8989
pip install tox

doc/source/changes.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ It follows the `semantic version scheme <http://semver.org>`_, and thus will not
185185

186186
0.3.3
187187
=====
188-
* When fetching, pulling or pushing, and an error occours, it will not be reported on stdout anymore. However, if there is a fatal error, it will still result in a GitCommandError to be thrown. This goes hand in hand with improved fetch result parsing.
188+
* When fetching, pulling or pushing, and an error occurs, it will not be reported on stdout anymore. However, if there is a fatal error, it will still result in a GitCommandError to be thrown. This goes hand in hand with improved fetch result parsing.
189189
* Code Cleanup (in preparation for python 3 support)
190190

191191
* Applied autopep8 and cleaned up code
192-
* Using python logging module instead of print statments to signal certain kinds of errors
192+
* Using python logging module instead of print statements to signal certain kinds of errors
193193

194194
0.3.2.1
195195
=======
@@ -268,7 +268,7 @@ It follows the `semantic version scheme <http://semver.org>`_, and thus will not
268268
* Head Type changes
269269

270270
* config_reader() & config_writer() methods added for access to head specific options.
271-
* tracking_branch() & set_tracking_branch() methods addded for easy configuration of tracking branches.
271+
* tracking_branch() & set_tracking_branch() methods added for easy configuration of tracking branches.
272272

273273

274274
0.3.0 Beta 2
@@ -300,13 +300,13 @@ General
300300
0.2 Beta 2
301301
===========
302302
* Commit objects now carry the 'encoding' information of their message. It wasn't parsed previously, and defaults to UTF-8
303-
* Commit.create_from_tree now uses a pure-python implementation, mimicing git-commit-tree
303+
* Commit.create_from_tree now uses a pure-python implementation, mimicking git-commit-tree
304304

305305
0.2
306306
=====
307307
General
308308
-------
309-
* file mode in Tree, Blob and Diff objects now is an int compatible to definintiions
309+
* file mode in Tree, Blob and Diff objects now is an int compatible to definitions
310310
in the stat module, allowing you to query whether individual user, group and other
311311
read, write and execute bits are set.
312312
* Adjusted class hierarchy to generally allow comparison and hash for Objects and Refs
@@ -320,12 +320,12 @@ General
320320
may change without prior notice.
321321
* Renamed all find_all methods to list_items - this method is part of the Iterable interface
322322
that also provides a more efficients and more responsive iter_items method
323-
* All dates, like authored_date and committer_date, are stored as seconds since epoc
323+
* All dates, like authored_date and committer_date, are stored as seconds since epoch
324324
to consume less memory - they can be converted using time.gmtime in a more suitable
325325
presentation format if needed.
326326
* Named method parameters changed on a wide scale to unify their use. Now git specific
327327
terms are used everywhere, such as "Reference" ( ref ) and "Revision" ( rev ).
328-
Prevously multiple terms where used making it harder to know which type was allowed
328+
Previously multiple terms where used making it harder to know which type was allowed
329329
or not.
330330
* Unified diff interface to allow easy diffing between trees, trees and index, trees
331331
and working tree, index and working tree, trees and index. This closely follows
@@ -355,7 +355,7 @@ Blob
355355
GitCommand
356356
-----------
357357
* git.subcommand call scheme now prunes out None from the argument list, allowing
358-
to be called more confortably as None can never be a valid to the git command
358+
to be called more comfortably as None can never be a valid to the git command
359359
if converted to a string.
360360
* Renamed 'git_dir' attribute to 'working_dir' which is exactly how it is used
361361

@@ -382,19 +382,19 @@ Diff
382382
Diffing
383383
-------
384384
* Commit and Tree objects now support diffing natively with a common interface to
385-
compare agains other Commits or Trees, against the working tree or against the index.
385+
compare against other Commits or Trees, against the working tree or against the index.
386386

387387
Index
388388
-----
389389
* A new Index class allows to read and write index files directly, and to perform
390390
simple two and three way merges based on an arbitrary index.
391391

392-
Referernces
392+
References
393393
------------
394394
* References are object that point to a Commit
395395
* SymbolicReference are a pointer to a Reference Object, which itself points to a specific
396396
Commit
397-
* They will dynmically retrieve their object at the time of query to assure the information
397+
* They will dynamically retrieve their object at the time of query to assure the information
398398
is actual. Recently objects would be cached, hence ref object not be safely kept
399399
persistent.
400400

@@ -403,7 +403,7 @@ Repo
403403
* Moved blame method from Blob to repo as it appeared to belong there much more.
404404
* active_branch method now returns a Head object instead of a string with the name
405405
of the active branch.
406-
* tree method now requires a Ref instance as input and defaults to the active_branche
406+
* tree method now requires a Ref instance as input and defaults to the active_branch
407407
instead of master
408408
* is_dirty now takes additional arguments allowing fine-grained control about what is
409409
considered dirty
@@ -479,7 +479,7 @@ General
479479
* Removed ambiguity between paths and treeishs. When calling commands that
480480
accept treeish and path arguments and there is a path with the same name as
481481
a treeish git cowardly refuses to pick one and asks for the command to use
482-
the unambiguous syntax where '--' seperates the treeish from the paths.
482+
the unambiguous syntax where '--' separates the treeish from the paths.
483483

484484
* ``Repo.commits``, ``Repo.commits_between``, ``Repo.commits_since``,
485485
``Repo.commit_count``, ``Repo.commit``, ``Commit.count`` and
@@ -627,7 +627,7 @@ Tree
627627
----
628628
* Corrected problem with ``Tree.__div__`` not working with zero length files.
629629
Removed ``__len__`` override and replaced with size instead. Also made size
630-
cach properly. This is a breaking change.
630+
cache properly. This is a breaking change.
631631

632632
0.1.1
633633
=====

doc/source/intro.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Getting Started
9292
API Reference
9393
=============
9494

95-
An organized section of the GitPthon API is at :ref:`api_reference_toplevel`.
95+
An organized section of the GitPython API is at :ref:`api_reference_toplevel`.
9696

9797
.. _source-code-label:
9898

git/__init__.py

-18
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@
1515
__version__ = 'git'
1616

1717

18-
#{ Initialization
19-
def _init_externals():
20-
"""Initialize external projects by putting them into the path"""
21-
if __version__ == 'git':
22-
sys.path.insert(0, osp.join(osp.dirname(__file__), 'ext', 'gitdb'))
23-
24-
try:
25-
import gitdb
26-
except ImportError:
27-
raise ImportError("'gitdb' could not be found in your PYTHONPATH")
28-
# END verify import
29-
30-
#} END initialization
31-
32-
#################
33-
_init_externals()
34-
#################
35-
3618
#{ Imports
3719

3820
from git.config import GitConfigParser # @NoMove @IgnorePep8

git/cmd.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@
6161
## @{
6262

6363
def handle_process_output(process, stdout_handler, stderr_handler,
64-
finalizer=None, decode_streams=True):
64+
finalizer=None, decode_streams=True, nojoin=False):
6565
"""Registers for notifications to lean that process output is ready to read, and dispatches lines to
6666
the respective line handlers.
6767
This function returns once the finalizer returns
6868
6969
:return: result of finalizer
7070
:param process: subprocess.Popen instance
7171
:param stdout_handler: f(stdout_line_string), or None
72-
:param stderr_hanlder: f(stderr_line_string), or None
72+
:param stderr_handler: f(stderr_line_string), or None
7373
:param finalizer: f(proc) - wait for proc to finish
7474
:param decode_streams:
75-
Assume stdout/stderr streams are binary and decode them vefore pushing \
75+
Assume stdout/stderr streams are binary and decode them before pushing \
7676
their contents to handlers.
7777
Set it to False if `universal_newline == True` (then streams are in text-mode)
7878
or if decoding must happen later (i.e. for Diffs).
@@ -112,8 +112,9 @@ def pump_stream(cmdline, name, stream, is_decode, handler):
112112

113113
## FIXME: Why Join?? Will block if `stdin` needs feeding...
114114
#
115-
for t in threads:
116-
t.join()
115+
if not nojoin:
116+
for t in threads:
117+
t.join()
117118

118119
if finalizer:
119120
return finalizer(process)
@@ -438,7 +439,7 @@ def set_persistent_git_options(self, **kwargs):
438439

439440
def _set_cache_(self, attr):
440441
if attr == '_version_info':
441-
# We only use the first 4 numbers, as everthing else could be strings in fact (on windows)
442+
# We only use the first 4 numbers, as everything else could be strings in fact (on windows)
442443
version_numbers = self._call_process('version').split(' ')[2]
443444
self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit())
444445
else:
@@ -580,8 +581,9 @@ def execute(self, command,
580581
stdout_sink = (PIPE
581582
if with_stdout
582583
else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb')))
583-
log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)",
584-
command, cwd, universal_newlines, shell)
584+
import subprocess as sb
585+
log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s,\n_active=%s)",
586+
command, cwd, universal_newlines, shell, sb._active)
585587
try:
586588
proc = Popen(command,
587589
env=env,

git/config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(self, file_or_files, read_only=True, merge_includes=True):
198198
configuration files have been included
199199
:param merge_includes: if True, we will read files mentioned in [include] sections and merge their
200200
contents into ours. This makes it impossible to write back an individual configuration file.
201-
Thus, if you want to modify a single conifguration file, turn this off to leave the original
201+
Thus, if you want to modify a single configuration file, turn this off to leave the original
202202
dataset unaltered when reading it."""
203203
cp.RawConfigParser.__init__(self, dict_type=OrderedDict)
204204

@@ -275,7 +275,7 @@ def _read(self, fp, fpname):
275275
"""A direct copy of the py2.4 version of the super class's _read method
276276
to assure it uses ordered dicts. Had to change one line to make it work.
277277
278-
Future versions have this fixed, but in fact its quite embarassing for the
278+
Future versions have this fixed, but in fact its quite embarrassing for the
279279
guys not to have done it right in the first place !
280280
281281
Removed big comments to make it more compact.
@@ -472,7 +472,7 @@ def write(self):
472472
# end assert multiple files
473473

474474
if self._has_includes():
475-
log.debug("Skipping write-back of confiuration file as include files were merged in." +
475+
log.debug("Skipping write-back of configuration file as include files were merged in." +
476476
"Set merge_includes=False to prevent this.")
477477
return
478478
# end

git/diff.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
9090
9191
:param paths:
9292
is a list of paths or a single path to limit the diff to.
93-
It will only include at least one of the givne path or paths.
93+
It will only include at least one of the given path or paths.
9494
9595
:param create_patch:
9696
If True, the returned Diff contains a detailed patch that if applied
97-
makes the self to other. Patches are somwhat costly as blobs have to be read
97+
makes the self to other. Patches are somewhat costly as blobs have to be read
9898
and diffed.
9999
100100
:param kwargs:
@@ -105,7 +105,7 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
105105
106106
:note:
107107
On a bare repository, 'other' needs to be provided as Index or as
108-
as Tree/Commit, or a git command error will occour"""
108+
as Tree/Commit, or a git command error will occur"""
109109
args = list()
110110
args.append("--abbrev=40") # we need full shas
111111
args.append("--full-index") # get full index paths, not only filenames
@@ -171,7 +171,7 @@ class DiffIndex(list):
171171
def iter_change_type(self, change_type):
172172
"""
173173
:return:
174-
iterator yieling Diff instances that match the given change_type
174+
iterator yielding Diff instances that match the given change_type
175175
176176
:param change_type:
177177
Member of DiffIndex.change_type, namely:
@@ -346,7 +346,7 @@ def __str__(self):
346346
msg += '\n---'
347347
# END diff info
348348

349-
# Python2 sillyness: have to assure we convert our likely to be unicode object to a string with the
349+
# Python2 silliness: have to assure we convert our likely to be unicode object to a string with the
350350
# right encoding. Otherwise it tries to convert it using ascii, which may fail ungracefully
351351
res = h + msg
352352
if not PY3:
@@ -426,7 +426,7 @@ def _index_from_patch_format(cls, repo, proc):
426426
b_path = cls._pick_best_path(b_path, rename_to, b_path_fallback)
427427

428428
# Our only means to find the actual text is to see what has not been matched by our regex,
429-
# and then retro-actively assin it to our index
429+
# and then retro-actively assign it to our index
430430
if previous_header is not None:
431431
index[-1].diff = text[previous_header.end():header.start()]
432432
# end assign actual diff
@@ -479,7 +479,7 @@ def handle_diff_line(line):
479479
rename_from = None
480480
rename_to = None
481481

482-
# NOTE: We cannot conclude from the existance of a blob to change type
482+
# NOTE: We cannot conclude from the existence of a blob to change type
483483
# as diffs with the working do not have blobs yet
484484
if change_type == 'D':
485485
b_blob_id = None

git/exc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
""" Module containing all exceptions thrown througout the git package, """
6+
""" Module containing all exceptions thrown throughout the git package, """
77

88
from gitdb.exc import * # NOQA @UnusedWildImport
99
from git.compat import UnicodeMixin, safe_decode, string_types

git/index/base.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _set_cache_(self, attr):
140140
self._deserialize(stream)
141141
finally:
142142
lfd.rollback()
143-
# The handles will be closed on desctruction
143+
# The handles will be closed on destruction
144144
# END read from default index on demand
145145
else:
146146
super(IndexFile, self)._set_cache_(attr)
@@ -876,7 +876,7 @@ def remove(self, items, working_tree=False, **kwargs):
876876
def move(self, items, skip_errors=False, **kwargs):
877877
"""Rename/move the items, whereas the last item is considered the destination of
878878
the move operation. If the destination is a file, the first item ( of two )
879-
must be a file as well. If the destination is a directory, it may be preceeded
879+
must be a file as well. If the destination is a directory, it may be preceded
880880
by one or more directories or files.
881881
882882
The working tree will be affected in non-bare repositories.
@@ -886,7 +886,7 @@ def move(self, items, skip_errors=False, **kwargs):
886886
for reference.
887887
:param skip_errors:
888888
If True, errors such as ones resulting from missing source files will
889-
be skpped.
889+
be skipped.
890890
:param kwargs:
891891
Additional arguments you would like to pass to git-mv, such as dry_run
892892
or force.
@@ -895,7 +895,7 @@ def move(self, items, skip_errors=False, **kwargs):
895895
A list of pairs, containing the source file moved as well as its
896896
actual destination. Relative to the repository root.
897897
898-
:raise ValueErorr: If only one item was given
898+
:raise ValueError: If only one item was given
899899
GitCommandError: If git could not handle your request"""
900900
args = list()
901901
if skip_errors:
@@ -991,7 +991,7 @@ def checkout(self, paths=None, force=False, fprogress=lambda *args: None, **kwar
991991
prior and after a file has been checked out
992992
993993
:param kwargs:
994-
Additional arguments to be pasesd to git-checkout-index
994+
Additional arguments to be passed to git-checkout-index
995995
996996
:return:
997997
iterable yielding paths to files which have been checked out and are
@@ -1219,7 +1219,7 @@ def diff(self, other=diff.Diffable.Index, paths=None, create_patch=False, **kwar
12191219
cur_val = kwargs.get('R', False)
12201220
kwargs['R'] = not cur_val
12211221
return other.diff(self.Index, paths, create_patch, **kwargs)
1222-
# END diff against other item handlin
1222+
# END diff against other item handling
12231223

12241224
# if other is not None here, something is wrong
12251225
if other is not None:

git/index/fun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def aggressive_tree_merge(odb, tree_shas):
355355
out_append(_tree_entry_to_baseindexentry(theirs, 3))
356356
# END theirs changed
357357
# else:
358-
# theirs didnt change
358+
# theirs didn't change
359359
# pass
360360
# END handle theirs
361361
# END handle ours

git/index/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def check_default_index(self, *args, **kwargs):
7474
raise AssertionError(
7575
"Cannot call %r on indices that do not represent the default git index" % func.__name__)
7676
return func(self, *args, **kwargs)
77-
# END wrpaper method
77+
# END wrapper method
7878

7979
return check_default_index
8080

0 commit comments

Comments
 (0)