git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC for GIT] pull-request: add praise to people doing QA
@ 2017-01-15 18:30 Wolfram Sang
  2017-01-16  0:35 ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2017-01-15 18:30 UTC (permalink / raw)
  To: git, linux-kernel; +Cc: Wolfram Sang

Asking for opinions on lkml and git...

Getting enough quality assurance is likely one of the bigger upcoming tasks in
the near future. To improve the situation, praise the people already doing that
by adding their names to pull requests in the same manner that patch authors
are credited. Here is an example, I sent out today [1]:

=== old stuff

The following changes since commit a121103c922847ba5010819a3f250f1f7fc84ab8:

...

Vlad Tsyrklevich (1):
      i2c: fix kernel memory disclosure in dev interface

=== new stuff starts here

with much appreciated quality assurance from
----------------------------------------------------------------
Andy Shevchenko (1):
      (Rev.) i2c: piix4: Avoid race conditions with IMC

Benjamin Tissoires (1):
      (Test) i2c: do not enable fall back to Host Notify by default

Vladimir Zapolskiy (1):
      (Rev.) i2c: print correct device invalid address

=== diffstat, ...

This patch is a very early RFC to collect opinions. I am not very familiar with
the git codebase, but I guess using a filter needs to be reworked, the
dependency on GNU awk may be frowned upon (though 'asorti' is really useful
here), the reg-ex are not super-solid, and it should be a command-line option,
of course. That all being said, it was a fast way to produce what I would like
to add to my pull requests for the i2c subsystem and to see if other kernel/git
maintainers are interested in something like this.

Disclaimer: while this patch applies to the git codebase, I have to admit that
I simply patched around in /usr/lib/git-core of my Debian machine :)

So much for now, let me know what you think,

   Wolfram

[1] http://lkml.org/lkml/2017/1/15/55

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 git-praise-qa.awk   |   33 +++++++++++++++++++++++++++++++++
 git-request-pull.sh |    1 +
 2 files changed, 34 insertions(+)

Index: git-2.11.0/git-request-pull.sh
===================================================================
--- git-2.11.0.orig/git-request-pull.sh
+++ git-2.11.0/git-request-pull.sh
@@ -155,6 +155,7 @@ then
 fi &&
 
 git shortlog ^$baserev $headrev &&
+git log --no-merges ^$baserev $headrev | git-praise-qa.awk &&
 git diff -M --stat --summary $patch $merge_base..$headrev || status=1
 
 exit $status
