unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50363] [PATCH v2] Improve default diff hunk header detection.
@ 2021-09-03 22:39 Sarah Morgensen
  2021-09-10 17:07 ` Maxime Devos
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sarah Morgensen @ 2021-09-03 22:39 UTC (permalink / raw)
  To: 50363

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





^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-13 22:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-03 22:39 [bug#50363] [PATCH v2] Improve default diff hunk header detection Sarah Morgensen
2021-09-10 17:07 ` Maxime Devos
2021-09-13 10:24 ` [bug#50363] [PATCH] " Ludovic Courtès
2021-09-19 18:36 ` [bug#50363] [PATCH v3] " Sarah Morgensen
2021-09-19 22:09   ` Kyle Meyer
2021-09-19 22:56     ` Sarah Morgensen
2021-09-20  0:57       ` Kyle Meyer
2021-09-20 23:37 ` [bug#50363] [PATCH v4] " Sarah Morgensen
2021-09-22 12:55   ` Ludovic Courtès
2021-09-22 16:22     ` Sarah Morgensen
2021-10-04 12:26       ` bug#50363: [PATCH] " Ludovic Courtès
2021-10-13 22:30         ` [bug#50363] " Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).