summaryrefslogtreecommitdiff
path: root/git/test
Commit message (Collapse)AuthorAgeFilesLines
* Skip test that always fails on Travis CIfix-ci-testsVincent Driessen2016-05-301-5/+6
|
* fix(RemoteProgress): improve message sanitizationSebastian Thiel2016-05-251-0/+8
| | | | | | Don't allow `, ` prefixes or suffixes in messages. Fixes #438
* Split lines by new line charactersJonathan Chu2016-05-241-1/+1
| | | | | | 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.
* Merge pull request #433 from StevenWColby/masterSebastian Thiel2016-05-195-5/+5
|\ | | | | Need spaces in Emacs style encoding comment
| * Need spaces in Emacs style encoding commentSteven Colby2016-05-185-5/+5
| | | | | | | | | | 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/
* | Deprecate Diffable.rename for .renamed_fileSebastian Thiel2016-05-191-0/+2
|/ | | | Fixes #426
* 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-201-0/+11
|\ | | | | 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-192-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Python 3 compat fixesVincent Driessen2016-04-201-1/+1
| | | | | | | | Specifically "string_escape" does not exist as an encoding anymore.
* | Fix diff patch parser for paths with unsafe charsVincent Driessen2016-04-192-2/+102
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Support repeated kwargsVincent Driessen2016-04-191-0/+4
| | | | | | | | | | | | | 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.
* Make test stricterVincent Driessen2016-04-191-1/+1
|
* Make diff patch parsing more reliableVincent Driessen2016-04-193-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-2/+28
|\ | | | | | | enrich-incremental-blame-output
| * Fix test casesVincent Driessen2016-04-141-4/+5
| |
| * Support "root" as a special value in .diff() callsVincent Driessen2016-04-142-1/+26
| | | | | | | | This enabled getting diff patches for root commits.
* | Return all available data from git-blameVincent Driessen2016-04-141-2/+9
|/ | | | | Returning this now to avoid having to change the function's return value structure later on if we want to emit more information.
* Merge pull request #409 from nvie/add-incremental-blame-supportSebastian Thiel2016-04-142-0/+54
|\ | | | | Add incremental blame support
| * Add incremental blame supportVincent Driessen2016-04-132-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a sibling method to Repo's blame method: Repo.blame_incremental(rev, path, **kwargs) This can alternatively be called using: Repo.blame(rev, path, incremental=True) The main difference is that blame incremental is a bit more efficient and does not return the full file's contents, just the commits and the line number ranges. The parser is a bit more straight-forward and faster since the incremental output format is defined a little stricter.
* | fixed unittest of issue #407 for Python3Piotr Pietraszkiewicz2016-04-131-1/+1
| |
* | fix(index): avoid recursing endlessly in add()Piotr Pietraszkiewicz2016-04-131-0/+11
|/ | | | Issue #407
* Fix testsVincent Driessen2016-04-071-3/+3
|
* Add test and fixture for diff index from raw formatJonathan Chu2016-03-162-0/+7
| | | | | | This tests the edge case of doing a diff against a single whitespace filename and returns the proper change type. All other normal usage of this diff classmethod should remain unchanged.
* config parsers as context mangers can now be reentered for locksRaphael Boidol2016-03-061-0/+17
|
* Merge pull request #385 from yarikoptic/skip-testSebastian Thiel2016-02-251-0/+4
|\ | | | | ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git merge-base --is-ancestor
| * ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git ↵Yaroslav Halchenko2016-02-141-0/+4
| | | | | | | | merge-base --is-ancestor
* | enable config parsers to be used as context managersRaphael Boidol2016-02-201-39/+31
|/ | | | if used as context managers, the parsers will automatically release their file locks.
* fix(refs): set fixture different versionSebastian Thiel2016-02-111-1/+1
|
* chore(flake8): unnused importSebastian Thiel2016-02-071-1/+0
|
* fix(clone): call communicate if there is no progress handlerSebastian Thiel2016-02-071-1/+1
| | | | | | Previously, it could have happened that pipes ran full, deadlocking the operation Related to #72
* DOC: minor typosYaroslav Halchenko2016-01-081-1/+1
|
* fix(tree): remove Tree.cache - use IndexFile.write_tree() insteadSebastian Thiel2015-12-141-85/+0
| | | | | | For more information, see CHANGES.rst Fixes #369
* fix(tree): show that fixing Tree.cache is not possibleSebastian Thiel2015-12-141-20/+35
| | | | | | | | | | The problem is that a per-tree modification API cannot work properly, as the sorting is based on full paths of all entries within the repository. This feat can only be achieved by the index, which to my knowledge already does it correctly. The only fix is to remove the misleading API entirely, which will happen in the next commit. Related to #369
* fix(tree): tree item sort now uses git-styleSebastian Thiel2015-12-131-0/+20
| | | | | | | | | Previously it was possible to generate trees which didn't appear legit to git as gitpython's sorting was a simple alpha-numeric sort. Git uses one that minimizes literal string comparisons though, and thus behaves slightly differently sometimes. Fixes #369
* fix(config): ignore empty values in config fileSebastian Thiel2015-09-062-0/+11
| | | | | | | | | | | Similar to git, we now ignore options which have no value. Previously it would not handle it consistently, and throw a parsing error the first time the cache was built. Afterwards, it was fully usable though. Now we specifically check for the case of no-value options instead. Closes #349
* fix(compat): make test work with git >= 2.5Sebastian Thiel2015-08-291-0/+3
|
* fix(repo): fail loudly if worktrees are usedSebastian Thiel2015-08-291-1/+19
| | | | | | | | | | | | | | | As GitPython is in maintenance mode, there will be no new features. However, I believe it's good idea to explicitly state we do not support certain things if this is the case. Therefore, when worktrees are encountered, we will throw an specific exception to indicate that. The current implementation is hacky to speed up development, and increases the risk of failing due to false-positive worktree directories. Related to #344
* fix(repo): use GitCmdObjectDB by defaultSebastian Thiel2015-08-221-1/+1
| | | | | | This should fix resource leaking issues once and for all. Related #304
* Merge pull request #341 from StyXman/masterSebastian Thiel2015-08-211-1/+1
|\ | | | | fix(cmd): make short options with arguments become two separate argum…
| * fix(test): update to changes.Marcos Dione2015-08-201-1/+1
| |
* | fix(test_index): fix encodingSebastian Thiel2015-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | I really never want to touch python again, and never deal with py2/3 unicode handling anymore. By now, it seems pretty much anything is better. Is python to be blamed for it entirely ? Probably not, but there are better alternatives. Nim ? Rust ? Ruby ? Totally
* | fix(commit): serialization timezone handlingSebastian Thiel2015-08-171-1/+1
| | | | | | | | | | | | | | | | | | Previously timezones which were not divisable by 3600s would be parsed correctly, but would serialize into a full hour, rounded up. Now floating point computation is used which fixes the issue. Related to #336
* | fix(tests): remove dependency on sort orderSebastian Thiel2015-08-081-1/+1
| | | | | | | | | | | | | | Now we select the submodule by name, not by index. The latter is not deterministic. Closes #335
* | tests(submodule): add new submodule commitsSebastian Thiel2015-08-081-1/+32
| | | | | | | | | | | | | | | | It's somewhat more complex to add new commits in submodules to the parent repository. The new test shows how to do that in a 'GitPythonic' way. Related to #335
* | fix(index):allow adding non-unicode paths to indexSebastian Thiel2015-07-291-0/+13
|/ | | | | | | | | This issue only surfaced in python 2, in case paths containing unicode characters were not actual unicode objects. In python 3, this was never the issue. Closes #331
* fix(diff): mode-assertions now deal with 0Sebastian Thiel2015-07-291-0/+32
| | | | | | | | If the file was not present, the mode seen in a diff can be legally '0', which previously caused an assertion to fail for no good reason. Now the assertion tests for None instead. Closes #323
* Implement is_ancestorSandy Carter2015-07-211-0/+14
| | | | | Wrap `git merge-base --is-ancestor` into its own function because it acts as a boolean check unlike base `git merge-base call`
* fix(encoding): in untracked_files() and indexSebastian Thiel2015-07-201-13/+15
| | | | | | | | | | | | * untracked_files could, if there were spaces in the path returned, re-rencode the previously decoded unicode string thanks to a `decode("string_escape")` call. Now re-encode into utf-8 afterwards - added test to assure this works indeed * IndexFile.add() didn't handle unicode correctly and would write broken index files. The solution was to compute the path length after encoding it into utf-8 bytes, not before ... . Closes #320