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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50363 in the body.
You can then email your comments to 50363 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Fri, 03 Sep 2021 22:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 03 Sep 2021 22:40:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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





Changed bug title to '[PATCH] Improve default diff hunk header detection.' from '[PATCH v2] Improve default diff hunk header detection.' Request was from Sarah Morgensen <iskarian <at> mgsn.dev> to control <at> debbugs.gnu.org. (Fri, 03 Sep 2021 22:58:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Fri, 10 Sep 2021 17:08:02 GMT) Full text and rfc822 format available.

Message #10 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Sarah Morgensen <iskarian <at> mgsn.dev>, 50363 <at> debbugs.gnu.org
Subject: Re: [bug#50363] [PATCH v2] Improve default diff hunk header detection.
Date: Fri, 10 Sep 2021 19:07:44 +0200
[Message part 1 (text/plain, inline)]
Sarah Morgensen schreef op vr 03-09-2021 om 15:39 [-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?

This seems nice to me.
 
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Mon, 13 Sep 2021 10:25:02 GMT) Full text and rfc822 format available.

Message #13 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 50363 <at> debbugs.gnu.org
Subject: Re: bug#50363: [PATCH] Improve default diff hunk header detection.
Date: Mon, 13 Sep 2021 12:24:25 +0200
Hi!

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

> 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?

That LGTM too.  Rather than a ‘make’ target, how about a adding a line
or two under “Contributing”?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Sun, 19 Sep 2021 18:37:02 GMT) Full text and rfc822 format available.

Message #16 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50363 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, maximedevos <at> telenet.be
Subject: [PATCH v3] Improve default diff hunk header detection.
Date: Sun, 19 Sep 2021 11:36:43 -0700
Tell git where to look for diff hunk headers: top-level definitions for
Scheme files, and (sub)section headers for texi files.

* .gitattributes, etc/git/gitconfig: New files.
* doc/contributing.texi ("Submitting Patches"): Add subsection
"Configuring Git".  Document etc/git/gitconfig.
---
Changes from previous version:

* Added rule for .texi files

* Documented how to use the advanced settings in the manual (as well as some
  other related information)

Note that I am currently working on a rewrite of "Submitting Patches", so
"Configuring Git" will eventually get its own proper subsection.

--
Sarah
 .gitattributes        |  3 +++
 doc/contributing.texi | 46 +++++++++++++++++++++++++++++++++++++++----
 doc/guix.texi         |  1 +
 etc/git/gitconfig     |  5 +++++
 4 files changed, 51 insertions(+), 4 deletions(-)
 create mode 100644 .gitattributes
 create mode 100644 etc/git/gitconfig

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
diff --git a/doc/contributing.texi b/doc/contributing.texi
index d1b77d7d05..0e8747ab25 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -992,9 +992,12 @@ @section Submitting Patches
 Development is done using the Git distributed version control system.
 Thus, access to the repository is not strictly necessary.  We welcome
 contributions in the form of patches as produced by @code{git
-format-patch} sent to the @email{guix-patches@@gnu.org} mailing list.
-Seasoned Guix developers may also want to look at the section on commit
-access (@pxref{Commit Access}).
+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
+Git repository options (@pxref{Configuring Git}) first, which can
+improve the readability of patches.  Seasoned Guix developers may also
+want to look at the section on commit access (@pxref{Commit Access}).
 
 This mailing list is backed by a Debbugs instance, which allows us to
 keep track of submissions (@pxref{Tracking Bugs and Patches}).  Each
@@ -1205,11 +1208,46 @@ @section Submitting Patches
 When a bug is resolved, please close the thread by sending an email to
 @email{@var{NNN}-done@@debbugs.gnu.org}.
 
