summaryrefslogtreecommitdiff
path: root/git
Commit message (Collapse)AuthorAgeFilesLines
* Skip test that always fails on Travis CIfix-ci-testsVincent Driessen2016-05-301-5/+6
|
* chore(remote): better super-class call syntaxSebastian Thiel2016-05-291-1/+1
| | | | | | Python :) !! Related to #451
* chore(flake8): whitespace ...Sebastian Thiel2016-05-291-1/+1
| | | | | | Related to #451 Signed-off-by: Sebastian Thiel <byronimo@gmail.com>
* Fix traceback because _seen_ops is not initialisedBarry Scott2016-05-291-2/+2
| | | | must call the base class __init__
* fix(remote): improve version checkSebastian Thiel2016-05-291-2/+2
| | | | | | | | | | | | | 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
* fix(remote): Add CallableRemoteProgressSebastian Thiel2016-05-292-12/+22
| | | | | | That way, the base type doesn't need any adjustment. Related to #450
* chore(misc): cleanup and docsSebastian Thiel2016-05-294-34/+24
| | | | | | Minor adjustments to PR to match current code style. Related to #450
* Merge remote-tracking branch 'upstream/master'Barry Scott2016-05-282-16/+34
|\
| * Merge pull request #447 from Xender/patch-1Sebastian Thiel2016-05-271-1/+1
| |\ | | | | | | Use proper syntax for conditional expressions.
| | * Use proper syntax for conditional expressionAleksander Nitecki2016-05-261-1/+1
| | | | | | | | | (instead of abusing the "short-circuit" property of logical operations)
| * | Changing warning to debug logging, to avoid warning showing off when ↵Guyzmo2016-05-261-1/+1
| |/ | | | | | | | | | | | | | | nothing's wrong cf #444 Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
| * fix(remote): py3 compatibilitySebastian Thiel2016-05-261-2/+2
| | | | | | | | Related to #444
| * fix(remote): py3 compatibilitySebastian Thiel2016-05-261-2/+2
| |
| * fix(remote): use universal_newlines for fetch/pushSebastian Thiel2016-05-262-6/+13
| | | | | | | | | | | | That way, real-time parsing of output should finally be possible. Related to #444
| * fix(remote): real-time reading of lines from stderrSebastian Thiel2016-05-261-1/+1
| | | | | | | | | | | | That way, progress usage will behave as expected. Fixes #444
| * import OrderedDict from git.odict rather than directly from collections, to ↵Kenneth Hoste2016-05-261-1/+1
| | | | | | | | pix Py2.6 compatibility
| * fix(remote): better array truncation logicSebastian Thiel2016-05-251-5/+9
| | | | | | | | | | | | | | 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
| * fix(remote): remove assertion in favour of runtime stabilitySebastian Thiel2016-05-251-4/+11
| | | | | | | | Fixes #442
* | The progress arg to push, pull, fetch and clone is now a python callable.Barry Scott2016-05-283-10/+54
|/ | | | | | | | | | | | | 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.
* fix(RemoteProgress): improve message sanitizationSebastian Thiel2016-05-252-5/+17
| | | | | | Don't allow `, ` prefixes or suffixes in messages. Fixes #438
* Merge branch 'jonathanchu-master'Vincent Driessen2016-05-242-3/+2
|\
| * Ignore trailing last empty string in .split() outputVincent Driessen2016-05-241-4/+1
| |
| * Check if byte string is empty for py3 compatibilityJonathan Chu2016-05-241-1/+1
| |
| * Split lines by new line charactersJonathan Chu2016-05-242-3/+5
| | | | | | | | | | | | Opt to split lines by the new line character instead of letting `splitlines()` do this. This helps catch the issue when there are special characters in the line, particular the commit summary section.
* | fix(cmd): fix with_stdout implementationSebastian Thiel2016-05-241-1/+1
|/ | | | | | | | | | | | | | Admittedly this fix is solely based on the documentation provided for this parameter, which indicated a different intend than was actually implemented. Also I don't believe doing this will cause any harm. As a special note: the call to `open(os.devnull, 'wb')` does not seem leak the handle, apparently it is given as-is to the subprocess, which will then close it naturally. This was tested using an interactive session via `htop` on osx. Fixes #437
* fix(cmd): don't catch progress handler exceptionsSebastian Thiel2016-05-241-6/+1
| | | | Fixes #435
* Merge pull request #433 from StevenWColby/masterSebastian Thiel2016-05-196-6/+6
|\ | | | | Need spaces in Emacs style encoding comment
| * Need spaces in Emacs style encoding commentSteven Colby2016-05-186-6/+6
| | | | | | | | | | Although it's hard to see, PEP-0263 does have ws delimiting the 'coding' string. This commit will fix the root cause of (at least) one bug: https://lists.fedoraproject.org/archives/list/eclipse-sig@lists.fedoraproject.org/thread/5XQ5JRHG6DPPMGRDU7TA2AO4EYS2H7AG/
* | Merge pull request #431 from guyzmo/fix-opt_arg-orderSebastian Thiel2016-05-191-0/+3
|\ \ | | | | | | Fix order of operators before executing the git command
| * | Fix order of operators before executing the git commandGuyzmo2016-05-121-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Python 3.3, the hash value of an object is seeded randomly, making it change between each call. As a consequence, the `dict` type relying on the hash value for the order of the items upon iterating on it, and the parameters passed to `git` being passed as `kwargs` to the `execute()` method, the order of parameters will change randomly between calls. For example, when you call `git.remote.pull()` in a code, two consecutives run will generate: 1. git pull --progress -v origin master 2. git pull -v --progress origin master Within the `transform_kwargs()` method, I'm promoting `kwargs` into an `collections.OrderedDict` being built with `kwargs` sorted on the keys. Then it will ensure that each subsequent calls will execute the parameters in the same order.
* | Use correct mode for executable filesSebastian Thiel2016-05-192-2/+2
| | | | | | | | Fixes #430
* | Clarify costs of certain propertiesSebastian Thiel2016-05-191-2/+7
| | | | | | | | Fixes #428
* | Deprecate Diffable.rename for .renamed_fileSebastian Thiel2016-05-192-1/+12
|/ | | | Fixes #426
* Allow "@" sign in fetch output linesVincent Driessen2016-04-241-2/+1
|
* Fix assertion2.0.0Sebastian Thiel2016-04-221-1/+1
| | | | Who would have thought we ever go 2.0 ;).
* Merge pull request #414 from nvie/support-full-datetimes-on-commitsSebastian Thiel2016-04-203-2/+50
|\ | | | | Add support for getting "aware" datetime info
| * Fix accidentally added importVincent Driessen2016-04-191-1/+0
| |
| * Add support for getting "aware" datetime infoVincent Driessen2016-04-194-2/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds 2 properties to commits. Their values are derived from the existing data stored on them, but this makes them more conveniently queryable: - authored_datetime - committed_datetime These return "aware" datetimes, so they are effectively companions to their raw timestamp equivalents, respectively `authored_date` and `committed_date`. These datetime instances are convenient structures since they show the author-local commit date and their UTC offset.
* | Merge pull request #415 from nvie/fix-for-unicode-pathsSebastian Thiel2016-04-203-15/+139
|\ \ | | | | | | Fix diff patch parser for paths with unsafe chars
| * | Python 3 compat fixesVincent Driessen2016-04-202-2/+5
| | | | | | | | | | | | Specifically "string_escape" does not exist as an encoding anymore.
| * | Fix diff patch parser for paths with unsafe charsVincent Driessen2016-04-193-15/+136
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This specifically covers the cases where unsafe chars occur in path names, and git-diff -p will escape those. From the git-diff-tree manpage: > 3. TAB, LF, double quote and backslash characters in pathnames are > represented as \t, \n, \" and \\, respectively. If there is need > for such substitution then the whole pathname is put in double > quotes. This patch checks whether or not this has happened and will unescape those paths accordingly. One thing to note here is that, depending on the position in the patch format, those paths may be prefixed with an a/ or b/. I've specifically made sure to never interpret a path that actually starts with a/ or b/ incorrectly. Example of that subtlety below. Here, the actual file path is "b/normal". On the diff file that gets encoded as "b/b/normal". diff --git a/b/normal b/b/normal new file mode 100644 index 0000000000000000000000000000000000000000..eaf5f7510320b6a327fb308379de2f94d8859a54 --- /dev/null +++ b/b/normal @@ -0,0 +1 @@ +dummy content Here, we prefer the "---" and "+++" lines' values. Note that these paths start with a/ or b/. The only exception is the value "/dev/null", which is handled as a special case. Suppose now the file gets moved "b/moved", the output of that diff would then be this: diff --git a/b/normal b/b/moved similarity index 100% rename from b/normal rename to b/moved We prefer the "rename" lines' values in this case (the "diff" line is always a last resort). Take note that those lines are not prefixed with a/ or b/, but the ones in the "diff" line are (just like the ones in "---" or "+++" lines).
* | Allow "$" sign in fetch output linesVincent Driessen2016-04-201-1/+1
|/
* Support repeated kwargsVincent Driessen2016-04-192-12/+24
| | | | | | | | | | | | | Some Git command line options are allowed to be repeated multiple times. Examples of this are the -C flag which may occur more than once to "strengthen" its effect, or the -L flag on Git blames, to select multiple blocks of lines to blame. $ git diff -C -C HEAD~1 HEAD $ git blame -L 1-3 -L 12-18 HEAD -- somefile.py This patch supports passing a list/tuple as the value part for kwargs, so that the generated Git command contain the repeated options.
* Fix order of regex partsVincent Driessen2016-04-191-3/+4
| | | | | When both old/new mode and rename from/to lines are found, they will appear in different order.
* Make test stricterVincent Driessen2016-04-191-1/+1
|
* Fix regexVincent Driessen2016-04-191-2/+2
| | | | | | This makes sure we're not matching a \n here by accident. It's now almost the same as the original that used \S+, except that spaces are not eaten at the end of the string (for files that end in a space).
* Make diff patch parsing more reliableVincent Driessen2016-04-194-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | The a_path and b_path cannot reliably be read from the first diff line as it's ambiguous. From the git-diff manpage: > The a/ and b/ filenames are the same unless rename/copy is involved. > Especially, **even for a creation or a deletion**, /dev/null is not > used in place of the a/ or b/ filenames. This patch changes the a_path and b_path detection to read it from the more reliable locations further down the diff headers. Two use cases are fixed by this: - As the man page snippet above states, for new/deleted files the a or b path will now be properly None. - File names with spaces in it are now properly parsed. Working on this patch, I realized the --- and +++ lines really belong to the diff header, not the diff contents. This means that when parsing the patch format, the --- and +++ will now be swallowed, and not end up anymore as part of the diff contents. The diff contents now always start with an @@ line. This may be a breaking change for some users that rely on this behaviour. However, those users could now access that information more reliably via the normal Diff properties a_path and b_path now.
* Merge remote-tracking branch 'upstream/master' into ↵Vincent Driessen2016-04-194-13/+45
|\ | | | | | | enrich-incremental-blame-output
| * Remove Python 2.6 hackVincent Driessen2016-04-191-8/+1
| | | | | | | | Since support was dropped.
| * Perform diff-tree recursively to have the same output as diffVincent Driessen2016-04-141-0/+2
| |