Index: git-2.11.0/git-praise-qa.awk
===================================================================
--- /dev/null
+++ git-2.11.0/git-praise-qa.awk
@@ -0,0 +1,33 @@
+#! /usr/bin/gawk -f
+
+# New commit found, empty subject variable
+/^commit / { subject = "" }
+
+# Grab the subject line
+!subject && /^    / { subject = substr($0, 5); }
+
+# Scan for tags and get the type
+/^    Reviewed-by:/ { type = "Rev." }
+/^    Tested-by:/ { type = "Test" }
+
+type && subject {
+	# Extract the name
+	sub(/^.*: /, ""); sub(/ <.*/, ""); name = $0;
+	# Collect tags given by 'name'
+	tags[name] = tags[name] "      (" type ") " subject "\n";
+	count[name]++;
+	# Done, clear flag
+	type = "";
+}
+
+END {
+	print "\nwith much appreciated quality assurance from"
+	print "----------------------------------------------------------------"
+	# Sort by names
+	asorti(tags, sorted_names);
+	# printout in git style
+	for (i in sorted_names) {
+		name = sorted_names[i];
+		print name " (" count[name] "):" "\n" tags[name];
+	}
+}

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-15 18:30 [RFC for GIT] pull-request: add praise to people doing QA Wolfram Sang
@ 2017-01-16  0:35 ` Junio C Hamano
  2017-01-16  4:05   ` Jacob Keller
  2017-01-19 20:43   ` Wolfram Sang
  0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2017-01-16  0:35 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: git, linux-kernel

Wolfram Sang <wsa@the-dreams.de> writes:

> === new stuff starts here
>
> with much appreciated quality assurance from
> ----------------------------------------------------------------
> Andy Shevchenko (1):
>       (Rev.) i2c: piix4: Avoid race conditions with IMC
>
> Benjamin Tissoires (1):
>       (Test) i2c: do not enable fall back to Host Notify by default
>
> Vladimir Zapolskiy (1):
>       (Rev.) i2c: print correct device invalid address
>
> === diffstat, ...
>
> This patch is a very early RFC to collect opinions. I am not very familiar with
> the git codebase, but I guess using a filter needs to be reworked, the
> dependency on GNU awk may be frowned upon (though 'asorti' is really useful
> here), the reg-ex are not super-solid, and it should be a command-line option,
> of course. That all being said, it was a fast way to produce what I would like
> to add to my pull requests for the i2c subsystem and to see if other kernel/git
> maintainers are interested in something like this.
>
> Disclaimer: while this patch applies to the git codebase, I have to admit that
> I simply patched around in /usr/lib/git-core of my Debian machine :)
>
> So much for now, let me know what you think,

So the idea is to have list of those whose names appear on
Reviewed-by: and Tested-by: collected and listed after the list of
commit titles and author names.  I personally do not see much
downsides in doing so, but I do not consume that many PRs myself, so
let's hear from those who actually do process many of them.

As to the implementation, I am wondering if we can make this somehow
work well with the "trailers" code we already have, instead of
inventing yet another parser of trailers.  

In its current shape, "interpret-trailers" focuses on "editing" an
existing commit log message to tweak the trailer lines.  That mode
of operation would help amending and rebasing, and to do that it
needs to parse the commit log message, identify trailer blocks,
parse out each trailer lines, etc.  

There is no fundamental reason why its output must be an edited
original commit log message---it should be usable as a filter that
picks trailer lines of the selected trailer type, like "Tested-By",
etc.

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-16  0:35 ` Junio C Hamano
@ 2017-01-16  4:05   ` Jacob Keller
  2017-01-19 20:43   ` Wolfram Sang
  1 sibling, 0 replies; 10+ messages in thread
From: Jacob Keller @ 2017-01-16  4:05 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Wolfram Sang, Git mailing list, linux-kernel@vger.kernel.org

On Sun, Jan 15, 2017 at 4:35 PM, Junio C Hamano <gitster@pobox.com> wrote:
> As to the implementation, I am wondering if we can make this somehow
> work well with the "trailers" code we already have, instead of
> inventing yet another parser of trailers.
>
> In its current shape, "interpret-trailers" focuses on "editing" an
> existing commit log message to tweak the trailer lines.  That mode
> of operation would help amending and rebasing, and to do that it
> needs to parse the commit log message, identify trailer blocks,
> parse out each trailer lines, etc.
>
> There is no fundamental reason why its output must be an edited
> original commit log message---it should be usable as a filter that
> picks trailer lines of the selected trailer type, like "Tested-By",
> etc.

I have been looking at ways to use the interpret-trailers as a way to
filter commits and print out trailers, and this sort of feature would
be useful to me if it were generic. (and then pull-request could use
the generic interface to grab the data and then parse it into a praise
format)

Thanks,
Jake

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-16  0:35 ` Junio C Hamano
  2017-01-16  4:05   ` Jacob Keller
