aboutsummaryrefslogtreecommitdiff
path: root/git
AgeCommit message (Collapse)Author
2016-06-14Store raw path bytes in Diff instancesVincent Driessen
Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: - `a_path` - `b_path` - `rename_from` - `rename_to` However, since Git natively records paths as bytes, these may potentially not have a valid unicode representation. This patch changes the Diff instance to instead take the following equivalent fields that should be raw bytes instead: - `a_rawpath` - `b_rawpath` - `raw_rename_from` - `raw_rename_to` NOTE ON BACKWARD COMPATIBILITY: The original `a_path`, `b_path`, etc. fields are still available as properties (rather than slots). These properties now dynamically decode the raw bytes into a unicode string (performing the potentially destructive operation of replacing invalid unicode chars by "�"'s). This means that all code using Diffs should remain backward compatible. The only exception is when people would manually construct Diff instances by calling the constructor directly, in which case they should now pass in bytes rather than unicode strings. See also the discussion on https://github.com/gitpython-developers/GitPython/pull/467
2016-06-14Python 2.6 compatVincent Driessen
2016-06-14fix(test_docs): skip master-dependent assertionSebastian Thiel
It usually fails on branches, which doesn't help assessing PRs.
2016-06-14Merge pull request #446 from guyzmo/updating_remote_url_handlingSebastian Thiel
Adding support for git remote set-url/get-url API to Remote
2016-06-14Merge pull request #467 from ↵Sebastian Thiel
gitpython-developers/fix-dont-choke-on-invalid-unicode-paths Don't choke on (legitimately) invalidly encoded Unicode paths
2016-06-14fix(flake): misc whitespace fixesSebastian Thiel
2016-06-13fix(cmd): allow any kind of status messageSebastian Thiel
I see no need in verifying the status code. It's enough to just get the error.
2016-06-13fix(misc): various cleanupSebastian Thiel
Just went through all changes and adjusted them to the best of my abilities. As there are no tests to claim otherwise, I believe this is correct enough. However, it becomes evident that it's no longer possible to just make changes without backing them with a respective test.
2016-06-13Merge branch 'pr-cmd-raise-with-stderr-on-error' of ↵Sebastian Thiel
https://github.com/barry-scott/GitPython into barry-scott-pr-cmd-raise-with-stderr-on-error
2016-06-13fix(repo): prevent error messages from being swallowedSebastian Thiel
This issue must have rosen from `to_progress_instance()` being inserted in a spot where `None` was a legit value. Fixes #462
2016-06-08Switching the `urls` property to use `git remote show` instead of `git ↵Guyzmo
remote get-url` `get-url` is a new API that is not widely available yet (introduced in git 2.7.0), and provokes failure on travis. Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
2016-06-08Adding support for git remote set-url/get-url API to RemoteGuyzmo
Both commands enable handling of a little known feature of git, which is to support multiple URL for one remote. You can add multiple url using the `set_url` subcommand of `git remote`. As listing them is also handy, there's a nice method to do it, using `get_url`. * adding set_url method that maps to the git remote set-url command¶ * can be used to set an URL, or replace an URL with optional positional arg¶ * can be used to add, delete URL with kwargs (matching set-url options)¶ * adding add_url, delete_url methods that wraps around set_url for conveniency¶ * adding urls property that yields an iterator over the setup urls for a remote¶ * adding a test suite that checks all use case scenarii of this added API.¶ Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
2016-06-06Don't choke on (legitimately) invalidly encoded Unicode pathsVincent Driessen
2016-06-06Can get a str object from stream.read rather then bytes.Barry Scott
Convert to the expected bytes.
2016-06-06log all the output from stdout and stderr for debugging process failuresBarry Scott
2016-06-06Merge remote-tracking branch 'upstream/master' into ↵Barry Scott
pr-cmd-raise-with-stderr-on-error
2016-06-02Merge pull request #460 from ddanier/autointerrupt_del_no_os_killSebastian Thiel
Make sure os is not even partly destroyed
2016-06-02fix(test): remove unused importSebastian Thiel
2016-06-01Make sure os is not even partly destroyedDavid Danier
2016-06-01Fixed 'TypeError: decode() takes no keyword arguments' on Python 2.6Andreas Maier
2016-06-01fix(test): do not skip test on travisSebastian Thiel
Please exclude the particular assertion instead. Related to https://github.com/gitpython-developers/GitPython/commit/a3f24f64a20d1e09917288f67fd21969f4444acd#commitcomment-17691581
2016-05-30Fix regexVincent Driessen
This catches the case where the matched line contains "(" or ")" characters.
2016-05-30Merge pull request #456 from ↵Sebastian Thiel
gitpython-developers/fix-for-invalid-data-in-commits Add test case as example of Git commit with invalid data
2016-05-30Merge pull request #454 from ↵Sebastian Thiel
gitpython-developers/fix-octal-escaped-path-parser-bug Fix bug in diff parser output
2016-05-30Make sure that stderr is converted to bytesBarry Scott
remove stderr for a wait() that is not the GitPython wrapper.
2016-05-30Ignore invalid data when decoding commit objectsVincent Driessen
Previously, GitPython chokes on this while decoding. Rather than choking, instead accept the error and replace the invalid bytes by the � (\x80) char.
2016-05-30Add test case as example of Git commit with invalid dataVincent Driessen
This is a real commit from the microjs.com open source project, see https://github.com/madrobby/microjs.com/commit/7e8457c17850d0991763941213dcb403d80f39f8, which is declared to be encoded in UTF-8, but contains invalid bytes. This makes GitPython choke on it while decoding. Rather than choking, this should instead accept the error and replace the invalid bytes by the � (\x80) char.
2016-05-30Fix flake8 complaintsBarry Scott
2016-05-30Skip test that always fails on Travis CIfix-ci-testsVincent Driessen
2016-05-30Fix bug in diff parser outputVincent Driessen
The diff --patch parser was missing some edge case where Git would encode non-ASCII chars in path names as octals, but these weren't decoded properly. \360\237\222\251.txt Decoded via utf-8, that will return: 💩.txt
2016-05-29Return stderr lines from a pull() call that failsBarry Scott
2016-05-29Return all the stderr messge after an error is detected for pull()Barry Scott
2016-05-29chore(remote): better super-class call syntaxSebastian Thiel
Python :) !! Related to #451
2016-05-29chore(flake8): whitespace ...Sebastian Thiel
Related to #451 Signed-off-by: Sebastian Thiel <byronimo@gmail.com>
2016-05-29Fix traceback because _seen_ops is not initialisedBarry Scott
must call the base class __init__
2016-05-29fix(remote): improve version checkSebastian Thiel
Make version check much more readable, and fix it at the same time. The previous implementation would assume progress is supported just by looking at the patch-level for instance. A quick check of the git sources seems to indicate the --progress flag exists in v1.7 of the git command-line already. Fixes #449
2016-05-29fix(remote): Add CallableRemoteProgressSebastian Thiel
That way, the base type doesn't need any adjustment. Related to #450
2016-05-29chore(misc): cleanup and docsSebastian Thiel
Minor adjustments to PR to match current code style. Related to #450
2016-05-28Merge remote-tracking branch 'upstream/master'Barry Scott
2016-05-28The progress arg to push, pull, fetch and clone is now a python callable.Barry Scott
This simplifies the API and removes the parser, RemoteProgres, from the API as RemoteProgress is an internal detail of the implementation. progress is accepted as: * None - drop progress messages * callable (function etc) - call the function with the same args as update * object - assume its RemoteProgress derived as use as before RemoteProgress takes an optional progress_function argument. It will call the progress function if not None otherwise call self.update as it used to.
2016-05-27Merge pull request #447 from Xender/patch-1Sebastian Thiel
Use proper syntax for conditional expressions.
2016-05-26Use proper syntax for conditional expressionAleksander Nitecki
(instead of abusing the "short-circuit" property of logical operations)
2016-05-26Changing warning to debug logging, to avoid warning showing off when ↵Guyzmo
nothing's wrong cf #444 Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
2016-05-26fix(remote): py3 compatibilitySebastian Thiel
Related to #444
2016-05-26fix(remote): py3 compatibilitySebastian Thiel
2016-05-26fix(remote): use universal_newlines for fetch/pushSebastian Thiel
That way, real-time parsing of output should finally be possible. Related to #444
2016-05-26fix(remote): real-time reading of lines from stderrSebastian Thiel
That way, progress usage will behave as expected. Fixes #444
2016-05-26import OrderedDict from git.odict rather than directly from collections, to ↵Kenneth Hoste
pix Py2.6 compatibility
2016-05-25fix(remote): better array truncation logicSebastian Thiel
Previously, the logic was not correct. Now it should work either way, truncating the correct list to assure both always have the same length. Related to #442
2016-05-25fix(remote): remove assertion in favour of runtime stabilitySebastian Thiel
Fixes #442