← 返回首页
fix(blame): lazily fetch full commit message · gitpython-developers/GitPython@2ff3a3e · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 2ff3a3e

Browse files
committed
fix(blame): lazily fetch full commit message
That way, we will not only get the summary line contained in the blame, but fetch the full message. This is more costly than the previous implementation allowed it to be, but being less surprising/correct certainly is the preferred behaviour here. Fixes #485
1 parent 0ed3cd7 commit 2ff3a3e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎git/repo/base.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,7 @@ def blame_incremental(self, rev, file, **kwargs):
714714
authored_date=int(props[b'author-time']),
715715
committer=Actor(safe_decode(props[b'committer']),
716716
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']))
719718
commits[hexsha] = c
720719
else:
721720
# Discard the next line (it's a filename end tag)
@@ -815,8 +814,7 @@ def blame(self, rev, file, incremental=False, **kwargs):
815814
authored_date=info['author_date'],
816815
committer=Actor._from_string(
817816
info['committer'] + ' ' + info['committer_email']),
818-
committed_date=info['committer_date'],
819-
message=info['summary'])
817+
committed_date=info['committer_date'])
820818
commits[sha] = c
821819
# END if commit objects needs initial creation
822820
if not is_binary:

‎git/test/test_repo.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_should_display_blame_information(self, git):
307307
assert_equal('Tom Preston-Werner', c.committer.name)
308308
assert_equal('tom@mojombo.com', c.committer.email)
309309
assert_equal(1191997100, c.committed_date)
310-
assert_equal('initial grit setup', c.message)
310+
self.assertRaisesRegexp(ValueError, "634396b2f541a9f2d58b00be1a07f0c358b999b3 missing", lambda: c.message)
311311

312312
# test the 'lines per commit' entries
313313
tlist = b[0][1]

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.