- Added version_info property which returns a tuple of integers representing the installed git version.
- 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.
- Added mode constants to ease the manual creation of blobs
- Added __contains__ and __delitem__ methods
- Configuration file parsing is more robust. It should now be able to handle everything that the git command can parse as well.
- The progress parsing was updated to support git 1.7.0.3 and newer. Previously progress was not enabled for the git command or only worked with ssh in case of older git versions.
- Parsing of tags was improved. Previously some parts of the name could not be parsed properly.
- The rev-parse pure python implementation now handles branches correctly if they look like hexadecimal sha’s.
- 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.
New types: RefLog and RefLogEntry
Reflog is maintained automatically when creating references and deleting them
Non-intrusive changes to SymbolicReference, these don’t require your code to change. They allow to append messages to the reflog.
- abspath property added, similar to abspath of Object instances
- log() method added
- log_append(...) method added
- set_reference(...) method added (reflog support)
- set_commit(...) method added (reflog support)
- set_object(...) method added (reflog support)
Intrusive Changes to Head type
- create(...) method now supports the reflog, but will not raise GitCommandError anymore as it is a pure python implementation now. Instead, it raises OSError.
- Intrusive Changes to Repo type
- create_head(...) method does not support kwargs anymore, instead it supports a logmsg parameter
Repo.rev_parse now supports the [ref]@{n} syntax, where n is the number of steps to look into the reference’s past
BugFixes
- Removed incorrect ORIG_HEAD handling
Flattened directory structure to make development more convenient.
Note
This alters the way projects using git-python as a submodule have to adjust their sys.path to be able to import git-python successfully.
Misc smaller changes and bugfixes
- config_reader() & config_writer() methods added for access to head specific options.
- tracking_branch() & set_tracking_branch() methods addded for easy configuration of tracking branches.
- Commit objects now carry the ‘encoding’ information of their message. It wasn’t parsed previously, and defaults to UTF-8
- Commit.create_from_tree now uses a pure-python implementation, mimicing git-commit-tree
Corrected problems with creating bare repositories.
Repo.tree no longer accepts a path argument. Use:
>>> dict(k, o for k, o in tree.items() if k in paths)
Made daemon export a property of Repo. Now you can do this:
>>> exported = repo.daemon_export
>>> repo.daemon_export = True
Allows modifying the project description. Do this:
>>> repo.description = "Foo Bar"
>>> repo.description
'Foo Bar'
Added a read-only property Repo.is_dirty which reflects the status of the working directory.
Added a read-only Repo.active_branch property which returns the name of the currently active branch.
Switched to using a dictionary for Tree contents since you will usually want to access them by name and order is unimportant.
Implemented a dictionary protocol for Tree objects. The following:
child = tree.contents[‘grit’]
becomes:
child = tree[‘grit’]
Made Tree.content_from_string a static method.
Fixed up some urls because I’m a moron
initial release