Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork966
changes.rst
changes.rst
All issues and PRs can be viewed in all detail when following this URL:https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.1+-+Bugfixes%22
Special thanks to @ankostis, who made this release possible (nearly) single-handedly.GitPython is run by its users, and their PRs make all the difference, they keepGitPython relevant. Thank you all so much for contributing !
- The GIT_DIR environment variable does not override the path argument wheninitializing a Repo object anymore. However, if said path unset, GIT_DIRwill be used to fill the void.
All issues and PRs can be viewed in all detail when following this URL:https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.0+-+proper+windows+support%22
- tag.commit will now resolve commits deeply.
- Repo objects can now be pickled, which helps with multi-processing.
- Head.checkout() now deals with detached heads, which is when it will returnthe HEAD reference instead.
- DiffIndex.iter_change_type(...) produces better results when diffing
- DiffIndex.iter_change_type(...) produces better results when diffingan index against the working tree.
- Repo().is_dirty(...) now supports the path parameter, to specify a singlepath by which to filter the output. Similar to git status <path>
- Symbolic refs created by this library will now be written with a newlinecharacter, which was previously missing.
- blame() now properly preserves multi-line commit messages.
- No longer corrupt ref-logs by writing multi-line comments into them.
- IndexFile.commit(...,skip_hooks=False) added. This parameter emulates the
- behaviour of --no-verify on the command-line.
- Fix: remote output parser now correctly matches refs with non-ASCIIchars in them
- API: Diffs now have a_rawpath, b_rawpath, raw_rename_from,raw_rename_to properties, which are the raw-bytes equivalents of theirunicode path counterparts.
- Fix: TypeError about passing keyword argument to string decode() onPython 2.6.
- Feature:setUrl API on Remotes
- Fix: parser of fetch info lines choked on some legitimate lines
- Fix: parser of commit object data is now robust against cases wherecommit object contains invalid bytes. The invalid characters are nowreplaced rather than choked on.
- Fix: non-ASCII paths are now properly decoded and returned in
.diff()output - Fix: RemoteProgress will now strip the ', ' prefix or suffix from messages.
- API: Remote.[fetch|push|pull](...) methods now allow the
progressargument tobe a callable. This saves you from creating a custom type with usually just oneimplemented method.
- Fix: bug in
git-blame --incrementaloutput parser that broken whencommit messages contained\rcharacters - Fix: progress handler exceptions are not caught anymore, which would usually just hide bugspreviously.
- Fix: The Git.execute method will now redirect stdout to devnull if with_stdout is false,which is the intended behaviour based on the parameter's documentation.
- Fix: source package does not include *.pyc files
- Fix: source package does include doc sources
- Fix: remote output parser now correctly matches refs with "@" in them
Please note that due to breaking changes, we have to increase the major version.
- IMPORTANT: This release drops support for python 2.6, which isofficially deprecated by the python maintainers.
- CRITICAL: Diff objects created with patch output will now not carrythe --- and +++ header lines anymore. All diffs now start with the@@ header line directly. Users that rely on the old behaviour can now(reliably) read this information from the a_path and b_path propertieswithout having to parse these lines manually.
- Commit now has extra properties authored_datetime andcommitter_datetime (to get Python datetime instances rather thantimestamps)
- Commit.diff() now supports diffing the root commit viaCommit.diff(NULL_TREE).
- Repo.blame() now respects incremental=True, supporting incrementalblames. Incremental blames are slightly faster since they don't includethe file's contents in them.
- Fix: Diff objects created with patch output will now have theira_path and b_path properties parsed out correctly. Previously, somevalues may have been populated incorrectly when a file was added ordeleted.
- Fix: diff parsing issues with paths that contain "unsafe" chars, likespaces, tabs, backslashes, etc.
- IMPORTANT: Changed default object database of Repo objects to GitComdObjectDB. The pure-python implementationused previously usually fails to release its resources (i.e. file handles), which can lead to problems when workingwith large repositories.
- CRITICAL: fixed incorrect Commit object serialization when authored or commit date had timezones which were notdivisiblej by 3600 seconds. This would happen if the timezone was something like +0530 for instance.
- A list of all additional fixes can be foundon github
- CRITICAL: Tree.cache was removed without replacement. It is technically impossible to change individual trees and expect their serialization results to be consistent with whatgit 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.
- A list of all issues can be foundon github
This version is equivalent to v0.3.7, but finally acknowledges that GitPython is stable and production ready.
It follows thesemantic version scheme, and thus will not break its existing API unless it goes 2.0.
- IndexFile.add() will now write the index without any extension data by default. However, you may override this behaviour with the new write_extension_data keyword argument.
- Renamed ignore_tree_extension_data keyword argument in IndexFile.write(...) to ignore_extension_data
- If the git command executed during Remote.push(...)|fetch(...) returns with an non-zero exit code and GitPython didn'tobtain any head-information, the corresponding GitCommandError will be raised. This may break previous code which expectedthese operations to never raise. However, that behavious is undesirable as it would effectively hide the fact that therewas an error. Seethis issue for more information.
- If the git executable can't be found in the PATH or at the path provided by GIT_PYTHON_GIT_EXECUTABLE, this is madeobvious by throwing GitCommandNotFound, both on unix and on windows.
- Those who supportGUI on windows will now have to set git.Git.USE_SHELL = True to get the previous behaviour.
- A list of all issues can be foundon github
- DOCS
- special members like __init__ are now listed in the API documentation
- tutorial section was revised entirely, more advanced examples were added.
- POSSIBLY BREAKING CHANGES
- As rev_parse will now throw BadName as well as BadObject, client code will have to catch both exception types.
- 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 therespective issue on github
- [include] sections in git configuration files are now respected
- Added GitConfigParser.rename_section()
- Added Submodule.rename()
- A list of all issues can be foundon github
- push/pull/fetch operations will not block anymore
- diff() can now properly detect renames, both in patch and raw format. Previously it only worked when create_patch was True.
- repo.odb.update_cache() is now called automatically after fetch and pull operations. In case you did that in your own code, you might want to remove your line to prevent a double-update that causes unnecessary IO.
- Repo(path) will not automatically search upstream anymore and find any git directory on its way up. If you need that behaviour, you can turn it back on using the new search_parent_directories=True flag when constructing a Repo object.
- IndexFile.commit() now runs the pre-commit and post-commit hooks. Verified to be working on posix systems only.
- A list of all fixed issues can be found here:https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.5+-+bugfixes%22+
- Internally, hexadecimal SHA1 are treated as ascii encoded strings. Binary SHA1 are treated as bytes.
- Id attribute of Commit objects is now hexsha, instead of binsha. The latter makes no sense in python 3 and I see no application of it anyway besides its artificial usage in test cases.
- IMPORTANT: If you were using the config_writer(), you implicitly relied on __del__ to work as expected to flush changes. To be sure changes are flushed under PY3, you will have to call the new release() method to trigger a flush. For some reason, __del__ is not called necessarily anymore when a symbol goes out of scope.
- The Tree now has a .join('name') method which is equivalent to tree / 'name'
- 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.
- Code Cleanup (in preparation for python 3 support)
- Applied autopep8 and cleaned up code
- Using python logging module instead of print statements to signal certain kinds of errors
- Release of most recent version as non-RC build, just to allow pip to install the latest version right away.
- Have a look at the milestones (https://github.com/gitpython-developers/GitPython/milestones) to see what's next.
- git command wrapper
- Added
version_infoproperty 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.
- Blob Type
- Added mode constants to ease the manual creation of blobs
- IterableList
- Added __contains__ and __delitem__ methods
- More Changes
- 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.
- Addedreflog support ( reading and writing )
New types:
RefLogandRefLogEntryReflog 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.
abspathproperty added, similar toabspathof Object instanceslog()method addedlog_append(...)method addedset_reference(...)method added (reflog support)set_commit(...)method added (reflog support)set_object(...)method added (reflog support)Intrusive Changes to
Headtype
create(...)method now supports the reflog, but will not raiseGitCommandErroranymore as it is a pure python implementation now. Instead, it raisesOSError.
- Intrusive Changes to
Repotype
create_head(...)method does not support kwargs anymore, instead it supports a logmsg parameter
Repo.rev_parse now supports the [ref]@{n} syntax, wheren 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
- Full Submodule-Support
- Added unicode support for author names. Commit.author.name is now unicode instead of string.
- Head Type changes
- config_reader() & config_writer() methods added for access to head specific options.
- tracking_branch() & set_tracking_branch() methods added for easy configuration of tracking branches.
- Added python 2.4 support
- For consistency with naming conventions used in sub-modules like gitdb, the following modules have been renamed
- git.utils -> git.util
- git.errors -> git.exc
- git.objects.utils -> git.objects.util
- Object instances, and everything derived from it, now use binary sha's internally. The 'sha' member was removed, in favor of the 'binsha' member. An 'hexsha' property is available for convenient conversions. They may only be initialized using their binary shas, reference names or revision specs are not allowed anymore.
- IndexEntry instances contained in IndexFile.entries now use binary sha's. Use the .hexsha property to obtain the hexadecimal version. The .sha property was removed to make the use of the respective sha more explicit.
- If objects are instantiated explicitly, a binary sha is required to identify the object, where previously any rev-spec could be used. The ref-spec compatible version still exists as Object.new or Repo.commit|Repo.tree respectively.
- The .data attribute was removed from the Object type, to obtain plain data, use the data_stream property instead.
- ConcurrentWriteOperation was removed, and replaced by LockedFD
- IndexFile.get_entries_key was renamed to entry_key
- IndexFile.write_tree: removed missing_ok keyword, its always True now. Instead of raising GitCommandError it raises UnmergedEntriesError. This is required as the pure-python implementation doesn't support the missing_ok keyword yet.
- diff.Diff.null_hex_sha renamed to NULL_HEX_SHA, to be conforming with the naming in the Object base class
- 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, mimicking git-commit-tree
- file mode in Tree, Blob and Diff objects now is an int compatible to definitionsin the stat module, allowing you to query whether individual user, group and otherread, write and execute bits are set.
- Adjusted class hierarchy to generally allow comparison and hash for Objects and Refs
- Improved Tag object which now is a Ref that may contain a tag object with additionalInformation
- id_abbrev method has been removed as it could not assure the returned short SHA'swhere unique
- removed basename method from Objects with path's as it replicated features of os.path
- from_string and list_from_string methods are now private and were renamed to_from_string and _list_from_string respectively. As part of the private API, theymay change without prior notice.
- Renamed all find_all methods to list_items - this method is part of the Iterable interfacethat also provides a more efficients and more responsive iter_items method
- All dates, like authored_date and committer_date, are stored as seconds since epochto consume less memory - they can be converted using time.gmtime in a more suitablepresentation format if needed.
- Named method parameters changed on a wide scale to unify their use. Now git specificterms are used everywhere, such as "Reference" ( ref ) and "Revision" ( rev ).Previously multiple terms where used making it harder to know which type was allowedor not.
- Unified diff interface to allow easy diffing between trees, trees and index, treesand working tree, index and working tree, trees and index. This closely followsthe git-diff capabilities.
- Git.execute does not take the with_raw_output option anymore. It was not usedby anyone within the project and False by default.
- Previously one would return and process multiple items as list only which canhurt performance and memory consumption and reduce response times.iter_items method provide an iterator that will return items on demand as parsedfrom a stream. This way any amount of objects can be handled.
- list_items method returns IterableList allowing to access list members by name
- blob, tree, tag and commit module have been moved to new objects package. This shouldnot affect you though unless you explicitly imported individual objects. If you justused the git package, names did not change.
- former 'name' member renamed to path as it suits the actual data better
- git.subcommand call scheme now prunes out None from the argument list, allowingto be called more comfortably as None can never be a valid to the git commandif converted to a string.
- Renamed 'git_dir' attribute to 'working_dir' which is exactly how it is used
- 'count' method is not an instance method to increase its ease of use
- 'name_rev' property returns a nice name for the commit's sha
- The git configuration can now be read and manipulated directly from within pythonusing the GitConfigParser
- Repo.config_reader() returns a read-only parser
- Repo.config_writer() returns a read-write parser
- Members a a_commit and b_commit renamed to a_blob and b_blob - they are populatedwith Blob objects if possible
- Members a_path and b_path removed as this information is kept in the blobs
- Diffs are now returned as DiffIndex allowing to more quickly find the kind ofdiffs you are interested in
- Commit and Tree objects now support diffing natively with a common interface tocompare against other Commits or Trees, against the working tree or against the index.
- A new Index class allows to read and write index files directly, and to performsimple two and three way merges based on an arbitrary index.
- References are object that point to a Commit
- SymbolicReference are a pointer to a Reference Object, which itself points to a specificCommit
- They will dynamically retrieve their object at the time of query to assure the informationis actual. Recently objects would be cached, hence ref object not be safely keptpersistent.
- Moved blame method from Blob to repo as it appeared to belong there much more.
- active_branch method now returns a Head object instead of a string with the nameof the active branch.
- tree method now requires a Ref instance as input and defaults to the active_branchinstead of master
- is_dirty now takes additional arguments allowing fine-grained control about what isconsidered dirty
- Removed the following methods:
- 'log' method as it as effectively the same as the 'commits' method
- 'commits_since' as it is just a flag given to rev-list in Commit.iter_items
- 'commit_count' as it was just a redirection to the respective commit method
- 'commits_between', replaced by a note on the iter_commits method as it can achieve the same thing
- 'commit_delta_from' as it was a very special case by comparing two different repjrelated repositories, i.e. clones, git-rev-list would be sufficient to find commits that would need to be transferred for example.
- 'create' method which equals the 'init' method's functionality
- 'diff' - it returned a mere string which still had to be parsed
- 'commit_diff' - moved to Commit, Tree and Diff types respectively
- Renamed the following methods:
- commits to iter_commits to improve the performance, adjusted signature
- init_bare to init, implying less about the options to be used
- fork_bare to clone, as it was to represent general clone functionality, but implieda bare clone to be more versatile
- archive_tar_gz and archive_tar and replaced by archive method with different signature
- 'commits' method has no max-count of returned commits anymore, it now behaves like git-rev-list
- The following methods and properties were added
- 'untracked_files' property, returning all currently untracked files
- 'head', creates a head object
- 'tag', creates a tag object
- 'iter_trees' method
- 'config_reader' method
- 'config_writer' method
- 'bare' property, previously it was a simple attribute that could be written
- Renamed the following attributes
- 'path' is now 'git_dir'
- 'wd' is now 'working_dir'
- Added attribute
- 'working_tree_dir' which may be None in case of bare repositories
- Added Remote object allowing easy access to remotes
- Repo.remotes lists all remotes
- Repo.remote returns a remote of the specified name if it exists
- Added support for common TestCase base class that provides additional functionalityto receive repositories tests can also write to. This way, more aspects can betested under real-world ( un-mocked ) conditions.
- former 'name' member renamed to path as it suits the actual data better
- added traverse method allowing to recursively traverse tree items
- deleted blob method
- added blobs and trees properties allowing to query the respective items in thetree
- now mimics behaviour of a read-only list instead of a dict to maintain order.
- content_from_string method is now private and not part of the public API anymore
- Added in Sphinx documentation.
- Removed ambiguity between paths and treeishs. When calling commands thataccept treeish and path arguments and there is a path with the same name asa treeish git cowardly refuses to pick one and asks for the command to usethe unambiguous syntax where '--' separates the treeish from the paths.
Repo.commits,Repo.commits_between,Repo.commits_since,Repo.commit_count,Repo.commit,Commit.countandCommit.find_allall now optionally take a path argument whichconstrains the lookup by path. This changes the order of the positionalarguments inRepo.commitsandRepo.commits_since.
Commit.messagenow contains the full commit message (rather than justthe first line) and a new propertyCommit.summarycontains the firstline of the commit message.- Fixed a failure when trying to lookup the stats of a parentless commit froma bare repo.
- The diff parser is now far faster and also addresses a bug wheresometimes b_mode was not set.
- Added support for parsing rename info to the diff parser. Addition of newproperties
Diff.renamed,Diff.rename_from, andDiff.rename_to.
- Corrected problem where branches was only returning the last path componentinstead of the entire path component following refs/heads/.
- Modified the gzip archive creation to use the python gzip module.
- Corrected
commits_betweenalways returning None instead of the reversedlist.
- upgraded to Mock 0.4 dependency.
- Replace GitPython with git in repr() outputs.
- Fixed packaging issue caused by ez_setup.py.
- No longer strip newlines from Blob data.
- Corrected problem with git-rev-list --bisect-all. Seehttp://groups.google.com/group/git-python/browse_thread/thread/aed1d5c4b31d5027
Corrected problems with creating bare repositories.
Repo.tree no longer accepts a path argument. Use:
>>>dict(k, ofor k, oin tree.items()if kin 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 theworking directory.
Added a read-only Repo.active_branch property which returns the name of thecurrently active branch.
Switched to using a dictionary for Tree contents since you will usually wantto 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.
- removed
method_missingstuff and replaced with a__getattr__override inGit.
- renamed
git_pythontogit. Be sure to delete all pyc files beforetesting.
- Fixed problem with commit stats not working under all conditions.
- Renamed module to cmd.
- Removed shell escaping completely.
- Added support for
stderr,stdin, andwith_status. git_diris now optional in the constructor forgit.Git. Git nowfalls back toos.getcwd()when git_dir is not specified.- add a
with_exceptionskeyword argument to git commands.GitCommandErroris raised when the exit status is non-zero. - add support for a
GIT_PYTHON_TRACEenvironment variable.GIT_PYTHON_TRACEallows us to debug GitPython's usage of git throughthe use of an environment variable.
- Fixed up problem where
namedoesn't exist on root of tree.
- Corrected problem with creating bare repo. Added
Repo.createalias.
- Corrected problem with
Tree.__div__not working with zero length files.Removed__len__override and replaced with size instead. Also made sizecache properly. This is a breaking change.
Fixed up some urls because I'm a moron
initial release