@ 2017-01-19 20:43   ` Wolfram Sang
  2017-01-19 21:20     ` Jeff King
  2017-01-19 21:22     ` Junio C Hamano
  1 sibling, 2 replies; 10+ messages in thread
From: Wolfram Sang @ 2017-01-19 20:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, linux-kernel


> So the idea is to have list of those whose names appear on
> Reviewed-by: and Tested-by: collected and listed after the list of
> commit titles and author names.  I personally do not see much
> downsides in doing so, but I do not consume that many PRs myself, so
> let's hear from those who actually do process many of them.

Sadly, no further responses so far. Let's see if they will come if I
keep posting my pull requests with that information attached.

> As to the implementation, I am wondering if we can make this somehow
> work well with the "trailers" code we already have, instead of
> inventing yet another parser of trailers.  
> 
> In its current shape, "interpret-trailers" focuses on "editing" an
> existing commit log message to tweak the trailer lines.  That mode
> of operation would help amending and rebasing, and to do that it
> needs to parse the commit log message, identify trailer blocks,
> parse out each trailer lines, etc.  
> 
> There is no fundamental reason why its output must be an edited
> original commit log message---it should be usable as a filter that
> picks trailer lines of the selected trailer type, like "Tested-By",
> etc.

I didn't know about trailers before. As I undestand it, I could use
"Tested-by" as the key, and the commit subject as the value. This list
then could be parsed and brought into proper output shape. It would
simplify the subject parsing, but most things my AWK script currently
does would still need to stay or to be reimplemented (extracting names
from tags, creating arrays of tags given by $name). Am I correct?

All under the assumption that trailers work on a range of commits. I
have to admit that adding this to git is beyond my scope.

Thanks for looking into it,

   Wolfram


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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-19 20:43   ` Wolfram Sang
@ 2017-01-19 21:20     ` Jeff King
  2017-01-19 23:42       ` Jacob Keller
  2017-01-19 21:22     ` Junio C Hamano
  1 sibling, 1 reply; 10+ messages in thread
From: Jeff King @ 2017-01-19 21:20 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Junio C Hamano, git, linux-kernel

On Thu, Jan 19, 2017 at 09:43:45PM +0100, Wolfram Sang wrote:

> > As to the implementation, I am wondering if we can make this somehow
> > work well with the "trailers" code we already have, instead of
> > inventing yet another parser of trailers.  
> > 
> > In its current shape, "interpret-trailers" focuses on "editing" an
> > existing commit log message to tweak the trailer lines.  That mode
> > of operation would help amending and rebasing, and to do that it
> > needs to parse the commit log message, identify trailer blocks,
> > parse out each trailer lines, etc.  
> > 
> > There is no fundamental reason why its output must be an edited
> > original commit log message---it should be usable as a filter that
> > picks trailer lines of the selected trailer type, like "Tested-By",
> > etc.
> 
> I didn't know about trailers before. As I undestand it, I could use
> "Tested-by" as the key, and the commit subject as the value. This list
> then could be parsed and brought into proper output shape. It would
> simplify the subject parsing, but most things my AWK script currently
> does would still need to stay or to be reimplemented (extracting names
> from tags, creating arrays of tags given by $name). Am I correct?
> 
> All under the assumption that trailers work on a range of commits. I
> have to admit that adding this to git is beyond my scope.

This sounds a lot like the shortlog-trailers work I did about a year
ago:

  http://public-inbox.org/git/20151229073832.GN8842@sigill.intra.peff.net/

  http://public-inbox.org/git/20151229075013.GA9191@sigill.intra.peff.net/

Nobody seemed to really find it useful, so I didn't pursue it.

Some of the preparatory patches in that series bit-rotted in the
meantime, but you can play with a version based on v2.7.0 by fetching
the "shortlog-trailers-historical" branch from
https://github.com/peff/git.git.

And then things like:

  git shortlog --ident=tested-by --format='...tested a patch by %an'

work (and you can put whatever commit items you want into the --format,
including just dumping the hash if you want to do more analysis).

-Peff

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-19 20:43   ` Wolfram Sang
  2017-01-19 21:20     ` Jeff King
@ 2017-01-19 21:22     ` Junio C Hamano
  2017-01-19 22:02       ` Wolfram Sang
  1 sibling, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2017-01-19 21:22 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: git, linux-kernel

Wolfram Sang <wsa@the-dreams.de> writes:

> I didn't know about trailers before. As I undestand it, I could use
> "Tested-by" as the key, and the commit subject as the value. This list
> then could be parsed and brought into proper output shape. It would
> simplify the subject parsing, but most things my AWK script currently
> does would still need to stay or to be reimplemented (extracting names
> from tags, creating arrays of tags given by $name). Am I correct?

That is not exactly what I had in mind.  I was wondering if we can
do without any external script, implementing the logic you added
inside shortlog with an extra option that triggers the whole thing,
which may call into the same trailers API as used by the
interpret-trailers command to do the parsing and picking out parts.

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-19 21:22     ` Junio C Hamano
@ 2017-01-19 22:02       ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2017-01-19 22:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]


