GNU bug report logs - #18110
24.4.50; [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace from git logs

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Fri, 25 Jul 2014 21:36:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.4.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18110 in the body.
You can then email your comments to 18110 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Fri, 25 Jul 2014 21:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dima <at> secretsauce.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 25 Jul 2014 21:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50;
 [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace
 from git logs
Date: Fri, 25 Jul 2014 14:34:28 -0700
[Message part 1 (text/plain, inline)]
When looking at expanded git logs with vc-print-root-log (C-x v L, then <enter>
by default), emacs was stripping out all leading whitespace from git logs. This
was done by an (indent-region) call. This patch fixes this issue by removing
this call. It might be good to remove a constant amount of whitespace from the
beginning of each log line, but it's not obvious that matters, and it seems more
trouble than it's worth.

[0001-vc-git-expanded-log-entry-no-longer-strips-leading-w.patch (text/x-diff, inline)]
From 0b5ac295402eb99034602df352533f3b1d21fe24 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima <at> secretsauce.net>
Date: Fri, 25 Jul 2014 14:33:10 -0700
Subject: [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace
 from git logs

When looking at expanded git logs with vc-print-root-log (C-x v L, then <enter>
by default), emacs was stripping out all leading whitespace from git logs. This
was done by an (indent-region) call. This patch fixes this issue by removing
this call. It might be good to remove a constant amount of whitespace from the
beginning of each log line, but it's not obvious that matters, and it seems more
trouble than it's worth.
---
 lisp/vc/vc-git.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 9c8ab3b..a03ef0c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -894,10 +894,7 @@ or BRANCH^ (where \"^\" can be repeated)."
   (with-temp-buffer
     (apply 'vc-git-command t nil nil (list "log" revision "-1"))
     (goto-char (point-min))
-    (unless (eobp)
-      ;; Indent the expanded log entry.
-      (indent-region (point-min) (point-max) 2)
-      (buffer-string))))
+    (unless (eobp) (buffer-string))))
 
 (autoload 'vc-switches "vc")
 
-- 
2.0.0


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Sat, 26 Jul 2014 03:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 18110 <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: 18110 <at> debbugs.gnu.org
Subject: clarification
Date: Fri, 25 Jul 2014 20:12:56 -0700
To clarify, the issue being fixed is not that some leading whitespace is
removed, but rather that a different amount of whitespace can be removed
from each line, and this destroys any alignment that may have been
present in the log message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Tue, 23 Feb 2016 12:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 18110 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 18110 <at> debbugs.gnu.org
Subject: Re: bug#18110: 24.4.50;
 [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace
 from git logs
Date: Tue, 23 Feb 2016 23:30:02 +1100
Dima Kogan <dima <at> secretsauce.net> writes:

> When looking at expanded git logs with vc-print-root-log (C-x v L,
> then <enter> by default), emacs was stripping out all leading
> whitespace from git logs. This was done by an (indent-region)
> call. This patch fixes this issue by removing this call. It might be
> good to remove a constant amount of whitespace from the beginning of
> each log line, but it's not obvious that matters, and it seems more
> trouble than it's worth.

[...]

> -    (unless (eobp)
> -      ;; Indent the expanded log entry.
> -      (indent-region (point-min) (point-max) 2)
> -      (buffer-string))))
> +    (unless (eobp) (buffer-string))))

It seems like a deliberate design choice...  I have no idea whether it's
a good one, though.  Anybody?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Wed, 24 Feb 2016 00:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 18110 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Dima Kogan <dima <at> secretsauce.net>
Cc: 18110 <at> debbugs.gnu.org
Subject: Re: bug#18110: 24.4.50; [PATCH] vc-git-expanded-log-entry no longer
 strips leading whitespace from git logs
Date: Wed, 24 Feb 2016 02:25:43 +0200
On 02/23/2016 02:30 PM, Lars Ingebrigtsen wrote:

>> -    (unless (eobp)
>> -      ;; Indent the expanded log entry.
>> -      (indent-region (point-min) (point-max) 2)
>> -      (buffer-string))))
>> +    (unless (eobp) (buffer-string))))
>
> It seems like a deliberate design choice...  I have no idea whether it's
> a good one, though.  Anybody?

Not wasting extra horizontal space seems like a good choice. It might be 
implemented in a smarter way, though, like chopping off first two 
characters from each non-empty line, instead of reindenting them all.

I'd be happy to see a patch along these lines.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Sun, 28 Feb 2016 03:14:01 GMT) Full text and rfc822 format available.

Message #17 received at 18110 <at> debbugs.gnu.org (full text, mbox):

From: Dima Kogan <dima <at> secretsauce.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 18110 <at> debbugs.gnu.org
Subject: Re: bug#18110: 24.4.50;
 [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace
 from git logs
Date: Sat, 27 Feb 2016 19:13:46 -0800
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 02/23/2016 02:30 PM, Lars Ingebrigtsen wrote:
>
>>> -    (unless (eobp)
>>> -      ;; Indent the expanded log entry.
>>> -      (indent-region (point-min) (point-max) 2)
>>> -      (buffer-string))))
>>> +    (unless (eobp) (buffer-string))))
>>
>> It seems like a deliberate design choice...  I have no idea whether it's
>> a good one, though.  Anybody?
>
> Not wasting extra horizontal space seems like a good choice. It might be 
> implemented in a smarter way, though, like chopping off first two 
> characters from each non-empty line, instead of reindenting them all.
>
> I'd be happy to see a patch along these lines.

Here's a patch that does this

[0001-vc-git-expanded-log-entry-strips-constant-leading-wh.patch (text/x-diff, inline)]
From c206f68987cdb639b4311ce62e4b17c994aa6502 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima <at> secretsauce.net>
Date: Sat, 27 Feb 2016 19:12:56 -0800
Subject: [PATCH] `vc-git-expanded-log-entry' strips constant leading
 whitespace from git logs

lisp/vc/vc-git.el (vc-git-expanded-log-entry): When looking at expanded git
logs with `vc-print-root-log' (C-x v L, then <enter> by default), emacs was
stripping out all leading whitespace from git logs.  I now strip exactly 2
leading spaces, which retains the indentation in the logs. (bug#18110)
---
 lisp/vc/vc-git.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 1c43e3e..8498cc8 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -970,7 +970,9 @@ vc-git-expanded-log-entry
     (goto-char (point-min))
     (unless (eobp)
       ;; Indent the expanded log entry.
-      (indent-region (point-min) (point-max) 2)
+      (while (re-search-forward "^  " nil t)
+        (replace-match "")
+        (forward-line))
       (buffer-string))))
 
 (defun vc-git-region-history (file buffer lfrom lto)
-- 
2.1.4


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18110; Package emacs. (Sun, 28 Feb 2016 04:50:01 GMT) Full text and rfc822 format available.

Message #20 received at 18110 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 18110 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#18110: 24.4.50;
 [PATCH] vc-git-expanded-log-entry no longer strips leading whitespace
 from git logs
Date: Sun, 28 Feb 2016 15:18:59 +1030
Dima Kogan <dima <at> secretsauce.net> writes:

> lisp/vc/vc-git.el (vc-git-expanded-log-entry): When looking at expanded git
> logs with `vc-print-root-log' (C-x v L, then <enter> by default), emacs was
> stripping out all leading whitespace from git logs.  I now strip exactly 2
> leading spaces, which retains the indentation in the logs. (bug#18110)

Thanks; applied.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 28 Feb 2016 04:50:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 18110 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 28 Feb 2016 04:50:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Mar 2016 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:05 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 26.1. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:05 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 25.2. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Jan 2017 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 249 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.