From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: 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-ID: <87twktil1x.fsf@secretsauce.net> References: <87ppgtt95n.fsf@secretsauce.net> <8760xfobhx.fsf@gnus.org> <23ac5130-b782-a055-3e38-a14810a9e007@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1456629263 29202 80.91.229.3 (28 Feb 2016 03:14:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2016 03:14:23 +0000 (UTC) Cc: Lars Ingebrigtsen , 18110@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 28 04:14:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZro9-0007E4-RG for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Feb 2016 04:14:10 +0100 Original-Received: from localhost ([::1]:57224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZro8-00071D-Od for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Feb 2016 22:14:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZro5-000712-Ll for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:14:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZro2-0002Mj-Al for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:14:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZro2-0002Md-7K for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZro1-0000X1-Sf for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Feb 2016 03:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18110 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18110-submit@debbugs.gnu.org id=B18110.14566292322020 (code B ref 18110); Sun, 28 Feb 2016 03:14:01 +0000 Original-Received: (at 18110) by debbugs.gnu.org; 28 Feb 2016 03:13:52 +0000 Original-Received: from localhost ([127.0.0.1]:49243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZrnr-0000WU-SS for submit@debbugs.gnu.org; Sat, 27 Feb 2016 22:13:52 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:60478) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZrnq-0000WI-Kp for 18110@debbugs.gnu.org; Sat, 27 Feb 2016 22:13:51 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DB0CF204C9 for <18110@debbugs.gnu.org>; Sat, 27 Feb 2016 22:13:48 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sat, 27 Feb 2016 22:13:48 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=gaMTE 2zI83hFjskBD3K6A67rdw4=; b=fS+uCmmcQNG95ZouE/JRZ99xj24O5ldH/jL/y tGqbIeiZ5u7vsgazwxXZdLVvK0uOoqEX9XLUA58BwoWKhBBV7yvCzEy3qiftQcgx 9ih6rAfCaLxEdcZSEBrdOiPrvErq+3Bmf4IJxlV8Sh8bzvokce7zvHpRGLGWKBE2 P27Dsg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=gaMTE2zI83hFjskBD3K6A67rdw4=; b=MIvsp WtpUA5bawVVW8G9E8NE14cHqIfVE74C8MbT3KFzboXrY3aDzIqpsKU7/XYaPocWj TWy7Im1rrWDDvLD/+e+2r2MsmX1Ia/8O/FBis56qLx8/ZGYzZXOy6VADh2zD59yr iqfqL7NrS9rDJMVCEHwSYOL+nb+EpNVB24c27I= X-Sasl-enc: ShAWuK77MxE2KagSXw9sYcV4DGsauk4DrV3YRb/UqtoJ 1456629228 Original-Received: from shorty.local (174-28-73-53.albq.qwest.net [174.28.73.53]) by mail.messagingengine.com (Postfix) with ESMTPA id 5297C68009A; Sat, 27 Feb 2016 22:13:48 -0500 (EST) Original-Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1aZrnm-0005m3-MT; Sat, 27 Feb 2016 19:13:46 -0800 User-agent: mu4e 0.9.11; emacs 25.0.90.1 In-reply-to: <23ac5130-b782-a055-3e38-a14810a9e007@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113994 Archived-At: --=-=-= Content-Type: text/plain Dmitry Gutov 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-vc-git-expanded-log-entry-strips-constant-leading-wh.patch >From c206f68987cdb639b4311ce62e4b17c994aa6502 Mon Sep 17 00:00:00 2001 From: Dima Kogan 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 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 --=-=-=--