unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: Kyle Meyer <kyle@kyleam.com>
Cc: 50363@debbugs.gnu.org, ludo@gnu.org, maximedevos@telenet.be
Subject: [bug#50363] [PATCH v3] Improve default diff hunk header detection.
Date: Sun, 19 Sep 2021 15:56:43 -0700	[thread overview]
Message-ID: <86ee9kgono.fsf@mgsn.dev> (raw)
In-Reply-To: <87o88o8bf8.fsf@kyleam.com> (Kyle Meyer's message of "Sun, 19 Sep 2021 18:09:47 -0400 (21 minutes, 1 second ago)")

Hello Kyle,

Thanks for taking a look and trying this out!

Kyle Meyer <kyle@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




  reply	other threads:[~2021-09-19 22:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ee9kgono.fsf@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=50363@debbugs.gnu.org \
    --cc=kyle@kyleam.com \
    --cc=ludo@gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).