+@node Configuring Git
+@subsection Configuring Git
+@cindex git configuration
+@cindex @code{git format-patch}
+@cindex @code{git send-email}
+
+If you have not done so already, you may wish to set a name and email
+that will be associated with your commits (@pxref{telling git your name,
+, Telling Git your name, git, Git User Manual}).  If you wish to use a
+different name or email just for commits in this respository, you can
+use @command{git config --local}, or edit @file{.git/config} in the
+repository instead of @file{~/.gitconfig}.
+
+We provide some default settings in @file{etc/git/gitconfig} which
+modify how patches are generated, making them easier to read and apply.
+These settings can be applied by manually copying them to
+@file{.git/config} in your checkout, or by telling Git to include the
+whole file:
+
+@example
+git config --local include.path=../etc/git/gitconfig
+@end example
+
+From then on, any changes to @file{etc/git/gitconfig} would
+automatically take effect.
+
+Since the first patch in a series must be sent separately
+(@pxref{Sending a Patch Series}), it can also be helpful to tell
+@command{git format-patch} to handle the e-mail threading instead of
+@command{git send-email}:
+
+@example
+git config --local format.thread=shallow
+git config --local sendemail.thread=no
+@end example
+
 @unnumberedsubsec Sending a Patch Series
 @anchor{Sending a Patch Series}
 @cindex patch series
 @cindex @code{git send-email}
-@cindex @code{git-send-email}
 
 When sending a patch series (e.g., using @code{git send-email}), please
 first send one message to @email{guix-patches@@gnu.org}, and then send
diff --git a/doc/guix.texi b/doc/guix.texi
index 6436e83a7c..4dac36310f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -96,6 +96,7 @@
 Copyright @copyright{} 2021 Hui Lu@*
 Copyright @copyright{} 2021 pukkamustard@*
 Copyright @copyright{} 2021 Alice Brenon@*
+Copyright @copyright{} 2021 Sarah Morgensen@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
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]+.*)$"

base-commit: 808f9ffbd3106da4c92d2367b118b98196c9e81e
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Sun, 19 Sep 2021 22:10:01 GMT) Full text and rfc822 format available.

Message #19 received at 50363 <at> debbugs.gnu.org (full text, mbox):

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: Re: [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:]][^,]+)




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Sun, 19 Sep 2021 22:57:01 GMT) Full text and rfc822 format available.

Message #22 received at 50363 <at> debbugs.gnu.org (full text, mbox):

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

Thanks for taking a look and trying this out!

Kyle Meyer <kyle <at> kyleam.com> writes:

> 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.

Good point.  I was trying to use the built-in because it has a
whitespace regex defined in userdiff.c, but I just found that I can set
that with wordRegex, so I'll do that.  I'll take a look at the Emacs
repo as well.

>
>> 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.)

Thanks for catching this.

>
> 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.

I actually wrote about the worktree limitation at first, but I thought
including it would be more confusing to people who don't use them than
it would be helpful to people who do.

>>  @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.

Hmmm.  I originally removed it because it results in two entries in the
index.  Perhaps I can index them as

  @cindex @code{git send-email} (or @code{git-send-email})

or similar.  What do you think?

>> 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:]][^,]+)

I made this choice because we have several unnumbered subsections
without nodes that are fairly long.  Otherwise, nodes make a good
choice.

Also, their xfuncname will only show the node name as the diff hunk
header--not the whole line.  I also considered this (I think it's
cleaner) but I thought it might be confusing.  If others like it, let's
do it.

--
Sarah




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Mon, 20 Sep 2021 00:59:01 GMT) Full text and rfc822 format available.

Message #25 received at 50363 <at> debbugs.gnu.org (full text, mbox):

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: Re: [bug#50363] [PATCH v3] Improve default diff hunk header detection.
Date: Sun, 19 Sep 2021 20:57:53 -0400
Sarah Morgensen writes:

> Kyle Meyer <kyle <at> kyleam.com> writes:
>
>> Sarah Morgensen writes:
[...]
>>>  @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.
>
> Hmmm.  I originally removed it because it results in two entries in the
> index.  Perhaps I can index them as
>
>   @cindex @code{git send-email} (or @code{git-send-email})
>
> or similar.  What do you think?

I don't see having entries in the index for different variants as an
issue (although I can see the point of view that it's just noise in this
case).  As for packing them into one line, dunno, think I'd just leave
it either as it is (separate lines) or how your patch has it.

But, again, I don't think it matters much either way (and perhaps wasn't
worth me commenting on it :]).




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Mon, 20 Sep 2021 23:38:01 GMT) Full text and rfc822 format available.

