zed
zed copied to clipboard
Inconsistent Commit Message Retention: .git/COMMIT_EDITMSG Stuck After Multiple Commits
Summary
When Zed is used as the default git editor, it sometimes fails to load the current .git/COMMIT_EDITMSG and loads its outdated contents.
Previous issue https://github.com/zed-industries/zed/issues/18701 is still present in Zed 0.183.12
Steps to Reproduce (copied from the linked issue):
- Install Zed CLI.
- Set
zed --waitas the Git editor:git config --global core.editor "zed --wait" - Open a terminal inside Zed.
- Run a Git commit operation with changes staged:
git commit - Use Zed’s inline assistant to generate a commit message based on the diff.
- Use
:xto save and close the buffer. - Make another change to the codebase.
- Attempt to commit the new change with:
git commit - When Zed opens the Git editor, you will notice that it still contains the previous commit message and diff instead of the current one.
Observed Behavior:
- Zed sometimes retains the old commit message and diff in .git/COMMIT_EDITMSG.
- Removing
.git/COMMIT_EDITMSGviarm .git/COMMIT_EDITMSGdoes not resolve the issue, and the problem persists. - The issue is not consistent but occurs sporadically, especially when the inline assistant is used for writing commit messages.
Expected Behavior:
When performing a Git commit, Zed should open the fresh commit message and diff in .git/COMMIT_EDITMSG relevant to the latest changes.
Impact:
This issue creates confusion and hinders smooth Git commit workflows when using Zed, especially when dealing with successive commits in quick succession.
Zed Version and System Specs
Zed: v0.183.12 (Zed) OS: macOS 14.7.0 Memory: 36 GiB Architecture: aarch64