Skip to content

Add commit current changes workflow - #490

Open
tninja wants to merge 7 commits into
mainfrom
feature/commit-current-changes
Open

Add commit current changes workflow#490
tninja wants to merge 7 commits into
mainfrom
feature/commit-current-changes

Conversation

@tninja

@tninja tninja commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Add a Commit current changes action under C-c a v.

The workflow:

  • prompts for a commit message
  • stages the current working tree with git add -A
  • when the message is empty, generates one from the exact staged diff and lets the user edit it
  • commits the staged change
  • asks whether to push to the remote
  • uses the existing upstream when available, otherwise sets one with git push -u

The implementation is kept in a small lazy-loaded ai-code-commit.el module so the existing GitHub/PR workflow remains unchanged apart from the new action.

Tests

Added ERT coverage for explicit messages, AI-generated messages, push behavior, and C-c a v dispatch.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9a7b0bcdc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ai-code-commit.el
(unless (fboundp 'ai-code-call-gptel-sync)
(user-error "GPTel commit message generation is not available"))
(let ((message
(ai-code-call-gptel-sync

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid truncating the staged diff before message generation

When the staged diff makes this prompt exceed 1,000 characters, ai-code-call-gptel-sync truncates the entire question according to the default ai-code-gptel-sync-max-length, so the model usually receives only the beginning of a nontrivial diff. This contradicts the workflow's promise to generate from the exact staged diff and can produce a misleading commit message that omits the main changes; this call needs to bypass or explicitly raise that limit for commit generation.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant