Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git files to undohist-ignored-files #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LaurenceWarne
Copy link

Hi, this PR adds a matcher for git files to undohist-ignored-files.

The reason is so that the message "buffer-undo-list is not empty. Do you want to recover now? (y or n)" does not appear when using magit-commit. I don't know if some people would want to save the undo history for files like .git/COMMIT_EDITMSG, but let me know what you think anyway.

To reproduce the message:

  1. M-x magit
  2. Stage some changes then c c
  3. Type something, M-x undo
  4. Exit without committing (C-x k)
  5. Type c c again - the message should come up

Thanks!

@tarsius
Copy link
Member

tarsius commented May 22, 2023

IMO this should be more specific, because one might want to not ignore, e.g., .git/config. Also please don't use rx.

Add git files to undohist-ignored-files so that the message
"buffer-undo-list is not empty. Do you want to recover now? (y or n)"
does not appear when using magit commit.
@LaurenceWarne
Copy link
Author

IMO this should be more specific, because one might want to not ignore, e.g., .git/config

Makes sense, I've updated regex to match only COMMIT_EDITMSG.

@tarsius
Copy link
Member

tarsius commented May 30, 2023

There are more such files, see git-commit-filename-regexp.

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

Successfully merging this pull request may close these issues.

2 participants