1
2
Fork
You've already forked userscripts
1

Commits check for co-authors only checks first co-author, not all #17

Closed
opened 2026年03月31日 22:01:47 +02:00 by jacksonchen666 · 3 comments

(Original title, for context: Userscript is suspiciously silent about a commit that should match and alert)

github.com/element-hq/synapse@f545aa4f33

Preserved in https://github.com/JacksonChen666/synapse_2026年03月31日

My logs:

21:52:51.288 looking at commit SHA f545aa4f33377f2c68aad7032afbe5a395c35cbc position 17 Detect AI instruction files in GitHub repos.user.js:1182:21
21:52:51.288 check_user user: erikjohnston (type User) Detect AI instruction files in GitHub repos.user.js:1094:13
21:52:51.288 commit co-author parts 
Array(3) [ "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n", "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n", "Copilot <175728472+Copilot@users.noreply.github.com>" ]
​
0: "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n"
​
1: "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n"
​
2: "Copilot <175728472+Copilot@users.noreply.github.com>"
​
length: 3
​
<prototype>: Array []
Detect AI instruction files in GitHub repos.user.js:1219:25

This is only 17 commits from the develop branch, and seems to have copilot as the co-author.

Thanks for @olivia-l for noticing!

(Original title, for context: Userscript is suspiciously silent about a commit that should match and alert) https://github.com/element-hq/synapse/commit/f545aa4f33377f2c68aad7032afbe5a395c35cbc Preserved in https://github.com/JacksonChen666/synapse_2026年03月31日 My logs: ``` 21:52:51.288 looking at commit SHA f545aa4f33377f2c68aad7032afbe5a395c35cbc position 17 Detect AI instruction files in GitHub repos.user.js:1182:21 21:52:51.288 check_user user: erikjohnston (type User) Detect AI instruction files in GitHub repos.user.js:1094:13 21:52:51.288 commit co-author parts Array(3) [ "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n", "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n", "Copilot <175728472+Copilot@users.noreply.github.com>" ] ​ 0: "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n" ​ 1: "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n" ​ 2: "Copilot <175728472+Copilot@users.noreply.github.com>" ​ length: 3 ​ <prototype>: Array [] Detect AI instruction files in GitHub repos.user.js:1219:25 ``` This is only 17 commits from the `develop` branch, and seems to have copilot as the co-author. Thanks for @olivia-l for noticing!
Author
Owner
Copy link

Found the bug.

const message_co_author_parts = commit_info.commit.message.split(/Co-authored-by: /i);
if (message_co_author_parts.length > 1) {
console.debug("commit co-author parts", message_co_author_parts);
// XXX: don't use only the first word of a name, maybe do the
// whole name and email (risk of claude opus 4.5 updating to a
// different version, regex?)
const name = message_co_author_parts[1].split(" ")[0];

It is only checking the first co-author. There can be multiple co-authors.

Critical, because IIRC "AI" is generally the last co-author, I think. I'm not sure, but this behavior is not correct anyways, since there can be multiple co-authors.


Logs with added debug statement:

01:01:40.330 looking at commit SHA f545aa4f33377f2c68aad7032afbe5a395c35cbc position 17 Detect AI instruction files in GitHub repos.user.js:256:21
01:01:40.330 check_user user: erikjohnston (type User) Detect AI instruction files in GitHub repos.user.js:164:13
01:01:40.330 commit co-author parts 
Array(3) [ "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n", "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n", "Copilot <175728472+Copilot@users.noreply.github.com>" ]
0: "[...]"
1: "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n"
2: "Copilot <175728472+Copilot@users.noreply.github.com>"
length: 3
<prototype>: Array []
Detect AI instruction files in GitHub repos.user.js:293:25
01:01:40.330 co-author name part: Andrew Detect AI instruction files in GitHub repos.user.js:298:25
Found the bug. https://codeberg.org/jacksonchen666/userscripts/src/commit/274cfa2de27745d9bfcda209436a89ee646910e6/github.com-notify-on-ai-files.user.js#L287-L293 It is only checking the *first* co-author. There can be multiple co-authors. Critical, because IIRC "AI" is generally the last co-author, *I think*. I'm not sure, but this behavior is not correct anyways, since there can be multiple co-authors. --- Logs with added debug statement: ``` 01:01:40.330 looking at commit SHA f545aa4f33377f2c68aad7032afbe5a395c35cbc position 17 Detect AI instruction files in GitHub repos.user.js:256:21 01:01:40.330 check_user user: erikjohnston (type User) Detect AI instruction files in GitHub repos.user.js:164:13 01:01:40.330 commit co-author parts Array(3) [ "Port `RoomVersion` to Rust (#19589)\n\nPrincipally so that we can share the same room version configuration\nbetween Python and Rust.\n\nFor the most part, this is a direct port. Some special handling has had\nto go into `KNOWN_ROOM_VERSIONS` so that it can be sensibly shared\nbetween Python and Rust, since we do update it during config parsing.\n\n---------\n\n", "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n", "Copilot <175728472+Copilot@users.noreply.github.com>" ] 0: "[...]" 1: "Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>\n" 2: "Copilot <175728472+Copilot@users.noreply.github.com>" length: 3 <prototype>: Array [] Detect AI instruction files in GitHub repos.user.js:293:25 01:01:40.330 co-author name part: Andrew Detect AI instruction files in GitHub repos.user.js:298:25 ```
jacksonchen666 changed title from (削除) Userscript is suspiciously silent about a commit that should match and alert (削除ここまで) to Commits check for co-authors only checks first co-author, not all 2026年04月25日 01:06:48 +02:00
Author
Owner
Copy link

git blame traces it back to #2. I guess I didn't review the code that well. (Or honestly at all)

git blame traces it back to #2. I guess I didn't review the code that well. (Or honestly at all)
Author
Owner
Copy link

Released in userscript version 0.4.0!

Released in userscript version 0.4.0!
jacksonchen666 added reference refs/tags/github-ai-use-0.4.0 2026年06月29日 01:47:40 +02:00
Sign in to join this conversation.
github-ai-use-0.4.0
main
navigation-api
dialog-box
dev
ai-files-gitignore-check
github-ai-use-0.4.0
github-ai-use-0.1
github-ai-use-0.1.1
github-ai-use-0.1.2
github-ai-use-0.1.3
github-ai-use-0.1.4
github-ai-use-0.1.5
github-ai-use-0.1.6
github-ai-use-0.1.7
github-ai-use-0.1.8
github-ai-use-0.1.9
github-ai-use-0.1.10
github-ai-use-0.2.0
github-ai-use-0.3.0
github-ai-use-0.3.1
github-ai-use-0.3.2
github-ai-use-0.3.3
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jacksonchen666/userscripts#17
Reference in a new issue
jacksonchen666/userscripts
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?