> > I didn't know about trailers before. As I undestand it, I could use
> > "Tested-by" as the key, and the commit subject as the value. This list
> > then could be parsed and brought into proper output shape. It would
> > simplify the subject parsing, but most things my AWK script currently
> > does would still need to stay or to be reimplemented (extracting names
> > from tags, creating arrays of tags given by $name). Am I correct?
> 
> That is not exactly what I had in mind.  I was wondering if we can
> do without any external script, implementing the logic you added
> inside shortlog with an extra option that triggers the whole thing,
> which may call into the same trailers API as used by the
> interpret-trailers command to do the parsing and picking out parts.

Sorry for being unclear. That's what I meant with "or to be
reimplemented". I should have added "in C".

I am afraid this also requires more time than I am willing to
spend on this issue. Seems my hack is going to stay for a while here.

However, thank you for your time and assisting me with pointers!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-19 21:20     ` Jeff King
@ 2017-01-19 23:42       ` Jacob Keller
  2017-01-20  0:06         ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: Jacob Keller @ 2017-01-19 23:42 UTC (permalink / raw)
  To: Jeff King
  Cc: Wolfram Sang, Junio C Hamano, Git mailing list,
	linux-kernel@vger.kernel.org

On Thu, Jan 19, 2017 at 1:20 PM, Jeff King <peff@peff.net> wrote:
> On Thu, Jan 19, 2017 at 09:43:45PM +0100, Wolfram Sang wrote:
>
>> > As to the implementation, I am wondering if we can make this somehow
>> > work well with the "trailers" code we already have, instead of
>> > inventing yet another parser of trailers.
>> >
>> > In its current shape, "interpret-trailers" focuses on "editing" an
>> > existing commit log message to tweak the trailer lines.  That mode
>> > of operation would help amending and rebasing, and to do that it
>> > needs to parse the commit log message, identify trailer blocks,
>> > parse out each trailer lines, etc.
>> >
>> > There is no fundamental reason why its output must be an edited
>> > original commit log message---it should be usable as a filter that
>> > picks trailer lines of the selected trailer type, like "Tested-By",
>> > etc.
>>
>> I didn't know about trailers before. As I undestand it, I could use
>> "Tested-by" as the key, and the commit subject as the value. This list
>> then could be parsed and brought into proper output shape. It would
>> simplify the subject parsing, but most things my AWK script currently
>> does would still need to stay or to be reimplemented (extracting names
>> from tags, creating arrays of tags given by $name). Am I correct?
>>
>> All under the assumption that trailers work on a range of commits. I
>> have to admit that adding this to git is beyond my scope.
>
> This sounds a lot like the shortlog-trailers work I did about a year
> ago:
>
>   http://public-inbox.org/git/20151229073832.GN8842@sigill.intra.peff.net/
>
>   http://public-inbox.org/git/20151229075013.GA9191@sigill.intra.peff.net/
>
> Nobody seemed to really find it useful, so I didn't pursue it.
>
> Some of the preparatory patches in that series bit-rotted in the
> meantime, but you can play with a version based on v2.7.0 by fetching
> the "shortlog-trailers-historical" branch from
> https://github.com/peff/git.git.
>
> And then things like:
>
>   git shortlog --ident=tested-by --format='...tested a patch by %an'
>
> work (and you can put whatever commit items you want into the --format,
> including just dumping the hash if you want to do more analysis).
>
> -Peff

This sounds interesting to me! When I have some more time to take a
look at this i might see if I can revive it.