Message #28 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 50363 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, maximedevos <at> telenet.be, kyle <at> kyleam.com
Subject: [PATCH v4] Improve default diff hunk header detection.
Date: Mon, 20 Sep 2021 16:37:44 -0700
Tell git where to look for diff hunk headers: top-level definitions for
Scheme files, and (sub)section headers for texi files.

* .gitattributes, etc/git/gitconfig: New files.
* doc/contributing.texi ("Submitting Patches"): Add subsection
"Configuring Git".  Document etc/git/gitconfig.
---
Changes since v3 (thanks to Kyle for the suggestions):

* Diff name changed from "tex" to "texinfo"

* "texinfo" diff matches nodes rather than sections (this is what most
texinfo diff drivers seem to do)

* Examples fixed

--
 .gitattributes        |  3 +++
 doc/contributing.texi | 46 +++++++++++++++++++++++++++++++++++++++----
 doc/guix.texi         |  1 +
 etc/git/gitconfig     |  5 +++++
 4 files changed, 51 insertions(+), 4 deletions(-)
 create mode 100644 .gitattributes
 create mode 100644 etc/git/gitconfig

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..b31f7fd74d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+*.scm       diff=scheme
+*.scm.in    diff=scheme
+*.texi      diff=texinfo
diff --git a/doc/contributing.texi b/doc/contributing.texi
index d1b77d7d05..a6bfcb82e0 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -992,9 +992,12 @@ Submitting Patches
 Development is done using the Git distributed version control system.
 Thus, access to the repository is not strictly necessary.  We welcome
 contributions in the form of patches as produced by @code{git
-format-patch} sent to the @email{guix-patches@@gnu.org} mailing list.
-Seasoned Guix developers may also want to look at the section on commit
-access (@pxref{Commit Access}).
+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
+Git repository options (@pxref{Configuring Git}) first, which can
+improve the readability of patches.  Seasoned Guix developers may also
+want to look at the section on commit access (@pxref{Commit Access}).
 
 This mailing list is backed by a Debbugs instance, which allows us to
 keep track of submissions (@pxref{Tracking Bugs and Patches}).  Each
@@ -1205,11 +1208,46 @@ Submitting Patches
 When a bug is resolved, please close the thread by sending an email to
 @email{@var{NNN}-done@@debbugs.gnu.org}.
 
+@node Configuring Git
+@subsection Configuring Git
+@cindex git configuration
+@cindex @code{git format-patch}
+@cindex @code{git send-email}
+
+If you have not done so already, you may wish to set a name and email
+that will be associated with your commits (@pxref{telling git your name,
+, Telling Git your name, git, Git User Manual}).  If you wish to use a
+different name or email just for commits in this respository, you can
+use @command{git config --local}, or edit @file{.git/config} in the
+repository instead of @file{~/.gitconfig}.
+
+We provide some default settings in @file{etc/git/gitconfig} which
+modify how patches are generated, making them easier to read and apply.
+These settings can be applied by manually copying them to
+@file{.git/config} in your checkout, or by telling Git to include the
+whole file:
+
+@example
+git config --local include.path ../etc/git/gitconfig
+@end example
+
+From then on, any changes to @file{etc/git/gitconfig} would
+automatically take effect.
+
+Since the first patch in a series must be sent separately
+(@pxref{Sending a Patch Series}), it can also be helpful to tell
+@command{git format-patch} to handle the e-mail threading instead of
+@command{git send-email}:
+
+@example
+git config --local format.thread shallow
+git config --local sendemail.thread no
+@end example
+
 @unnumberedsubsec Sending a Patch Series
 @anchor{Sending a Patch Series}
 @cindex patch series
 @cindex @code{git send-email}
