Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .fork/custom-commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"version" : 2
},
{
"action" : {
"script" : "git push gitcode.com --delete refs/heads/${ref}\ngit push gitee.com --delete refs/heads/${ref}\ngit checkout main\ngit branch --delete --force ${ref}",
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The "Delete All" command chains multiple destructive git operations without error handling. If any of the remote delete operations fail (e.g., remote doesn't exist or branch not found), the subsequent commands will still execute, potentially leading to unexpected behavior. Consider adding error handling or splitting this into separate commands for better control and feedback.

Suggested change
"script" : "git push gitcode.com --delete refs/heads/${ref}\ngit push gitee.com --delete refs/heads/${ref}\ngit checkout main\ngit branch --delete --force ${ref}",
"script" : "git push gitcode.com --delete refs/heads/${ref} || { echo 'Failed to delete branch ${ref} from gitcode.com'; exit 1; }\ngit push gitee.com --delete refs/heads/${ref} || { echo 'Failed to delete branch ${ref} from gitee.com'; exit 1; }\ngit checkout main || { echo 'Failed to checkout main'; exit 1; }\ngit branch --delete --force ${ref} || { echo 'Failed to delete local branch ${ref}'; exit 1; }",

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

Using git branch --delete --force is potentially dangerous as it will delete the local branch even if it contains unmerged changes. Consider using --delete without --force to prevent accidental loss of work, or add a confirmation prompt before executing this destructive operation.

Suggested change
"script" : "git push gitcode.com --delete refs/heads/${ref}\ngit push gitee.com --delete refs/heads/${ref}\ngit checkout main\ngit branch --delete --force ${ref}",
"script" : "git push gitcode.com --delete refs/heads/${ref}\ngit push gitee.com --delete refs/heads/${ref}\ngit checkout main\ngit branch --delete ${ref}",

Copilot uses AI. Check for mistakes.
"showOutput" : false,
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

With showOutput set to false, users won't see error messages if any of the destructive delete operations fail. This can lead to confusion about whether the operations succeeded or failed. Consider setting this to true for better user feedback, especially for destructive operations.

Suggested change
"showOutput" : false,
"showOutput" : true,

Copilot uses AI. Check for mistakes.
"type" : "sh",
"waitForExit" : true
},
"name" : "Delete All",
"refTargets" : [
"localbranch",
"remotebranch"
],
"target" : "ref"
},
{
"action" : {
"script" : "git fetch --all --prune",
"showOutput" : false,
"type" : "sh",
"waitForExit" : true
},
"name" : "Fetch All",
"refTargets" : [
"localbranch",
"remotebranch"
],
"target" : "ref"
},
{
"action" : {
"script" : "git push origin refs/heads/${ref} --verbose\ngit push gitcode.com refs/heads/${ref} --verbose\ngit push gitee.com refs/heads/${ref} --verbose",
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

With showOutput set to false and --verbose flags in the git commands, the verbose output won't be visible to users. Either remove the --verbose flags since the output is hidden, or set showOutput to true to make the verbose output useful.

Suggested change
"script" : "git push origin refs/heads/${ref} --verbose\ngit push gitcode.com refs/heads/${ref} --verbose\ngit push gitee.com refs/heads/${ref} --verbose",
"script" : "git push origin refs/heads/${ref}\ngit push gitcode.com refs/heads/${ref}\ngit push gitee.com refs/heads/${ref}",

Copilot uses AI. Check for mistakes.
"showOutput" : false,
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The "Push All" command chains multiple push operations without error handling. If one push fails (e.g., network issues, authentication problems), subsequent pushes will still be attempted but the user may not be aware of the failure since showOutput is false. Consider enabling output visibility or adding error handling between commands.

Suggested change
"showOutput" : false,
"showOutput" : true,

Copilot uses AI. Check for mistakes.
"type" : "sh",
"waitForExit" : true
},
"name" : "Push All",
"refTargets" : [
"localbranch",
"remotebranch"
],
"target" : "ref"
}
]