◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
Expand All @@ -12,7 +10,6 @@ python:
# - "pypy" - won't work as smmap doesn't work (see gitdb/.travis.yml for details)
matrix:
allow_failures:
- python: "2.6"
- python: "3.6-dev"
- python: "3.7-dev"
- python: "nightly"
@@ -26,7 +23,6 @@ install:
- git fetch --tags
- pip install -r test-requirements.txt
- pip install codecov sphinx
- if [ "$TRAVIS_PYTHON_VERSION" == '2.6' ]; then pip install unittest2; fi

# generate some reflog as git-python tests need it (in master)
- ./init-tests-after-clone.sh
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### How to contribute

* [fork this project](https://github.com/gitpython-developers/GitPython/fork) on github
* For setting up the environment to run the self tests, look at `.travis.yml`.
* Add yourself to AUTHORS.md and write your patch. **Write a test that fails unless your patch is present.**
* Initiate a pull request
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If it is not in your `PATH`, you can help GitPython find it by setting
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.

* Git (1.7.x or newer)
* Python 2.7 to 3.6, while python 2.6 is supported on a *best-effort basis*.

The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
The installer takes care of installing them for you.
Expand Up @@ -68,10 +68,6 @@ For *Windows*, we do regularly test it on [Appveyor CI](https://www.appveyor.com
but not all test-cases pass - you may help improve them by exploring
[Issue #525](https://github.com/gitpython-developers/GitPython/issues/525).

#### Python 2.6

Python 2.6 is supported on best-effort basis; which means that it is likely to deteriorate over time.

### RUNNING TESTS

*Important*: Right after cloning this repository, please be sure to have executed
10 changes: 5 additions & 5 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ Please note that due to breaking changes, we have to increase the major version.
with large repositories.
* CRITICAL: fixed incorrect `Commit` object serialization when authored or commit date had timezones which were not
divisiblej by 3600 seconds. This would happen if the timezone was something like `+0530` for instance.
* A list of all additional fixes can be found `on github <https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v1.0.2+-+Fixes%22+is%3Aclosed>`_
* CRITICAL: `Tree.cache` was removed without replacement. It is technically impossible to change individual trees and expect their serialization results to be consistent with what *git* expects. Instead, use the `IndexFile` facilities to adjust the content of the staging area, and write it out to the respective tree objects using `IndexFile.write_tree()` instead.

1.0.1 - Fixes
=============

* A list of all issues can be found `on github <https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v1.0.1+-+Fixes%22+is%3Aclosed>`_

1.0.0 - Notes
=============
Expand All @@ -191,7 +191,7 @@ It follows the `semantic version scheme <http://semver.org>`_, and thus will not

- Those who support **GUI on windows** will now have to set `git.Git.USE_SHELL = True` to get the previous behaviour.

* A list of all issues can be found `on github <https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.7+-+Fixes%22+is%3Aclosed>`_


0.3.6 - Features
Expand All @@ -207,11 +207,11 @@ It follows the `semantic version scheme <http://semver.org>`_, and thus will not
* Repo.working_tree_dir now returns None if it is bare. Previously it raised AssertionError.
* IndexFile.add() previously raised AssertionError when paths where used with bare repository, now it raises InvalidGitRepositoryError

* Added `Repo.merge_base()` implementation. See the `respective issue on github <https://github.com/gitpython-developers/GitPython/issues/169>`_
* `[include]` sections in git configuration files are now respected
* Added `GitConfigParser.rename_section()`
* Added `Submodule.rename()`
* A list of all issues can be found `on github <https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.6+-+Features%22+>`_

0.3.5 - Bugfixes
================
Expand Down
10 changes: 1 addition & 9 deletions doc/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Requirements
============

* `Python`_ 2.7 or newer
Since GitPython 2.0.0. Please note that python 2.6 is still reasonably well supported, but might
deteriorate over time. Support is provided on a best-effort basis only.
* `Git`_ 1.7.0 or newer
It should also work with older versions, but it may be that some operations
involving remotes will not work as expected.
Expand Down Expand Up @@ -75,12 +73,6 @@ codebase for `__del__` implementations and call these yourself when you see fit.
Another way assure proper cleanup of resources is to factor out GitPython into a
separate process which can be dropped periodically.

Best-effort for Python 2.6 and Windows support
----------------------------------------------

This means that support for these platforms is likely to worsen over time
as they are kept alive solely by their users, or not.

Getting Started
===============

Expand Down Expand Up @@ -124,7 +116,7 @@ http://stackoverflow.com/questions/tagged/gitpython

Issue Tracker
=============
The issue tracker is hosted by github:

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

Expand Down
2 changes: 1 addition & 1 deletion doc/source/roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#######
Roadmap
#######
The full list of milestones including associated tasks can be found on github:
https://github.com/gitpython-developers/GitPython/issues

Select the respective milestone to filter the list of issues accordingly.
Expand Down
2 changes: 1 addition & 1 deletion git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import logging
import os
import re

from git.compat import (
string_types,
Expand All @@ -21,7 +22,6 @@
with_metaclass,
PY3
)
from git.odict import OrderedDict
from git.util import LockFile

import os.path as osp
Expand Down
4 changes: 2 additions & 2 deletions git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Diffable(object):
:note:
Subclasses require a repo member as it is the case for Object instances, for practical
reasons we do not derive from Object."""
__slots__ = tuple()

# standin indicating you want to diff against the index
class Index(object):
Expand Down Expand Up @@ -106,7 +106,7 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
:note:
On a bare repository, 'other' needs to be provided as Index or as
as Tree/Commit, or a git command error will occur"""
args = list()
args.append("--abbrev=40") # we need full shas
args.append("--full-index") # get full index paths, not only filenames

Expand Down
32 changes: 16 additions & 16 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _set_cache_(self, attr):
ok = True
except OSError:
# in new repositories, there may be no index, which means we are empty
self.entries = dict()
return
finally:
if not ok:
Expand Down Expand Up @@ -324,7 +324,7 @@ def from_tree(cls, repo, *treeish, **kwargs):
if len(treeish) == 0 or len(treeish) > 3:
raise ValueError("Please specify between 1 and 3 treeish, got %i" % len(treeish))

arg_list = list()
# ignore that working tree and index possibly are out of date
if len(treeish) > 1:
# drop unmerged entries when reading our index and merging
Expand Down Expand Up @@ -471,9 +471,9 @@ def unmerged_blobs(self):
are at stage 3 will not have a stage 3 entry.
"""
is_unmerged_blob = lambda t: t[0] != 0
path_map = dict()
for stage, blob in self.iter_blobs(is_unmerged_blob):
path_map.setdefault(blob.path, list()).append((stage, blob))
# END for each unmerged blob
for l in mviter(path_map):
l.sort()
Expand Down Expand Up @@ -576,8 +576,8 @@ def _to_relative_path(self, path):

def _preprocess_add_items(self, items):
""" Split the items into two lists of path strings and BaseEntries. """
paths = list()
entries = list()

for item in items:
if isinstance(item, string_types):
Expand Down Expand Up @@ -610,7 +610,7 @@ def _store_path(self, filepath, fprogress):
@unbare_repo
@git_working_dir
def _entries_for_paths(self, paths, path_rewriter, fprogress, entries):
entries_added = list()
if path_rewriter:
for path in paths:
if osp.isabs(path):
Expand Up @@ -742,7 +742,7 @@ def add(self, items, force=True, fprogress=lambda *args: None, path_rewriter=Non
# automatically
# paths can be git-added, for everything else we use git-update-index
paths, entries = self._preprocess_add_items(items)
entries_added = list()
# This code needs a working tree, therefore we try not to run it unless required.
# That way, we are OK on a bare repository as well.
# If there are no paths, the rewriter has nothing to do either
Expand Down @@ -809,7 +809,7 @@ def handle_null_entries(self):
def _items_to_rela_paths(self, items):
"""Returns a list of repo-relative paths from the given items which
may be absolute or relative paths, entries or blobs"""
paths = list()
for item in items:
if isinstance(item, (BaseIndexEntry, (Blob, Submodule))):
paths.append(self._to_relative_path(item.path))
Expand Down Expand Up @@ -858,7 +858,7 @@ def remove(self, items, working_tree=False, **kwargs):
been removed effectively.
This is interesting to know in case you have provided a directory or
globs. Paths are relative to the repository. """
args = list()
if not working_tree:
args.append("--cached")
args.append("--")
Expand Down Expand Up @@ -897,7 +897,7 @@ def move(self, items, skip_errors=False, **kwargs):

:raise ValueError: If only one item was given
GitCommandError: If git could not handle your request"""
args = list()
if skip_errors:
args.append('-k')

Expand All @@ -910,7 +910,7 @@ def move(self, items, skip_errors=False, **kwargs):

# first execute rename in dryrun so the command tells us what it actually does
# ( for later output )
out = list()
mvlines = self.repo.git.mv(args, paths, **kwargs).splitlines()

# parse result - first 0:n/2 lines are 'checking ', the remaining ones
Expand Down Expand Up @@ -1041,9 +1041,9 @@ def handle_stderr(proc, iter_checked_out_files):
# line contents:
stderr = stderr.decode(defenc)
# git-checkout-index: this already exists
failed_files = list()
failed_reasons = list()
unknown_lines = list()
endings = (' already exists', ' is not in the cache', ' does not exist at stage', ' is unmerged')
for line in stderr.splitlines():
if not line.startswith("git checkout-index: ") and not line.startswith("git-checkout-index: "):
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def handle_stderr(proc, iter_checked_out_files):
proc = self.repo.git.checkout_index(args, **kwargs)
# FIXME: Reading from GIL!
make_exc = lambda: GitCommandError(("git-checkout-index",) + tuple(args), 128, proc.stderr.read())
checked_out_files = list()

for path in paths:
co_path = to_native_path_linux(self._to_relative_path(path))
Expand Down
Loading
Toggle all file notes Toggle all file annotations