public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
To: Jakub Jelinek <jakub@redhat.com>,
	"Joseph S. Myers" <joseph@codesourcery.com>,
	Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] .gitattributes: Add *.md diff=md
Date: Wed, 15 Jan 2020 14:33:00 -0000	[thread overview]
Message-ID: <26070532-a08a-c0d1-867b-bfbd31cea104@arm.com> (raw)
In-Reply-To: <1aeb7a8a-69e3-988f-b712-40730aa3b6c3@arm.com>

On 15/01/2020 13:19, Richard Earnshaw (lists) wrote:
> On 15/01/2020 11:45, Jakub Jelinek wrote:
>> Hi!
>>
>> As discussed on IRC, this patch adds the .gitattributes part of the
>> better diff for *.md files customization.
>> Tested in a tree with contrib/gcc-git-customization.sh performed,
>> config/i386/i386.md diffing then nicely shows the pattern, and in
>> a tree without the customization, where it works as if the *.md diff=md
>> line wasn't there.
>>
>> Ok for trunk (and eventually release branches)?
>>
>> 2020-01-15  Segher Boessenkool  <segher@kernel.crashing.org>
>>         Jakub Jelinek  <jakub@redhat.com>
>>
>>     * .gitattributes: Add *.md diff=md.
>> contrib/
>>     * gcc-git-customization.sh: Change uses to use in comment.
>>
>> diff --git a/.gitattributes b/.gitattributes
>> index 13debfd97e9..e75bfc595bf 100644
>> --- a/.gitattributes
>> +++ b/.gitattributes
>> @@ -4,3 +4,7 @@
>>   *.[cCh] whitespace=indent-with-non-tab,space-before-tab,trailing-space
>>   *.cc whitespace=indent-with-non-tab,space-before-tab,trailing-space
>>   ChangeLog 
>> whitespace=indent-with-non-tab,space-before-tab,trailing-space
>> +# Make diff on MD files use "(define" as a function marker.
>> +# Use together with git config diff.md.xfuncname '^\(define.*$'
>> +# which is run by contrib/gcc-git-customization.sh too.
>> +*.md diff=md
>> diff --git a/contrib/gcc-git-customization.sh 
>> b/contrib/gcc-git-customization.sh
>> index af7d210217f..f4261592b1d 100755
>> --- a/contrib/gcc-git-customization.sh
>> +++ b/contrib/gcc-git-customization.sh
>> @@ -25,7 +25,7 @@ git config alias.svn-rev '!f() { rev=$1; shift; git 
>> log --all --grep="From-SVN:
>>   git config alias.gcc-descr \!"f() { if test \${1:-no} = --full; then 
>> r=\$(git describe --all --abbrev=40 --match 'basepoints/gcc-[0-9]*' 
>> \${2:-master} | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-,r,p'); expr 
>> match \${r:-no} '^r[0-9]\\+\$' >/dev/null && r=\${r}-0-g\$(git 
>> rev-parse \${2:-master}); test -n \$r && echo \${r}; else git describe 
>> --all --match 'basepoints/gcc-[0-9]*' \${1:-master} | sed -n 
>> 's,^\\(tags/\\)\\?basepoints/gcc-\\([0-9]\\+\\)-\\([0-9]\\+\\)-g[0-9a-f]*\$,r\\2-\\3,p;s,^\\(tags/\\)\\?basepoints/gcc-\\([0-9]\\+\\)\$,r\\2-0,p'; 
>> fi; }; f"
>>   git config alias.gcc-undescr \!"f() { o=\$(git config --get 
>> gcc-config.upstream); r=\$(echo \$1 | sed -n 
>> 's,^r\\([0-9]\\+\\)-[0-9]\\+\$,\\1,p'); n=\$(echo \$1 | sed -n 
>> 's,^r[0-9]\\+-\\([0-9]\\+\\)\$,\\1,p'); test -z \$r && echo Invalid id 
>> \$1 && exit 1; h=\$(git rev-parse --verify --quiet 
>> \${o:-origin}/releases/gcc-\$r); test -z \$h && h=\$(git rev-parse 
>> --verify --quiet \${o:-origin}/master); p=\$(git describe --all 
>> --match 'basepoints/gcc-'\$r \$h | sed -n 
>> 's,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+-\\([0-9]\\+\\)-g[0-9a-f]*\$,\\2,p;s,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+\$,0,p'); 
>> git rev-parse --verify \$h~\$(expr \$p - \$n); }; f"
>> -# Make diff on MD files uses "(define" as a function marker.
>> +# Make diff on MD files use "(define" as a function marker.
>>   # Use this in conjunction with a .gitattributes file containing
>>   # *.md    diff=md
>>   git config diff.md.xfuncname '^\(define.*$'
>>
>>     Jakub
>>
> 
> 
> I'd just posted nearly the same patch...
> 
> Suggest
> 
> *.[mp]d diff=md
> 
> Then match.pd will pick up this rule as well.
> 
> OK with that change.
> 
> R.

As discussed on IRC, the original is fine.

R.

      reply	other threads:[~2020-01-15 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 12:30 Jakub Jelinek
2020-01-15 13:39 ` Richard Earnshaw (lists)
2020-01-15 14:33   ` Richard Earnshaw (lists) [this message]

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=26070532-a08a-c0d1-867b-bfbd31cea104@arm.com \
    --to=richard.earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=segher@kernel.crashing.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.
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).