Re: [PATCH] doc/gitattributes: add Octave
- Date: Sat, 11 May 2019 10:36:00 +0800
- From: "LI, BO XUAN" <liboxuan@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH] doc/gitattributes: add Octave
On Sat, May 11, 2019 at 7:26 AM Ævar Arnfjörð Bjarmason
> On Fri, May 10 2019, Boxuan Li wrote:
> > `matlab` pattern is also suitable for source code
> > in the GNU Octave language.
> > Signed-off-by: Boxuan Li <liboxuan@xxxxxxxxxxxxxx>
> > ---
> > Documentation/gitattributes.txt | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
> > index 4fb20cd0e9..1b28381bda 100644
> > --- a/Documentation/gitattributes.txt
> > +++ b/Documentation/gitattributes.txt
> > @@ -819,7 +819,7 @@ patterns are available:
> > - `java` suitable for source code in the Java language.
> > -- `matlab` suitable for source code in the MATLAB language.
> > +- `matlab` suitable for source code in the MATLAB/Octave language.
> > - `objc` suitable for source code in the Objective-C language.
> I've never used either, but browsing our patterns I see:
> I.e. that last bit matches ^%%, and then here:
> MATLAB uses the percent sign '%' to begin a comment. Octave uses
> both the hash symbol # and the percent sign % interchangeably.
> So here we have the "function" pattern matching a comment, right? (this
> doesn't have any tests) and we'd want to add "#" to Octave, but not
Thanks, that's a great catch! Actually, '%%' is used to start a code
section in Matlab
while Octave uses both '%%' and '##'
> I see both tend to use the ".m" extension. Anyway, isn't it better to
> add an "octave" pattern, and document that they're mostly the same
I agree. I'll send an updated patch soon.
> (although it looks like we can add #-comments, to future-proof