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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Subject: bug#50363: closed (Re: bug#50363: [PATCH] Improve default diff
 hunk header detection.)
Date: Mon, 04 Oct 2021 12:27:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#50363: [PATCH] Improve default diff hunk header detection.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 50363 <at> debbugs.gnu.org.

-- 
50363: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50363
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 50363-done <at> debbugs.gnu.org, kyle <at> kyleam.com, maximedevos <at> telenet.be
Subject: Re: bug#50363: [PATCH] Improve default diff hunk header detection.
Date: Mon, 04 Oct 2021 14:26:13 +0200
Hi Sarah,

Sarah Morgensen <iskarian <at> mgsn.dev> skribis:

>> I have one last question:
>>
>>> +format-patch} sent to the @email{guix-patches@@gnu.org} mailing list
>>> +(@pxref{submitting patches,, Submitting patches to a project, git, Git
>>> +User Manual}).  Contributors are encouraged to take a moment to set some
>>
>> AFAICS, there’s no Info-format Git manual, is there?  In that case, the
>> pxref above is incorrect, but we can use @uref instead and/or suggest
>> ‘man git’ or similar.
>
> We don't currently build it, but there is.  In the git repo, in
> Documentation/Makefile:
>
> info: git.info gitman.info
> [...]
> git.info: user-manual.texi
> 	$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
>
> It's available online at
>
>   https://git-scm.com/docs/user-manual
>
> and
>
>   https://mirrors.edge.kernel.org/pub/software/scm/git/docs/user-manual.html
>
> My other patch, #50683, adds this reference to htmlxref.cnf.

Oh, nice; thanks for explaining.

Finally applied!

Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: guix-patches <at> gnu.org
Subject: [PATCH v2] Improve default diff hunk header detection.
Date: Fri,  3 Sep 2021 15:39:05 -0700
Tell git to look for top-level definitions for diff hunk headers in
Scheme files.

.gitattributes: New file.
.gitconfig: New file.
---
Hello Guix,

This patch improves the diff hunk headers for diffs on scheme files in this
repository.  These settings are always settable (and overridable) on a
per-user basis, but I think having them as defaults is nice.

This may help with patches applying in general, but the main goal is to make
etc/committer.scm a little less brittle.

The default "scheme" function regex (enabled with .gitattributes) recognizes
both toplevel and non-toplevel defines.  I've modified the regex in .gitconfig
to only recognize the toplevel defines.  I think this makes more sense for our
purposes.

Unfortunately, checked-in git config settings cannot be automatically used
(for security reasons), and must be enabled with a once-per-clone

  git config --local include.path ../.gitconfig

which isn't ideal.  I suppose we could make a 'make' target for setup like
this if we wanted to make it easy.

WDYT?

--
Sarah

 .gitattributes | 2 ++
 .gitconfig     | 2 ++
 2 files changed, 4 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 .gitconfig

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..5c1b15e9e0
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.scm       diff=scheme
+*.scm.in    diff=scheme
diff --git a/.gitconfig b/.gitconfig
new file mode 100644
index 0000000000..344d829824
--- /dev/null
+++ b/.gitconfig
@@ -0,0 +1,2 @@
+[diff "scheme"]
+	xfuncname = "^(\\(define.*)$"

base-commit: 522a3bf99cbc21a9093f63280b9508cd69b94ff0
-- 
2.31.1




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.