1.3 KiB
1.3 KiB
Commit
Overview
Commit changes with a two-tier strategy: prioritize changes from this chat, then fall back to any other uncommitted changes.
Steps
-
Identify changes from this chat
- From the current conversation context, determine which files you (the agent) have created, modified, or deleted in this chat.
- List these "chat-touched" file paths.
-
Check git status
- Run
git status --shortin each workspace root to see uncommitted changes.
- Run
-
Choose what to commit
- If any uncommitted changes exist in chat-touched files: stage and commit only those chat-touched files. Use a commit message that summarizes the work done in this chat.
- Else (all chat-touched changes are already committed): stage and commit any other uncommitted changes. Use a commit message that summarizes those remaining changes.
-
Perform the commit
- Stage the chosen files with
git add(exclude.idea/and other IDE/config files unless they are part of the intended changes). - Run
git commitwith a clear, conventional commit-style message. - Use PowerShell-safe syntax (e.g.
;instead of&&, avoid bash heredoc).
- Stage the chosen files with
Notes
- If there are no uncommitted changes at all, report that and do nothing.
- When multiple workspace roots exist, apply this logic per repo (check status in each root and commit accordingly).