GNU bug report logs -
#37395
Diff-mode doesn't take into account patch-separators as produced by git-format-patch
Previous Next
Reported by: Konstantin Kharlamov <hi-angel <at> yandex.ru>
Date: Thu, 12 Sep 2019 21:34:02 UTC
Severity: normal
Tags: fixed
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 37395 <at> debbugs.gnu.org (full text, mbox):
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Fri, 13 Sep 2019 00:34:45 +0300
>
> * lisp/vc/diff-mode.el (diff-goto-line-before-patch-separator): an
> inline function to check if prev. line was git-format-patch separator,
> in which case go there.
> (diff-end-of-hunk): make use of (diff-goto-line-before-patch-separator)
The descriptions of changes should start with a capital letter. Also,
your lines in the commit log message are too long, they should not
exceed 61 characters (because in the release tarball we create a
ChangeLog file from them, which prepends a TAB character to each
line).
> +(defsubst diff-goto-line-before-patch-separator ()
> + "Go to prev. line, then if it has patch separator as produced
> +by git-format-patch, stay there. Otherwise go back."
The first line of a doc string should be a complete sentence. I
suggest to rephrase as follows:
Return buffer position before patch separator produced by git-format-patch.
> + (previous-line)
> + (when (not (looking-at "-- "))
> + (next-line))
> + (point))
Btw, Diff mode is more general than just Git-produced diffs. Is there
any possibility that this change will misfire in diffs produced by
other tools? If so, perhaps we should also verify the buffer is under
Git control.
Thanks.
This bug report was last modified 5 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.