Skip to content

[git] feat: load user name and email - #620

Closed
xiangma9712 wants to merge 1 commit into
modelcontextprotocol:mainfrom
xiangma9712:feature/git-name-and-email
Closed

xiangma9712 wants to merge 1 commit into
modelcontextprotocol:mainfrom
xiangma9712:feature/git-name-and-email

Conversation

@xiangma9712

@xiangma9712 xiangma9712 commented Feb 13, 2025 •

Copy link
Copy Markdown

Description

Add two optional env variable GIT_USER_NAME and GIT_USER_EMAIL to set git config

Server Details

  • Server: git
  • Changes to: tools

Motivation and Context

Default commit user is not specific and not suitable for team development

How Has This Been Tested?

This change it self is committed by MCP with inspector

スクリーンショット 2025-02-13 9 41 17

Breaking Changes

No: it's optional and nothing happens to existing users

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

@olaservo olaservo added server-git Reference implementation for the Git MCP server - src/git enhancement New feature or request labels Mar 27, 2025
git_user_name = os.environ.get("GIT_USER_NAME")
git_user_email = os.environ.get("GIT_USER_EMAIL")

with repo.config_writer() as config:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some input validation here?

@olaservo

Copy link
Copy Markdown
Member

Could you get the latest from main and add tests to the unit tests for this? Thanks!

@olaservo olaservo added the waiting for submitter Waiting for the submitter to provide more info label Jul 18, 2025
@domdomegg

Copy link
Copy Markdown
Member

Hey, thanks for the contribution! This hasn't been updated for a while, so I'm closing it to help us more easily track active contributions. If you're still interested in working on this, please feel free to reopen it. Thanks again for your contribution!

@domdomegg domdomegg closed this Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request server-git Reference implementation for the Git MCP server - src/git waiting for submitter Waiting for the submitter to provide more info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants