diff options
author | June McEnroe <june@causal.agency> | 2021-09-08 21:58:07 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-09-08 21:59:30 -0400 |
commit | a237a866bba3b7c4618ccef1347c0c01009e66f3 (patch) | |
tree | e853a9b6499977e3ebfc71d24617aeda2fa0e1f3 /bin/git-comment.pl | |
parent | Add repeat and all options to git-comment (diff) | |
download | src-a237a866bba3b7c4618ccef1347c0c01009e66f3.tar.gz src-a237a866bba3b7c4618ccef1347c0c01009e66f3.zip |
Document and install git-comment
Diffstat (limited to 'bin/git-comment.pl')
-rw-r--r-- | bin/git-comment.pl | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bin/git-comment.pl b/bin/git-comment.pl index 42ff9143..d4058804 100644 --- a/bin/git-comment.pl +++ b/bin/git-comment.pl @@ -1,6 +1,20 @@ #!/usr/bin/env perl +# Copyright (C) 2021 June McEnroe <june@causal.agency> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. -# FIXME? +# MacPorts is strange. use lib (split(/:/, $ENV{GITPERLLIB} || '/opt/local/share/perl5')); use strict; @@ -10,13 +24,10 @@ use Git; my $repo = Git->repository(); -my $all = 0; +my ($all, $minGroup, $minRepeat, $noRepeat) = (0, 2, 20, 0); my $commentStart = $repo->config('comment.start') // "/*"; my $commentLead = $repo->config('comment.lead') // " *"; my $commentEnd = $repo->config('comment.end') // " */"; -my $minGroup = $repo->config('comment.minGroup') // 2; -my $minRepeat = $repo->config('comment.minRepeat') // 20; -my $noRepeat = $repo->config_bool('comment.noRepeat'); GetOptions( 'all' => \$all, 'comment-start=s' => \$commentStart, @@ -56,8 +67,10 @@ while (<$pipe>) { ); $abbrev{$commit} = shift @body; $body{$commit} = \@body; + } elsif (/^summary (.*)/) { $summary{$commit} = $1; + } elsif (/^\t(\s*)(.*)/) { my ($indent, $line) = ($1, $2); unless ($printed) { |