summaryrefslogtreecommitdiff
path: root/git/objects/commit.py
Commit message (Collapse)AuthorAgeFilesLines
* Revert the removal of Commit.trailers property.Twist2023-04-231-0/+14
|
* Specify encoding in Commit.trailer_list.Twist2023-04-221-1/+1
|
* Update Commit.trailer_list to return tuples.Twist2023-04-221-11/+16
|
* Deprecate Commit.trailers.Twist2023-04-221-18/+0
|
* Add trailers_list and trailers_list methods to fix the commit trailers ↵Twist2023-04-211-22/+79
| | | | functionality. Update trailers tests.
* fix files list on file renameMatteo Croce2023-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GitPython parses the output of `git diff --numstat` to get the files changed in a commit. This breaks when a commit contains a file rename, because the output of `git diff` is different than expected. This is the output of a normal commit: $ git diff --numstat 8f41a390bf9a^ 8f41a390bf9a 30 5 test/test_repo.py And this a commit containing a rename: $ git diff --numstat 185d847ec764^ 185d847ec764 3 1 .github/workflows/{test_pytest.yml => Future.yml} This can be triggered by this code: for commit in repo.iter_commits(): print(commit.hexsha) for file in commit.stats.files: print(file) Which will print for the normal commit: 8f41a390bf9a54db6f85032bc56b453307b95451 'test/test_repo.py' And when there is a rename: 185d847ec7647fd2642a82d9205fb3d07ea71715 '.github/workflows/{test_pytest.yml => Future.yml}' Additionally, when a path member is removed, the file list become a list of strings, breaking even more the caller. This is in the Linux kernel tree: $ git diff --numstat db401875f438^ db401875f438 1 1 tools/testing/selftests/drivers/net/mlxsw/{spectrum-2 => }/devlink_trap_tunnel_ipip6.sh and GitPython parses it as: db401875f438168c5804b295b93a28c7730bb57a ('tools/testing/selftests/drivers/net/mlxsw/{spectrum-2 => ' '}/devlink_trap_tunnel_ipip6.sh') Fix this by pasing the --no-renames option to `git diff` which ignores renames and print the same output as if the file was deleted from the old path and created in the new one: $ git diff --numstat --no-renames 185d847ec764^ 185d847ec764 57 0 .github/workflows/Future.yml 0 55 .github/workflows/test_pytest.yml
* Add datetime.datetime type to commit_date and author_dateSergeantMenacingGarlic2022-10-131-2/+2
|
* Use the same regex as the Actor class when determining co-authors.Twist2022-08-241-3/+3
|
* Update regex to extract the author string, and create the Actor using the ↵Twist2022-08-231-3/+3
| | | | _from_string classmethod.
* Add co_authors property to the Commit object, which parses the commit ↵Twist2022-08-221-0/+22
| | | | message for designated co-authors, include a simple test.
* reformat according to 'black' configuration file.Sebastian Thiel2022-05-181-35/+11
|
* Run everything through 'black'Sebastian Thiel2022-05-181-119/+220
| | | | | That way people who use it won't be deterred, while it unifies style everywhere.
* Fix various typosluz paz2022-05-071-2/+2
| | | Found via `codespell -q 3 -S ./git/ext/gitdb,./test/fixtures/reflog_master,./test/fixtures/diff_mode_only,./test/fixtures/reflog_HEAD`
* Fix doc string error in Objects.CommitTakuya Kitazawa2022-01-101-2/+2
|
* Use git interpret-trailers for trailers propertyKet3r2022-01-071-17/+26
| | | | | | | The whitespace handling and trailer selection isn't very trivial or good documented. It therefore seemed easier and less error prone to just call git to parse the message for the trailers section and remove superfluos whitespaces.
* Add trailer as commit propertyPeter Kempter2022-01-071-1/+40
| | | | | | | | With the command `git interpret-trailers` git provides a way to interact with trailer lines in the commit messages that look similar to RFC 822 e-mail headers (see: https://git-scm.com/docs/git-interpret-trailers). The new property returns those parsed trailer lines from the message as dictionary.
* add type check to conf_encoding (in thoery could be bool or int)Yobmod2021-08-081-0/+2
|
* Add final types to commit.pyYobmod2021-07-311-3/+3
|
* Fix more missing types in Symbolic.py, cos GuthubActions pytest stuckYobmod2021-07-281-0/+1
|
* Replace all Typeguard with cast, revert update to typing-extensions==3.10.0Yobmod2021-07-241-9/+12
|
* Make types in refs compatible with objectsYobmod2021-07-191-9/+12
|
* Increase mypy strictness (no_implicit_optional & warn_redundant_casts) and ↵Yobmod2021-07-081-1/+1
| | | | fix errors
* Make Commit.message bytes | strYobmod2021-07-011-6/+9
|
* Add missed types to Commit, uncomment to_native_path_linux()Yobmod2021-07-011-31/+51
|
* Type Traversable.traverse() better, start types of submoduleYobmod2021-06-301-15/+31
|
* Make IterableList generic and update throughoutYobmod2021-06-241-2/+2
|
* Update typing-extensions version in requirements.txtYobmod2021-06-231-7/+13
|
* add replace method to git.CommitLars Kellogg-Stedman2021-02-151-7/+36
| | | | | | | | | | | This adds a replace method to git.Commit. The replace method returns a copy of the Commit object with attributes replaced from keyword arguments. For example: >>> old = repo.head.commit >>> new = old.replace(message='This is a test') closes #1123
* Fix inheritance issue at commit.iter_itemsYuri Volchkov2021-02-051-1/+1
| | | | | | | The iterator used to yield Commit() objects, which does not play well with inheritance. Yield cls() instead. Signed-off-by: Yuri Volchkov <yuri@volch.org>
* Remove and replace compat.text_typeHarmon2020-02-081-2/+1
|
* removed Unnecessary “else” after “return”Pratik Anurag2019-10-151-2/+1
|
* removed trailing whitespacesPratik Anurag2019-10-151-1/+1
|
* renamed unused variablesPratik Anurag2019-10-151-1/+1
|
* fix decoding problemishepard2019-09-161-2/+3
|
* Update commit.py constructor docstringDavid Host2019-03-151-1/+1
| | | Fixes issue #806: Commit requires author parameter to be of Actor type, not string.
* Rewrite unnecessary dict/list/tuple calls as literalsHugo2018-03-181-2/+2
|
* Spelling fixesVille Skyttä2017-03-091-1/+1
|
* Fix git.Commit docs typoReuben Sutton2017-02-021-1/+1
|
* Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel2016-10-221-1/+1
|\ | | | | | | ankostis-cygwin
| * src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-1/+1
| |
* | Fix some typosSantiago Castro2016-10-201-2/+2
|/
* src: No PyDev warningsKostis Anagnostopoulos2016-10-041-2/+2
| | | | | | | | + Mark all unused vars and other non-pep8 (PyDev) warnings + test_utils: + enable & fix forgotten IterableList looped path. + unittestize all assertions. + remote: minor fix progress dispatching unknown err-lines
* fix(commit): handle gpgsig properlySebastian Thiel2016-08-211-5/+10
| | | | | | | Assure that gpgsig is not initialized with None to allow the automatic deserialization to kick in. Fixes #500
* Fixed 'TypeError: decode() takes no keyword arguments' on Python 2.6Andreas Maier2016-06-011-3/+3
|
* Ignore invalid data when decoding commit objectsfix-for-invalid-data-in-commitsVincent Driessen2016-05-301-3/+3
| | | | | | Previously, GitPython chokes on this while decoding. Rather than choking, instead accept the error and replace the invalid bytes by the � (\x80) char.
* Add support for getting "aware" datetime infoVincent Driessen2016-04-191-1/+10
| | | | | | | | | | | | | | | | 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.
* fix(commit): respect daylight saving when computing utc-offsetSebastian Thiel2015-11-081-2/+6
| | | | Related to #362
* Added two extra paramaters for commit to take author date and commit dateavi2015-07-171-3/+10
|
* Added NullHandlers to all loggers to preven "No handler" messagesJames Nowell2015-06-251-0/+1
| | | | | | | | When the code is run without setting up loggers, the loggers have no handlers for the emitted messages. The logging module displays: `No handlers could be found for logger "git.cmd"` on the console. By adding a NullHandler (a no-op) the message disappears, and doesn't affect logging when other handlers are configured.
* Fix type error (startswith expects bytes)John L. Walker2015-05-131-1/+1
|