[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 150eed71b9 3/4: git-commit-setup: Remove a mild
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 150eed71b9 3/4: git-commit-setup: Remove a mildly questionable tweak |
Date: |
Mon, 29 Apr 2024 10:00:40 -0400 (EDT) |
branch: elpa/git-commit
commit 150eed71b98597018cc4a47d1c50c3f56b747eef
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
git-commit-setup: Remove a mildly questionable tweak
The removed code was added in [1: fb66888fcd]. If the buffer is
completely empty, this changes it to instead contain a single empty
line. This does not seem desirable, without further justification.
Unfortunately that was not provided in the commit and the mentioned
issue is from the old "git-commit-mode" repository, which does not
exist anymore.
I assume that this was either done because some user enabled
`indicate-buffer-boundaries' and then didn't like how that looks for
empty buffers, or because this once was necessary for our font-lock to
work properly. If it was the latter, that is not the case anymore.
This does not affect the outcome of Git porcelain commands. (And if
it did there would be nothing to prevent the user from removing the
trailing newline again.) It is Github, which produces corrupted commit
messages that lack the trailing newline by default, not Git.
I am removing this because it makes an already long function even longer
and it is yet another thing one has to consider when reasoning about
this function. If someone really wants this for some reason, then a
hook function can be used. If it turns out there is some real benefit
to this, then we can revert the removal.
1: 2013-09-14 fb66888fcdeb334f183e67d26b58a98c6ad2124c
`git-commit-mode': insert a newline after commit summary line
---
lisp/git-commit.el | 4 ----
1 file changed, 4 deletions(-)
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 8bc902d906..8a7cad954d 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -652,10 +652,6 @@ Used as the local value of `header-line-format', in buffer
using
(git-commit-prepare-message-ring)
(when (boundp 'save-place)
(setq save-place nil))
- (save-excursion
- (goto-char (point-min))
- (when (looking-at "\\`\\(\\'\\|\n[^\n]\\)")
- (open-line 1)))
(let ((git-commit-mode-hook nil))
(git-commit-mode 1))
(with-demoted-errors "Error running git-commit-setup-hook: %S"