| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,6 @@ The list of dependencies are listed in `./requirements.txt` and `./test-requirem | |||
| 18 | 18 | ||
| 19 | 19 | ### INSTALL | |
| 20 | 20 | ||
| 21 | - [](https://pypi.python.org/pypi/GitPython/) | ||
| 22 | - [](https://pypi.python.org/pypi/GitPython/) | ||
| 23 | - | ||
| 24 | 21 | If you have downloaded the source code: | |
| 25 | 22 | ||
| 26 | 23 | python setup.py install | |
@@ -101,8 +98,6 @@ New BSD License. See the LICENSE file. | |||
| 101 | 98 | [](https://travis-ci.org/gitpython-developers/GitPython) | |
| 102 | 99 | [](https://codeclimate.com/github/gitpython-developers/GitPython) | |
| 103 | 100 | [](https://readthedocs.org/projects/gitpython/?badge=stable) | |
| 104 | - [](http://www.issuestats.com/github/gitpython-developers/GitPython) | ||
| 105 | - [](http://www.issuestats.com/github/gitpython-developers/GitPython) | ||
| 106 | 101 | ||
| 107 | 102 | Now that there seems to be a massive user base, this should be motivation enough to let git-python return to a proper state, which means | |
| 108 | 103 | ||
@@ -111,4 +106,4 @@ Now that there seems to be a massive user base, this should be motivation enough | |||
| 111 | 106 | ||
| 112 | 107 | [twitch-channel]: http://www.twitch.tv/byronimo/profile | |
| 113 | 108 | [youtube-playlist]: https://www.youtube.com/playlist?list=PLMHbQxe1e9MnoEcLhn6Yhv5KAvpWkJbL0 | |
| 114 | - [contributing]: https://github.com/gitpython-developers/GitPython/blob/master/README.md | ||
| 109 | + [contributing]: https://github.com/gitpython-developers/GitPython/blob/master/README.md | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1 +1 @@ | |||
| 1 | - 2.0.7dev0 | ||
| 1 | + 2.0.8dev0 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,18 @@ | |||
| 2 | 2 | Changelog | |
| 3 | 3 | ========= | |
| 4 | 4 | ||
| 5 | + 2.0.8 - Bugfixes | ||
| 6 | + ================ | ||
| 7 | + | ||
| 8 | + * `DiffIndex.iter_change_type(...)` produces better results when diffing | ||
| 9 | + an index against the working tree. | ||
| 10 | + | ||
| 11 | + 2.0.7 - New Features | ||
| 12 | + ==================== | ||
| 13 | + | ||
| 14 | + * `IndexFile.commit(...,skip_hooks=False)` added. This parameter emulates the | ||
| 15 | + behaviour of `--no-verify` on the command-line. | ||
| 16 | + | ||
| 5 | 17 | 2.0.6 - Fixes and Features | |
| 6 | 18 | ========================== | |
| 7 | 19 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -474,8 +474,13 @@ Using environment variables, you can further adjust the behaviour of the git com | |||
| 474 | 474 | ||
| 475 | 475 | * **GIT_PYTHON_TRACE** | |
| 476 | 476 | ||
| 477 | - * If set to non-0, all executed git commands will be logged using a python logger. | ||
| 478 | - * if set to *full*, the executed git command and its output on stdout and stderr will be logged using a python logger. | ||
| 477 | + * If set to non-0, all executed git commands will be shown as they happen | ||
| 478 | + * If set to *full*, the executed git command _and_ its entire output on stdout and stderr will be shown as they happen | ||
| 479 | + | ||
| 480 | + **NOTE**: All logging is outputted using a Python logger, so make sure your program is configured to show INFO-level messages. If this is not the case, try adding the following to your program:: | ||
| 481 | + | ||
| 482 | + import logging | ||
| 483 | + logging.basicConfig(level=logging.INFO) | ||
| 479 | 484 | ||
| 480 | 485 | * **GIT_PYTHON_GIT_EXECUTABLE** | |
| 481 | 486 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,7 +183,9 @@ def iter_change_type(self, change_type): | |||
| 183 | 183 | raise ValueError("Invalid change type: %s" % change_type) | |
| 184 | 184 | ||
| 185 | 185 | for diff in self: | |
| 186 | - if change_type == "A" and diff.new_file: | ||
| 186 | + if diff.change_type == change_type: | ||
| 187 | + yield diff | ||
| 188 | + elif change_type == "A" and diff.new_file: | ||
| 187 | 189 | yield diff | |
| 188 | 190 | elif change_type == "D" and diff.deleted_file: | |
| 189 | 191 | yield diff | |
@@ -247,11 +249,12 @@ class Diff(object): | |||
| 247 | 249 | NULL_BIN_SHA = b"\0" * 20 | |
| 248 | 250 | ||
| 249 | 251 | __slots__ = ("a_blob", "b_blob", "a_mode", "b_mode", "a_rawpath", "b_rawpath", | |
| 250 | - "new_file", "deleted_file", "raw_rename_from", "raw_rename_to", "diff") | ||
| 252 | + "new_file", "deleted_file", "raw_rename_from", "raw_rename_to", | ||
| 253 | + "diff", "change_type") | ||
| 251 | 254 | ||
| 252 | 255 | def __init__(self, repo, a_rawpath, b_rawpath, a_blob_id, b_blob_id, a_mode, | |
| 253 | 256 | b_mode, new_file, deleted_file, raw_rename_from, | |
| 254 | - raw_rename_to, diff): | ||
| 257 | + raw_rename_to, diff, change_type): | ||
| 255 | 258 | ||
| 256 | 259 | self.a_mode = a_mode | |
| 257 | 260 | self.b_mode = b_mode | |
@@ -286,6 +289,7 @@ def __init__(self, repo, a_rawpath, b_rawpath, a_blob_id, b_blob_id, a_mode, | |||
| 286 | 289 | self.raw_rename_to = raw_rename_to or None | |
| 287 | 290 | ||
| 288 | 291 | self.diff = diff | |
| 292 | + self.change_type = change_type | ||
| 289 | 293 | ||
| 290 | 294 | def __eq__(self, other): | |
| 291 | 295 | for name in self.__slots__: | |
@@ -435,7 +439,7 @@ def _index_from_patch_format(cls, repo, stream): | |||
| 435 | 439 | new_file, deleted_file, | |
| 436 | 440 | rename_from, | |
| 437 | 441 | rename_to, | |
| 438 | - None)) | ||
| 442 | + None, None)) | ||
| 439 | 443 | ||
| 440 | 444 | previous_header = header | |
| 441 | 445 | # end for each header we parse | |
@@ -483,7 +487,7 @@ def _index_from_raw_format(cls, repo, stream): | |||
| 483 | 487 | # END add/remove handling | |
| 484 | 488 | ||
| 485 | 489 | diff = Diff(repo, a_path, b_path, a_blob_id, b_blob_id, old_mode, new_mode, | |
| 486 | - new_file, deleted_file, rename_from, rename_to, '') | ||
| 490 | + new_file, deleted_file, rename_from, rename_to, '', change_type) | ||
| 487 | 491 | index.append(diff) | |
| 488 | 492 | # END for each line | |
| 489 | 493 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -313,7 +313,7 @@ def set_reference(self, ref, logmsg=None): | |||
| 313 | 313 | ||
| 314 | 314 | lfd = LockedFD(fpath) | |
| 315 | 315 | fd = lfd.open(write=True, stream=True) | |
| 316 | - fd.write(write_value.encode('ascii')) | ||
| 316 | + fd.write(write_value.encode('ascii') + b'\n') | ||
| 317 | 317 | lfd.commit() | |
| 318 | 318 | ||
| 319 | 319 | # Adjust the reflog | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -714,8 +714,7 @@ def blame_incremental(self, rev, file, **kwargs): | |||
| 714 | 714 | authored_date=int(props[b'author-time']), | |
| 715 | 715 | committer=Actor(safe_decode(props[b'committer']), | |
| 716 | 716 | safe_decode(props[b'committer-mail'].lstrip(b'<').rstrip(b'>'))), | |
| 717 | - committed_date=int(props[b'committer-time']), | ||
| 718 | - message=safe_decode(props[b'summary'])) | ||
| 717 | + committed_date=int(props[b'committer-time'])) | ||
| 719 | 718 | commits[hexsha] = c | |
| 720 | 719 | else: | |
| 721 | 720 | # Discard the next line (it's a filename end tag) | |
@@ -815,8 +814,7 @@ def blame(self, rev, file, incremental=False, **kwargs): | |||
| 815 | 814 | authored_date=info['author_date'], | |
| 816 | 815 | committer=Actor._from_string( | |
| 817 | 816 | info['committer'] + ' ' + info['committer_email']), | |
| 818 | - committed_date=info['committer_date'], | ||
| 819 | - message=info['summary']) | ||
| 817 | + committed_date=info['committer_date']) | ||
| 820 | 818 | commits[sha] = c | |
| 821 | 819 | # END if commit objects needs initial creation | |
| 822 | 820 | if not is_binary: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + :100644 100644 739bc65220ad90e9ebfa2d6af1723b97555569a4 0000000000000000000000000000000000000000 M README.md | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,6 +104,15 @@ def test_diff_with_rename(self): | |||
| 104 | 104 | assert diff.rename_to == 'that' | |
| 105 | 105 | assert len(list(diffs.iter_change_type('R'))) == 1 | |
| 106 | 106 | ||
| 107 | + def test_diff_of_modified_files_not_added_to_the_index(self): | ||
| 108 | + output = StringProcessAdapter(fixture('diff_abbrev-40_full-index_M_raw_no-color')) | ||
| 109 | + diffs = Diff._index_from_raw_format(self.rorepo, output.stdout) | ||
| 110 | + | ||
| 111 | + assert len(diffs) == 1, 'one modification' | ||
| 112 | + assert len(list(diffs.iter_change_type('M'))) == 1, 'one modification' | ||
| 113 | + assert diffs[0].change_type == 'M' | ||
| 114 | + assert diffs[0].b_blob is None | ||
| 115 | + | ||
| 107 | 116 | def test_binary_diff(self): | |
| 108 | 117 | for method, file_name in ((Diff._index_from_patch_format, 'diff_patch_binary'), | |
| 109 | 118 | (Diff._index_from_raw_format, 'diff_raw_binary')): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments