summaryrefslogtreecommitdiff
path: root/git/diff.py
Commit message (Collapse)AuthorAgeFilesLines
* Make diff.DiffIndex generic List['Diff']Yobmod2021-07-061-12/+16
|
* Add 'U' to change_levels (should pass)Yobmod2021-07-061-2/+2
|
* Check change_levels (should fail)Yobmod2021-07-061-2/+2
|
* Readd submodule.base.py typesYobmod2021-07-061-2/+3
|
* Readd typeguard to Diff.pyYobmod2021-07-061-2/+9
|
* Rmv diff typeguardYobmod2021-07-061-18/+10
|
* Rmv submodule types2Yobmod2021-07-061-2/+2
|
* Fix for mrepo2Yobmod2021-07-061-1/+1
|
* Fix Literal TypeguardsYobmod2021-07-061-1/+1
|
* Improve types of diff.pyYobmod2021-07-061-4/+6
|
* Improve types of diff.pyYobmod2021-07-061-6/+14
|
* Add types to objects.base.pyYobmod2021-05-181-2/+2
|
* Add remaining types to IndexFile ._preprocess_add_items() to .diff()Yobmod2021-05-161-2/+2
|
* Add types to cmd.py Gityobmod2021-05-131-4/+6
|
* flake8 fixesyobmod2021-05-081-2/+1
|
* add initial types to remote.pyyobmod2021-05-031-61/+65
|
* add types to git.compat and git.diffyobmod2021-03-021-48/+66
|
* Fix handle_diff_line for -z option.Martin Liska2021-01-061-49/+49
|
* try fixing up test fixtures and implementationSebastian Thiel2021-01-061-2/+2
|
* Add '-z' on top of '--raw' to avoid path name manglingSebastian Thiel2021-01-061-1/+2
| | | | | | | Authored based on https://github.com/gitpython-developers/GitPython/issues/1099#issuecomment-754606044 Fixes #1099
* change decode type and add replace flagDavide Spadini2020-11-101-1/+1
|
* Remove checks for Python 2 and/or 3Harmon2020-02-081-10/+2
|
* Remove and replace compat.binary_typeHarmon2020-02-081-5/+4
|
* Merge branch 'fix/deepsource-issues' of https://github.com/imkaka/GitPython ↵Sebastian Thiel2019-10-291-4/+6
|\ | | | | | | into imkaka-fix/deepsource-issues
| * Merge branch 'master' into fix/deepsource-issuesAnil Khatri2019-10-231-10/+33
| |\
| * | fix Loop variable used outside the loopAnil Khatri2019-10-231-4/+6
| | |
* | | Check if submodule exists before referencingtanaga92019-10-281-1/+2
| |/ |/|
* | Fix #852 by tweaking regex to handle -R option to git diffJJ Graham2019-10-221-1/+1
| |
* | Initial stab at fixing diffs involving submodule changesJJ Graham2019-10-211-0/+8
| |
* | Satisfying flake8JJ Graham2019-10-191-2/+2
| |
* | Updating variable name to more accurately reflect contentsJJ Graham2019-10-191-3/+3
| |
* | Fixed new test for copied filesJJ Graham2019-10-191-2/+4
| |
* | Adding diff support for copied files, still working on testJJ Graham2019-10-191-8/+21
|/
* Fixed error in documentationSyoc2019-01-121-1/+0
| | | | | | The renamed_file function contains the following which ends up on readthedocs: :note: This property is deprecated, please use ``renamed_file`` instead. Removed the line
* Add change in type supportAurélien Matouillot2018-05-191-3/+9
|
* Get correcly rename change_type.Aurélien Matouillot2018-05-191-6/+14
| | | | Also store the rename score
* Rewrite unnecessary dict/list/tuple calls as literalsHugo2018-03-181-2/+2
|
* RF: primarily flake8 lints + minor RF to reduce duplication in PATHEXTYaroslav Halchenko2017-11-271-7/+7
| | | | | I did keep some "bare" except with catch all Exception: , while tried to disable flake8 complaints where clearly all exceptions are to be catched
* Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel2016-10-221-7/+6
|\ | | | | | | ankostis-cygwin
| * src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-7/+6
| |
* | Fix some typosSantiago Castro2016-10-201-7/+7
|/
* Proc, #519: Rework error-exc msgs & log thread-pumps errorsKostis Anagnostopoulos2016-09-281-2/+2
| | | | | + No WindowsError exception. + Add `test_exc.py` for unicode issues. + Single-arg for decoding-streams in pump-func.
* io, dif: #519: FIX DIFF freeze when reading from GILKostis Anagnostopoulos2016-09-281-11/+21
| | | | | | | | | | | | | | | + CAUSE: In Windows, Diffs freeze while reading Popen streams, probably buffers smaller; good-thin(TM) in this case because reading a Popen-proc from the launching-thread freezes GIL. The alternative to use `proc.communicate()` also relies on big buffers. + SOLUTION: Use `cmd.handle_process_output()` to consume Diff-proc streams. + Retroffited `handle_process_output()` code to support also byte-streams, both Threading(Windows) and Select/Poll (Posix) paths updated. - TODO: Unfortunately, `Diff._index_from_patch_format()` still slurps input; need to re-phrase header-regexes linewise to resolve it.
* fix(diff): use explicit change-type if possibleSebastian Thiel2016-07-231-5/+9
| | | | | | | | | | That way, we do not have to figure the change type out by examining the diff object. It's implemented in a way that should yield more desireable results as we keep the change-type that git is providing us with. Fixes #493
* Store raw path bytes in Diff instanceskeep-raw-bytes-on-diffsVincent Driessen2016-06-141-17/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't choke on (legitimately) invalidly encoded Unicode pathsfix-dont-choke-on-invalid-unicode-pathsVincent Driessen2016-06-061-4/+4
|
* Fix bug in diff parser outputfix-octal-escaped-path-parser-bugVincent Driessen2016-05-301-2/+15
| | | | | | | | | | | | 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
* Deprecate Diffable.rename for .renamed_fileSebastian Thiel2016-05-191-1/+10
| | | | Fixes #426
* Python 3 compat fixesVincent Driessen2016-04-201-1/+4
| | | | Specifically "string_escape" does not exist as an encoding anymore.
* Fix diff patch parser for paths with unsafe charsVincent Driessen2016-04-191-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).