Emacs Asked by Tom Dalziel on December 12, 2020
I often add a new file to a repo, make some other changes, then stage all, and commit all, forgetting that the new file is not yet tracked, so is not included in the stage all step. At least one editor (IntelliJ) has an option to auto-stage new files, which would be very helpful to me in Emacs. I guess this would be particularly helpful if it invoked –intent-to-add.
Is this feature present in magit or built-in in Emacs?
If not, I’d be interested in writing some elisp. Is there a hook run when magit sees a new untracked file, or would I have to add to the after-save-hook and query the git status?
Magit does not implement this and as far as I know VC/Emacs does not do so either.
Magit also does not provide a hook that is run "when it sees a new untracked" file but you could use find-file-hook
, which is run when you see a untracked file. ;D
You probably want to use magit-file-tracked-p
in your hook function.
Correct answer by tarsius on December 12, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP