New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] pending-author.t fallback to the last commit #14906
Comments
From @atoomicCreated by @atoomicpending-author.t tries to detect if the current The documentation suggests to generate your patches The earlier we detect an unknown author the better it's Perl Info
|
From @atoomic0001-pending-author.t-fallback-to-the-last-commit.patchFrom b3c3762ae339c62de2ac1a5b599aed134e5c3d72 Mon Sep 17 00:00:00 2001
From: Nicolas R <atoomic@cpan.org>
Date: Fri, 11 Sep 2015 09:33:08 -0500
Subject: [PATCH] pending-author.t fallback to the last commit
pending-author.t tries to detect if the current
author is unknown but when your branch is clean
and you've commited your work, no check is performed.
We are now falling back to the last commit when
no changes are pending, to detect a missing author
entry earlier.
The documentation suggests to generate your patches
after running 'make test'.
---
AUTHORS | 1 +
t/porting/pending-author.t | 23 ++++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index b5ef912..b6188e2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -891,6 +891,7 @@ Nick Ing-Simmons
Nick Johnston <nickjohnstonsky@gmail.com>
Nick Williams <Nick.Williams@morganstanley.com>
Nicolas Kaiser <nikai@nikai.net>
+Nicolas R. <atoomic@cpan.org>
Niels Thykier <niels@thykier.net>
Nigel Sandever <njsandever@hotmail.com>
Niko Tyni <ntyni@debian.org>
diff --git a/t/porting/pending-author.t b/t/porting/pending-author.t
index 4dceaf6..1156e22 100644
--- a/t/porting/pending-author.t
+++ b/t/porting/pending-author.t
@@ -31,15 +31,25 @@ require 't/test.pl';
find_git_or_skip('all');
my $devnull = File::Spec->devnull;
+my $log;
my $changes;
-foreach (`git status --porcelain 2>$devnull`) {
+foreach (qx{git status --porcelain 2>$devnull}) {
next if /^\?\?/;
++$changes;
last;
}
-skip_all("No pending changes (or git status --porcelain doesn't work here)")
- unless $changes;
+if ( $changes ) {
+ my $email = get('email') or die "No email set in git.config";
+ my $name = get('name') or die "No name set in git.config";
+
+ $log = "Author: $name <$email>\n";
+}
+else {
+ diag("No pending changes (or git status --porcelain doesn't work here), checking last commit");
+ $log = qx{git log -n1 2>$devnull};
+ die "git log failed" if $? != 0 || !$log;
+}
sub get {
my $key = shift;
@@ -51,10 +61,9 @@ sub get {
return $value;
}
-my $email = get('email');
-my $name = get('name');
-
open my $fh, '|-', "$^X Porting/checkAUTHORS.pl --tap -"
or die $!;
-print $fh "Author: $name <$email>\n";
+print {$fh} $log;
close $fh or die $!;
+
+1;
--
2.3.2 (Apple Git-55)
|
From @jkeenanOn Mon Sep 14 09:30:31 2015, atoomic@cpan.org wrote:
Speaking as someone who applies a lot of patches from previously unknown authors, I have mixed feelings about this. On the one hand, it's nice when the (presumably first-time) submitter has added name and email address, correctly formatted, to AUTHORS. On the other hand, that's one more thing that the first-time submitter has to get right -- and I'm reluctant to impose that burden on first-timers. Input from other p5pers who often commit first-timer's patches is requested. Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @atoomicWe could fail with a better message like, please add $name $email to the AUTHOR file On Mon Sep 14 17:00:03 2015, jkeenan wrote:
|
From @khwilliamsonOn 09/14/2015 06:00 PM, James E Keenan via RT wrote:
I have mixed feelings about this. I agree it is an internal bookkeeping |
From @tonycozOn Mon Sep 14 09:30:31 2015, atoomic@cpan.org wrote:
Isn't the check against the head commit (and every other commit) already done by t/porting/authors.t ? Tony |
From @iabynOn Mon, Sep 14, 2015 at 09:30:31AM -0700, Nicolas R. wrote:
More generally, I wonder whether we should still maintain an AUTHORS file? In terms of Kudos, each release announcement contains a list of the It would remove a whole load of extra makework. -- |
From @atoomicIndeed did not realized that t/porting/authors.t was already covering this check also agreed about the burden to maintain the AUTHOR file, as git is going to give that information easily On Mon Sep 14 21:56:42 2015, tonyc wrote:
|
From @tonycozOn Tue Sep 15 05:25:27 2015, davem wrote:
The main issue would be authors from pre-git - not everyone in AUTHORS is visible in git log. Tony |
From @iabynOn Tue, Sep 15, 2015 at 08:39:52PM -0700, Tony Cook via RT wrote:
In which case AUTHORS could be re-purposed as a static list of older -- |
From @jkeenanOn Tue Sep 15 08:23:42 2015, atoomic wrote:
Since the original poster has indicated that the patch is not needed, and since no one else has spoken up for applying it, I'm closing this ticket. I would like to recommend that further discussion about the existence/maintenance of the AUTHORS file take place on the p5p list, as there are likely to be a wide range of opinions. Thank you very much. -- |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#126057 (status was 'rejected')
Searchable as RT126057$
The text was updated successfully, but these errors were encountered: