git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GSoC][RFC/PATCH 0/1]
@ 2019-03-15 15:01 jkapil.cs
  2019-03-15 15:01 ` [GSoC][RFC/PATCH 1/1] userdiff - support shell script jkapil.cs
  2019-03-15 22:39 ` [GSoC][RFC/PATCH 0/1] Thomas Gummerer
  0 siblings, 2 replies; 5+ messages in thread
From: jkapil.cs @ 2019-03-15 15:01 UTC (permalink / raw)
  To: git; +Cc: t.gummerer, alban.gruin, avarab, Kapil

From: Kapil <jkapil.cs@gmail.com>


Kapil (1):
  userdiff - support shell script

 t/t4018-diff-funcname.sh | 1 +
 t/t4034-diff-words.sh    | 1 +
 userdiff.c               | 5 +++++
 3 files changed, 7 insertions(+)

-- 
2.14.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [GSoC][RFC/PATCH 1/1] userdiff - support shell script
  2019-03-15 15:01 [GSoC][RFC/PATCH 0/1] jkapil.cs
@ 2019-03-15 15:01 ` jkapil.cs
  2019-03-15 23:05   ` Thomas Gummerer
  2019-03-15 22:39 ` [GSoC][RFC/PATCH 0/1] Thomas Gummerer
  1 sibling, 1 reply; 5+ messages in thread
From: jkapil.cs @ 2019-03-15 15:01 UTC (permalink / raw)
  To: git; +Cc: t.gummerer, alban.gruin, avarab, Kapil

From: Kapil <jkapil.cs@gmail.com>

Made a minor change of adding regex for identifying functions in shell scripts.
This regex has been tested separately from git.
For testing with git, please let me know.

This is just to get familiar with whole workflow, regex for word_regex parameter will be added in next patch.

---
 t/t4018-diff-funcname.sh | 1 +
 t/t4034-diff-words.sh    | 1 +
 userdiff.c               | 5 +++++
 3 files changed, 7 insertions(+)

diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 22f9f88f0a..68092eaeaa 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -44,6 +44,7 @@ diffpatterns="
 	python
 	ruby
 	tex
+	shell
 	custom1
 	custom2
 	custom3
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 912df91226..de21f36d97 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -314,6 +314,7 @@ test_language_driver php
 test_language_driver python
 test_language_driver ruby
 test_language_driver tex
+test_language_driver shell
 
 test_expect_success 'word-diff with diff.sbe' '
 	cat >expect <<-\EOF &&
diff --git a/userdiff.c b/userdiff.c
index 3a78fbf504..1743608da2 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -170,6 +170,11 @@ IPATTERN("css",
 	 "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
 	 "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
 ),
+
+PATTERNS("shell",
+	"([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*\\([[:space:]]*\\)[[:space:]]*\\{[[:space:]\\(\\)|\\[<>?`/~!:\'\"%^&*+A-Za-z0-9_$=@;#,.-]*\\}",
+	".*"
+),
 { "default", NULL, -1, { NULL, 0 } },
 };
 #undef PATTERNS
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [GSoC][RFC/PATCH 0/1]
  2019-03-15 15:01 [GSoC][RFC/PATCH 0/1] jkapil.cs
  2019-03-15 15:01 ` [GSoC][RFC/PATCH 1/1] userdiff - support shell script jkapil.cs
@ 2019-03-15 22:39 ` Thomas Gummerer
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Gummerer @ 2019-03-15 22:39 UTC (permalink / raw)
  To: jkapil.cs; +Cc: git, alban.gruin, avarab

On 03/15, jkapil.cs@gmail.com wrote:
> From: Kapil <jkapil.cs@gmail.com>
> 

The cover letter should give reviewers a short introduction what a
patch series is about.  It's often not worth including a cover letter
if there is only a single patch, or only a couple of patches.

It is okay to send a cover letter for a single patch, however it
should include some explanation for the patch series, and not just
duplicate what's said in the commit message of the actual patch.  An
empty cover letter as this one here is just noise, and should be
omitted.

> Kapil (1):
>   userdiff - support shell script
> 
>  t/t4018-diff-funcname.sh | 1 +
>  t/t4034-diff-words.sh    | 1 +
>  userdiff.c               | 5 +++++
>  3 files changed, 7 insertions(+)
> 
> -- 
> 2.14.2
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GSoC][RFC/PATCH 1/1] userdiff - support shell script
  2019-03-15 15:01 ` [GSoC][RFC/PATCH 1/1] userdiff - support shell script jkapil.cs
@ 2019-03-15 23:05   ` Thomas Gummerer
       [not found]     ` <CAMknYEP3dp0a9B4ZW5F8kt+rrRZagWaVYBMhYRWj68UgYrF-GA@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gummerer @ 2019-03-15 23:05 UTC (permalink / raw)
  To: jkapil.cs; +Cc: git, alban.gruin, avarab

> Subject: [GSoC][RFC/PATCH 1/1] userdiff - support shell script

We usually have the subject in the format "<area>: <short
explanation>", so in this case it could be "userdiff: support shell
script" (without the quotes of course).

On 03/15, jkapil.cs@gmail.com wrote:
> From: Kapil <jkapil.cs@gmail.com>

Ideally the name you are using for your contribution should be your
full name, including your last name.

> Made a minor change of adding regex for identifying functions in shell scripts.

The commit message should be in the imperative mood, see also
Documentation/SubmittingPatches.  In addition the "minor change" bit
should be omitted, as it doesn't add any actual value to the commit
message.

So the above should just be "Add regex for identifying functions in
shell scripts".

> This regex has been tested separately from git.
> For testing with git, please let me know.

For testing you could have a look how other userdiff drivers are
tested in t4034.  The easiest way is probably to have a look at a
patch for a userdiff pattern that was added previously.  For example
have a look at 0719f3eecd ("userdiff: add built-in pattern for CSS",
2016-06-03).  (I found this commit by looking at the git blame output
for t4034.)

Both the two lines above and the line below should go below the ---
line, as they should not be part of the history in the git project,
but serve only as additional commentary for reviewers looking at this
patch.

> This is just to get familiar with whole workflow, regex for word_regex parameter will be added in next patch.

There should be a Signed-off-by: line here.  For its significance
please see Documentation/SubmittingPatches.

Another thing you should consider is whether someone attempted to add
support for this before.  And indeed a quick search through
public-inbox turns up [*1*].  It's always worth having a look at
previous work, and things that can be learned from that.

*1*: https://public-inbox.org/git/20170329165331.17742-1-pickfire@riseup.net/#t

> ---
>  t/t4018-diff-funcname.sh | 1 +
>  t/t4034-diff-words.sh    | 1 +
>  userdiff.c               | 5 +++++
>  3 files changed, 7 insertions(+)
> 
> diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
> index 22f9f88f0a..68092eaeaa 100755
> --- a/t/t4018-diff-funcname.sh
> +++ b/t/t4018-diff-funcname.sh
> @@ -44,6 +44,7 @@ diffpatterns="
>  	python
>  	ruby
>  	tex
> +	shell
>  	custom1
>  	custom2
>  	custom3
> diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
> index 912df91226..de21f36d97 100755
> --- a/t/t4034-diff-words.sh
> +++ b/t/t4034-diff-words.sh
> @@ -314,6 +314,7 @@ test_language_driver php
>  test_language_driver python
>  test_language_driver ruby
>  test_language_driver tex
> +test_language_driver shell
>  
>  test_expect_success 'word-diff with diff.sbe' '
>  	cat >expect <<-\EOF &&
> diff --git a/userdiff.c b/userdiff.c
> index 3a78fbf504..1743608da2 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -170,6 +170,11 @@ IPATTERN("css",
>  	 "-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
>  	 "|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
>  ),
> +
> +PATTERNS("shell",
> +	"([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*\\([[:space:]]*\\)[[:space:]]*\\{[[:space:]\\(\\)|\\[<>?`/~!:\'\"%^&*+A-Za-z0-9_$=@;#,.-]*\\}",
> +	".*"
> +),
>  { "default", NULL, -1, { NULL, 0 } },
>  };
>  #undef PATTERNS
> -- 
> 2.14.2
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GSoC][RFC/PATCH 1/1] userdiff - support shell script
       [not found]     ` <CAMknYEP3dp0a9B4ZW5F8kt+rrRZagWaVYBMhYRWj68UgYrF-GA@mail.gmail.com>
@ 2019-03-16 18:45       ` Thomas Gummerer
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gummerer @ 2019-03-16 18:45 UTC (permalink / raw)
  To: Kapil Jain; +Cc: git, alban.gruin, avarab

[please keep everyone in Cc, especially the mailing list if you are
responding to review comments.  I added the Cc's back]

On 03/16, Kapil Jain wrote:
> On Sat, Mar 16, 2019 at 4:35 AM Thomas Gummerer <t.gummerer@gmail.com> wrote:
> >
> > For testing you could have a look how other userdiff drivers are
> > tested in t4034.  The easiest way is probably to have a look at a
> > patch for a userdiff pattern that was added previously.  For example
> > have a look at 0719f3eecd ("userdiff: add built-in pattern for CSS",
> > 2016-06-03).  (I found this commit by looking at the git blame output
> > for t4034.)
> > *1*: https://public-inbox.org/git/20170329165331.17742-1-pickfire@riseup.net/#t
> 
> Thanks, this helped in understanding testing process.
> 
> > Both the two lines above and the line below should go below the ---
> > line, as they should not be part of the history in the git project,
> > but serve only as additional commentary for reviewers looking at this
> > patch.
> 
> I looked at other patches like
> (https://public-inbox.org/git/CAC05386q2iGoiJ_fRgwoOTF23exEN2D1+oh4VjajEvYQ58O1TQ@mail.gmail.com/)
> The patch has the email body above --- line. did i missed to
> understanding something here ?

Right, what I was trying but failed to explain is that everything
above the --- line is part of the commit message, that gets recorded
in the history of the project.

However the lines I referred to, should not go in the commit message,
as they are just commentary that helps reviewers, but don't actually
explain the patch itself.  That additional commentary should go below
the --- line, similar to the

    Notes:
        Travis CI results: https://travis-ci.org/nbelakovski/git/builds/432320949

lines in the email you mentioned.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-16 18:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15 15:01 [GSoC][RFC/PATCH 0/1] jkapil.cs
2019-03-15 15:01 ` [GSoC][RFC/PATCH 1/1] userdiff - support shell script jkapil.cs
2019-03-15 23:05   ` Thomas Gummerer
     [not found]     ` <CAMknYEP3dp0a9B4ZW5F8kt+rrRZagWaVYBMhYRWj68UgYrF-GA@mail.gmail.com>
2019-03-16 18:45       ` Thomas Gummerer
2019-03-15 22:39 ` [GSoC][RFC/PATCH 0/1] Thomas Gummerer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.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).