Thanks,
Jake

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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-19 23:42       ` Jacob Keller
@ 2017-01-20  0:06         ` Joe Perches
  2017-01-20  0:13           ` Jacob Keller
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2017-01-20  0:06 UTC (permalink / raw)
  To: Jacob Keller, Jeff King
  Cc: Wolfram Sang, Junio C Hamano, Git mailing list,
	linux-kernel@vger.kernel.org

On Thu, 2017-01-19 at 15:42 -0800, Jacob Keller wrote:
> On Thu, Jan 19, 2017 at 1:20 PM, Jeff King <peff@peff.net> wrote:
> > On Thu, Jan 19, 2017 at 09:43:45PM +0100, Wolfram Sang wrote:
> > 
> > > > As to the implementation, I am wondering if we can make this somehow
> > > > work well with the "trailers" code we already have, instead of
> > > > inventing yet another parser of trailers.
> > > > 
> > > > In its current shape, "interpret-trailers" focuses on "editing" an
> > > > existing commit log message to tweak the trailer lines.  That mode
> > > > of operation would help amending and rebasing, and to do that it
> > > > needs to parse the commit log message, identify trailer blocks,
> > > > parse out each trailer lines, etc.
> > > > 
> > > > There is no fundamental reason why its output must be an edited
> > > > original commit log message---it should be usable as a filter that
> > > > picks trailer lines of the selected trailer type, like "Tested-By",
> > > > etc.
> > > 
> > > I didn't know about trailers before. As I undestand it, I could use
> > > "Tested-by" as the key, and the commit subject as the value. This list
> > > then could be parsed and brought into proper output shape. It would
> > > simplify the subject parsing, but most things my AWK script currently
> > > does would still need to stay or to be reimplemented (extracting names
> > > from tags, creating arrays of tags given by $name). Am I correct?
> > > 
> > > All under the assumption that trailers work on a range of commits. I
> > > have to admit that adding this to git is beyond my scope.
> > 
> > This sounds a lot like the shortlog-trailers work I did about a year
> > ago:
> > 
> >   http://public-inbox.org/git/20151229073832.GN8842@sigill.intra.peff.net/
> > 
> >   http://public-inbox.org/git/20151229075013.GA9191@sigill.intra.peff.net/
> > 
> > Nobody seemed to really find it useful, so I didn't pursue it.
> > 
> > Some of the preparatory patches in that series bit-rotted in the
> > meantime, but you can play with a version based on v2.7.0 by fetching
> > the "shortlog-trailers-historical" branch from
> > https://github.com/peff/git.git.
> > 
> > And then things like:
> > 
> >   git shortlog --ident=tested-by --format='...tested a patch by %an'
> > 
> > work (and you can put whatever commit items you want into the --format,
> > including just dumping the hash if you want to do more analysis).
> > 
> > -Peff
> 
> This sounds interesting to me! When I have some more time to take a
> look at this i might see if I can revive it.

Can the terminology please be standardized to what
was once called bylines?

https://patchwork.kernel.org/patch/9307703/


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

* Re: [RFC for GIT] pull-request: add praise to people doing QA
  2017-01-20  0:06         ` Joe Perches
@ 2017-01-20  0:13           ` Jacob Keller
  0 siblings, 0 replies; 10+ messages in thread
From: Jacob Keller @ 2017-01-20  0:13 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jeff King, Wolfram Sang, Junio C Hamano, Git mailing list,
	linux-kernel@vger.kernel.org

On Thu, Jan 19, 2017 at 4:06 PM, Joe Perches <joe@perches.com>
wrote:>> This sounds interesting to me! When I have some more time to
take a
>> look at this i might see if I can revive it.
>
> Can the terminology please be standardized to what
> was once called bylines?
>
> https://patchwork.kernel.org/patch/9307703/
>

I am fairly certain we've settled on "trailers" at this point. I don't
have an objection to either name, but most of the code today uses
trailers.

Thanks,
Jake

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

end of thread, other threads:[~2017-01-20  0:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-15 18:30 [RFC for GIT] pull-request: add praise to people doing QA Wolfram Sang
2017-01-16  0:35 ` Junio C Hamano
2017-01-16  4:05   ` Jacob Keller
2017-01-19 20:43   ` Wolfram Sang
2017-01-19 21:20     ` Jeff King
2017-01-19 23:42       ` Jacob Keller
2017-01-20  0:06         ` Joe Perches
2017-01-20  0:13           ` Jacob Keller
2017-01-19 21:22     ` Junio C Hamano
2017-01-19 22:02       ` Wolfram Sang

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).