all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Protesilaos Stavrou <info@protesilaos.com>
To: emacs-devel@gnu.org
Cc: Adam Spiers <emacs-devel@adamspiers.org>
Subject: Patch upstream Git for Elisp diff hunk headings
Date: Thu, 11 Feb 2021 16:42:05 +0200	[thread overview]
Message-ID: <87czx68y4i.fsf@protesilaos.com> (raw)

Dear members,

Myself and Adam Spiers (in cc) have been discussing the possibility of
patching Git so that it can handle Emacs Lisp diff hunk headings
natively.  Those headings consist of the text that follows the line
ranges that diff outputs.  So this:

  @@ -389,7 +390,7 @@ HEADING HERE

Git produces those headings using language-specific regular expressions.
Elisp is not covered.  Users must thus define their own Git attributes.
Not doing so results in practically useless text for the heading; text
that does not provide an accurate sense of context.

I have noticed that Emacs' git repo includes the file ".gitattributes"
which instructs diffs inside of that repo to use an Elisp-aware regexp
present in "autogen.sh":

  git_config diff.elisp.xfuncname \
             '^\([^[:space:]]*def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'

This is an improvement over the out-of-the-box Git experience.

Now the questions to this list:

1. What do you think about only targeting top-level forms?

2. How about the comments that are interpreted by outline-minor-mode as
   headings?  So the three or more ";;;" at the beginning of a line.
   Would it not be right to match those as well, since they are supposed
   to be 'headings' in Elisp source code?

Thank you in advance!
Protesilaos or "Prot"

-- 
Protesilaos Stavrou
protesilaos.com



             reply	other threads:[~2021-02-11 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 14:42 Protesilaos Stavrou [this message]
2021-02-11 18:27 ` Patch upstream Git for Elisp diff hunk headings Adam Spiers
2021-02-11 19:05   ` Stefan Kangas
2021-02-12 17:39     ` Basil L. Contovounesios
2021-02-11 19:13   ` Clément Pit-Claudel
2021-02-11 19:15   ` Óscar Fuentes
2021-02-11 19:38   ` Stefan Monnier
2021-02-13 19:35     ` Adam Spiers

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

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

  git send-email \
    --in-reply-to=87czx68y4i.fsf@protesilaos.com \
    --to=info@protesilaos.com \
    --cc=emacs-devel@adamspiers.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.