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