Skip to content

git: git_log output schema differs between filtered vs unfiltered branches #4469

Description

@chirag127

Problem

git_log returns two different string shapes depending on whether start_timestamp/end_timestamp is passed, breaking downstream parsing.

Steps

  1. Run mcp-server-git (v0.6.2) against any repo.
  2. Call git_log with no timestamps.
  3. Call git_log with start_timestamp='1 week ago'.
  4. Compare the two returned entries for the same commit.

Expected

Same output schema regardless of filter branch.

Actual

Unfiltered branch (src/git/src/mcp_server_git/server.py:191-197) uses !r, producing:

Commit: 'a1b2c3...'
Author: <git.Actor "Name <email>">
Message: 'subject\n\nbody\n'

Filtered branch (server.py:180-185) emits raw values via --format=%H%n%an%n%ad%n%s%n:

Commit: a1b2c3...
Author: Name
Message: subject

Also, filtered branch loses commit body entirely (%s = subject only) while unfiltered emits commit.message (subject + body).

Environment

  • mcp-server-git 0.6.2 (src/git/pyproject.toml)
  • Python >=3.10, gitpython>=3.1.50

Thanks for maintaining modelcontextprotocol/servers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions