Make git identity configurable in settings

This commit is contained in:
Alex Gleason committed 2025-10-14 20:36:29 -05:00
1 parent 51f7a42d3e
commit e4c3fc8b05
13 files changed
+270 -108

No files matched your search

+1 -25
View File
@@ -89,34 +89,10 @@ export class GitCommitTool implements Tool<GitCommitParams> {
// Default to 'main' if we can't get the current branch
}
// Get author info (use default if not configured)
const author = {
name: 'shakespeare.diy',
email: '[email protected]',
};
// Try to get configured author from git config
try {
const configName = await this.git.getConfig({
dir: this.cwd,
path: 'user.name',
});
const configEmail = await this.git.getConfig({
dir: this.cwd,
path: 'user.email',
});
if (configName) author.name = configName;
if (configEmail) author.email = configEmail;
} catch {
// Use defaults if config is not set
}
// Commit the changes
// Commit the changes (author/committer will be set automatically by Git class)
const commitSha = await this.git.commit({
dir: this.cwd,
message: message.trim(),
author,
committer: author,
});
// Get short hash (first 7 characters)