3 ms·
There's no need to apologize! It's just two different possibilities for the design of Magit. I already wrote the code this morning to do this as a quick hack. I
by Myrmornis 7y ago
There's no need to apologize! It's just two different possibilities for the design of Magit. I already wrote the code this morning to do this as a quick hack. It's just a few lines and I've been writing lots of emacs lisp recently, so it didn't cost me much time. The question is whether it would be useful as a setting for other magit users. Like I say, I can see arguments for this (being able to update you commit in conjunction with working on the commit message) but neither of us have suggested an advantage of the other model yet.
(defun myrmornis--magit-commit-staged ()
(interactive)
(let ((commit-message (buffer-string)))
(let ((with-editor-cancel-message ""))
(with-editor-cancel nil))
(with-temp-buffer
(insert commit-message)
(goto-char (point-min))
(delete-matching-lines "^[ \t]*#") ;; hack
(magit-run-git-with-input "commit" "-F" "-")))
(magit-refresh-all))
(use-package magit
:bind (:map with-editor-mode-map
("C-c C-c" . myrmornis--magit-commit-staged))
- iLemming 7y agoI apologized so it is clear that I'm not rejecting your idea due to my shallow thinking. Maybe you are trying to convey a story that potentially opens wide-range of possibilities and I just don't see it. As I said, maybe there are people who'd find it extremely useful. Would you mind sharing your "hack" in https://github.com/magit/magit https://github.com/magit/magit or https://gitter.im/magit/magit https://gitter.im/magit/magit ?
- deleted 7y ago[deleted]