feat: expose gitCoAuthor setting in settings.json and document it#1228
feat: expose gitCoAuthor setting in settings.json and document it#1228tanzhenxin merged 8 commits intoQwenLM:mainfrom
Conversation
|
thanks for your contribution! However, on both platforms, the commit message still does NOT contain the Co-authored-by: Qwen-Coder qwen-coder@alibabacloud.com trailer. I’ve confirmed that: The config file exists at the correct path (~/.qwen/settings.json on macOS, %USERPROFILE%.qwen\settings.json on Windows)
|
bbde7ef to
fea2dc8
Compare
|
Hi @xuewenjie123 thank you for the thorough testing and discovering the issue! I have tried a commit (with a single line commit message) at my Ubuntu 25.04 computer by running these commands and the two Qwen prompts: And I can confirm that the "Co-authored-by: ..." is indeed missing: Give me some time to investigate, then submit a fix and then I will ping you again. |
|
Please update your git branch and try the tests again @xuewenjie123 The root cause have been that the "git commit" string is sometimes not at the beginning of that command string, but is rather prepended by "cd /some/folder &&" command. I have fixed this and tested myself by issueing the Qwen prompt:
Here my Ubuntu 25.04 screenshot:
And then with the
|
9e61453 to
5bd1822
Compare
|
Hi @xuewenjie123 thanks for testing, let's get this issue resolved! I have improved the PR by making the code also accept the git calls like "git commit -am", but from your screenshot I see that this is not what you are using while testing, so this will not help here. The new feature works for me on Ubuntu Linux and macOS Tahoe, but you are using Windows. I have temporarily added more logs and you will be able to see them by pressing Ctrl+O in Qwen. So please re-test by doing the following:
mkdir -p /tmp/test-coauthor && cd /tmp/test-coauthor
git init && git config user.email "test@test.com" && git config user.name "Test"
echo "test" > test.txt && git add .
Below is the screenshot of my successful testing with macOS:
/tmp/test-coauthor (main) % git log -1 --format=%B
Add test.txt file
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
/tmp/test-coauthor (main) % cat ~/.qwen/settings.json
{
"security": {
"auth": {
"selectedType": "qwen-oauth"
}
},
"$version": 2,
"ui": {
"theme": "GitHub Light"
},
"general": {
"terminalBell": true
}
} |
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
why is this default on? please default it off. |






TLDR
Exposes the existing
gitCoAuthorsetting insettings.jsonso users can disable or customize the automaticCo-authored-by:trailer added to git commits.Also fixes a bug, where the trailer was not being added when commands were prefixed with
cd /path &&.Dive Deeper
The
gitCoAuthorfeature automatically adds aCo-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>trailer to git commit messages made through Qwen Code. While the implementation existed in core (packages/core/src/tools/shell.ts), it was not exposed in the settings schema, meaning users had no way to disable or customize it.This PR:
git.gitCoAuthorto the settings schema withenabled,name, andemailpropertiesdocs/cli/configuration.mdgit commitanywhere in command (not just at start)Bug Fix: The original regex
/^git\s+commit/required commands to START with "git commit", but Qwen often generatescd /path && git commit -m "...". Changed to/\bgit\s+commit\b/to match anywhere.Users can now disable it by adding to their
~/.qwen/settings.json:{ "git": { "gitCoAuthor": { "enabled": false } } }Reviewer Test Plan
git log -1 --format=%B | grep "Co-authored-by"Testing Matrix
Linked issues / bugs
None - this is a feature enhancement to expose existing functionality.