-@cindex @code{git-send-email}
 
 When sending a patch series (e.g., using @code{git send-email}), please
 first send one message to @email{guix-patches@@gnu.org}, and then send
diff --git a/doc/guix.texi b/doc/guix.texi
index 6436e83a7c..4dac36310f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -96,6 +96,7 @@
 Copyright @copyright{} 2021 Hui Lu@*
 Copyright @copyright{} 2021 pukkamustard@*
 Copyright @copyright{} 2021 Alice Brenon@*
+Copyright @copyright{} 2021 Sarah Morgensen@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/etc/git/gitconfig b/etc/git/gitconfig
new file mode 100644
index 0000000000..c9ebdc8fa8
--- /dev/null
+++ b/etc/git/gitconfig
@@ -0,0 +1,5 @@
+[diff "scheme"]
+	xfuncname = "^(\\(define.*)$"
+
+[diff "texinfo"]
+	xfuncname = "^@node[[:space:]]+([^,]+).*$"

base-commit: 808f9ffbd3106da4c92d2367b118b98196c9e81e
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Wed, 22 Sep 2021 12:56:02 GMT) Full text and rfc822 format available.

Message #31 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 50363 <at> debbugs.gnu.org, kyle <at> kyleam.com, maximedevos <at> telenet.be
Subject: Re: [PATCH v4] Improve default diff hunk header detection.
Date: Wed, 22 Sep 2021 14:55:26 +0200
Hi,

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

> Tell git where to look for diff hunk headers: top-level definitions for
> Scheme files, and (sub)section headers for texi files.
>
> * .gitattributes, etc/git/gitconfig: New files.
> * doc/contributing.texi ("Submitting Patches"): Add subsection
> "Configuring Git".  Document etc/git/gitconfig.

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.

The rest LGTM, thank you, and thanks Kyle!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Wed, 22 Sep 2021 16:23:02 GMT) Full text and rfc822 format available.

Message #34 received at 50363 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 50363 <at> debbugs.gnu.org, kyle <at> kyleam.com, maximedevos <at> telenet.be
Subject: Re: [bug#50363] [PATCH v4] Improve default diff hunk header detection.
Date: Wed, 22 Sep 2021 09:22:43 -0700
Hi Ludo,

> 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:

--8<---------------cut here---------------start------------->8---
info: git.info gitman.info
[...]
git.info: user-manual.texi
	$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
--8<---------------cut here---------------end--------------->8---

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.

>
> The rest LGTM, thank you, and thanks Kyle!
>
> Ludo’.

--
Sarah




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 04 Oct 2021 12:27:02 GMT) Full text and rfc822 format available.

Notification sent to Sarah Morgensen <iskarian <at> mgsn.dev>:
bug acknowledged by developer. (Mon, 04 Oct 2021 12:27:02 GMT) Full text and rfc822 format available.

Message #39 received at 50363-done <at> debbugs.gnu.org (full text, mbox):

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’.




Information forwarded to guix-patches <at> gnu.org:
bug#50363; Package guix-patches. (Wed, 13 Oct 2021 22:32:02 GMT) Full text and rfc822 format available.

Message #42 received at 50363-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>, Sarah Morgensen
 <iskarian <at> mgsn.dev>
Cc: 50363-done <at> debbugs.gnu.org
Subject: Re: bug#50363: [PATCH] Improve default diff hunk header detection.
Date: Thu, 14 Oct 2021 00:30:50 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> skriver:

> Finally applied!

It looks like this commit contained the documentation changes only.
Fixed in f8b10932c86cf4c1657a67e8c484d76f757b64bd.  :-)
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 11 Nov 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 138 days ago.

Previous Next


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