GNU bug report logs - #50363
[PATCH] Improve default diff hunk header detection.

Previous Next

Package: guix-patches;

Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>

Date: Fri, 3 Sep 2021 22:40:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kyle Meyer <kyle <at> kyleam.com>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 50363 <at> debbugs.gnu.org, ludo <at> gnu.org, maximedevos <at> telenet.be
Subject: [bug#50363] [PATCH v3] Improve default diff hunk header detection.
Date: Sun, 19 Sep 2021 18:09:47 -0400
Sarah Morgensen writes:

> diff --git a/.gitattributes b/.gitattributes
> new file mode 100644
> index 0000000000..51f29b8a48
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,3 @@
> +*.scm       diff=scheme
> +*.scm.in    diff=scheme
> +*.texi      diff=tex

"tex" is a built-in pattern for LaTeX.  To avoid confusion, I suggest
"texinfo", which is what the Emacs repo uses.

> diff --git a/doc/contributing.texi b/doc/contributing.texi
[...]
> +@example
> +git config --local include.path=../etc/git/gitconfig
> +@end example

The '=' above should be a space:

  $ git config --local include.path=../etc/git/gitconfig
  error: invalid key: include.path=../etc/git/gitconfig

(This is true in the other examples as well.)

Just thinking aloud: the include.path approach above assumes a clone
with the standard $GIT_DIR and working tree layout, but that seems fine
because users with more unusual setups would know how to adjust it for
their case.  Also, for git-worktree users, the etc/git/gitconfig file in
the main worktree would be used within other worktrees, but for this use
case I doubt that will cause confusion.

>  @unnumberedsubsec Sending a Patch Series
>  @anchor{Sending a Patch Series}
>  @cindex patch series
>  @cindex @code{git send-email}
> -@cindex @code{git-send-email}

I suspect the second variant was included to help those that are using
the git- variant to search (perhaps because that's how they'd refer to
the manpage or because they know about Git's exec path).  Not a big deal
either way, but keeping it around seems okay to me.

> diff --git a/etc/git/gitconfig b/etc/git/gitconfig
> new file mode 100644
> index 0000000000..290006816f
> --- /dev/null
> +++ b/etc/git/gitconfig
> @@ -0,0 +1,5 @@
> +[diff "scheme"]
> +	xfuncname = "^(\\(define.*)$"
> +
> +[diff "tex"]
> +	xfuncname = "^(@((|sub|subsub)section|(unnumbered|appendix)((|sub|subsub)sec)|(|major|chap|sub|subsub)heading|chapter|part|titlepage|top)[ \t]+.*)$"

Fwiw the Emacs repo sets a simpler value (via autogen.sh):

  ^@node[[:space:]]+([^,[:space:]][^,]+)




This bug report was last modified 3 years and 219 days ago.

Previous Next


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