]> Dogcows Code - chaz/git-codeowners/commitdiff
Version 0.43
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Wed, 13 Nov 2019 17:13:05 +0000 (10:13 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Wed, 13 Nov 2019 17:13:05 +0000 (10:13 -0700)
19 files changed:
Changes
META.json
META.yml
Makefile.PL
README
bin/git-codeowners
lib/App/Codeowners.pm
lib/App/Codeowners/Formatter.pm
lib/App/Codeowners/Formatter/CSV.pm
lib/App/Codeowners/Formatter/JSON.pm
lib/App/Codeowners/Formatter/String.pm
lib/App/Codeowners/Formatter/TSV.pm
lib/App/Codeowners/Formatter/Table.pm
lib/App/Codeowners/Formatter/YAML.pm
lib/App/Codeowners/Options.pm
lib/App/Codeowners/Util.pm
lib/File/Codeowners.pm
lib/Test/File/Codeowners.pm
t/app-codeowners.t

diff --git a/Changes b/Changes
index 9b62078085faaa4479e9bde90132dd8c21a2311e..9b06826312d16084a1c9e3a0cff42273a80096db 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for App-Codeowners.
 
+0.43      2019-11-13 10:12:01-07:00 MST7MDT
+  * Fix "create" and "update" commands... to actually work.
+
 0.42      2019-11-12 21:52:12-07:00 MST7MDT
   * Add "projects" command to list defined projects.
   * Add flags to filter matches with the "show" command.
index cf36b2ded0e83799923f5ee517c07e63512d081b..0e9f30f4f57640bd14cb214381e615323b9f5adf 100644 (file)
--- a/META.json
+++ b/META.json
    "provides" : {
       "App::Codeowners" : {
          "file" : "lib/App/Codeowners.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter" : {
          "file" : "lib/App/Codeowners/Formatter.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::CSV" : {
          "file" : "lib/App/Codeowners/Formatter/CSV.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::JSON" : {
          "file" : "lib/App/Codeowners/Formatter/JSON.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::String" : {
          "file" : "lib/App/Codeowners/Formatter/String.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::TSV" : {
          "file" : "lib/App/Codeowners/Formatter/TSV.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::Table" : {
          "file" : "lib/App/Codeowners/Formatter/Table.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Formatter::YAML" : {
          "file" : "lib/App/Codeowners/Formatter/YAML.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Options" : {
          "file" : "lib/App/Codeowners/Options.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Util" : {
          "file" : "lib/App/Codeowners/Util.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "App::Codeowners::Util::Process" : {
          "file" : "lib/App/Codeowners/Util.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "File::Codeowners" : {
          "file" : "lib/File/Codeowners.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       },
       "Test::File::Codeowners" : {
          "file" : "lib/Test/File/Codeowners.pm",
-         "version" : "0.42"
+         "version" : "0.43"
       }
    },
    "release_status" : "stable",
          "web" : "https://github.com/chazmcgarvey/git-codeowners"
       }
    },
-   "version" : "0.42",
+   "version" : "0.43",
    "x_authority" : "cpan:CCM",
    "x_generated_by_perl" : "v5.28.0",
    "x_serialization_backend" : "Cpanel::JSON::XS version 4.15"
index 838d5888c8b168e444c031c3efa9792635130352..b30a2a4982b4dd331ff5ed5bc91c71239c022e8b 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -31,43 +31,43 @@ no_index:
 provides:
   App::Codeowners:
     file: lib/App/Codeowners.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter:
     file: lib/App/Codeowners/Formatter.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::CSV:
     file: lib/App/Codeowners/Formatter/CSV.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::JSON:
     file: lib/App/Codeowners/Formatter/JSON.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::String:
     file: lib/App/Codeowners/Formatter/String.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::TSV:
     file: lib/App/Codeowners/Formatter/TSV.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::Table:
     file: lib/App/Codeowners/Formatter/Table.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Formatter::YAML:
     file: lib/App/Codeowners/Formatter/YAML.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Options:
     file: lib/App/Codeowners/Options.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Util:
     file: lib/App/Codeowners/Util.pm
-    version: '0.42'
+    version: '0.43'
   App::Codeowners::Util::Process:
     file: lib/App/Codeowners/Util.pm
-    version: '0.42'
+    version: '0.43'
   File::Codeowners:
     file: lib/File/Codeowners.pm
-    version: '0.42'
+    version: '0.43'
   Test::File::Codeowners:
     file: lib/Test/File/Codeowners.pm
-    version: '0.42'
+    version: '0.43'
 recommends:
   Term::Detect::Software: '0'
   Unicode::GCString: '0'
@@ -93,7 +93,7 @@ resources:
   bugtracker: https://github.com/chazmcgarvey/git-codeowners/issues
   homepage: https://github.com/chazmcgarvey/git-codeowners
   repository: https://github.com/chazmcgarvey/git-codeowners.git
-version: '0.42'
+version: '0.43'
 x_authority: cpan:CCM
 x_generated_by_perl: v5.28.0
 x_serialization_backend: 'YAML::Tiny version 1.73'
index db4c282b449cadba8a9363eb80d3bc17b3b7cdc2..09f972bf614f21dda9b98021f128e2c3c4239921 100644 (file)
@@ -48,7 +48,7 @@ my %WriteMakefileArgs = (
     "Test::Exit" => 0,
     "Test::More" => 0
   },
-  "VERSION" => "0.42",
+  "VERSION" => "0.43",
   "test" => {
     "TESTS" => "t/*.t"
   }
diff --git a/README b/README
index 98bbc5b1692973b64e2f6f65a76fc27138632b22..6a6d906ef1cf727cbaa738539d2e3954c858e0bc 100644 (file)
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ NAME
 
 VERSION
 
-    version 0.42
+    version 0.43
 
 SYNOPSIS
 
index 2c680eb0ff91183dfb1358f1cb368da94ded5a2f..4436ef7e8b60a47bb2c04154d2503b642bc02475 100755 (executable)
@@ -10,7 +10,7 @@ use strict;
 
 use App::Codeowners;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 App::Codeowners->main(@ARGV);
 
@@ -26,7 +26,7 @@ git-codeowners - A tool for managing CODEOWNERS files
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 SYNOPSIS
 
index e70a109cf57ba499517201d4f949663407c555b8..291660a5609496aaaaf3014e5791b328adca72bd 100644 (file)
@@ -14,7 +14,7 @@ use Encode qw(encode);
 use File::Codeowners;
 use Path::Tiny;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 
 sub main {
@@ -194,11 +194,10 @@ END
 
     if ($repopath) {
         # if there is a repo we can try to update the list of unowned files
-        my $git_files = git_ls_files($repopath);
-        if (@$git_files) {
-            $codeowners->clear_unowned;
-            $codeowners->add_unowned(grep { !$codeowners->match($_) } @$git_files);
-        }
+        my ($proc, @filepaths) = git_ls_files($repopath);
+        $proc->wait and exit 1;
+        $codeowners->clear_unowned;
+        $codeowners->add_unowned(grep { !$codeowners->match($_) } @filepaths);
     }
 
     $codeowners->write_to_filepath($path);
@@ -219,7 +218,7 @@ App::Codeowners - A tool for managing CODEOWNERS files
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 METHODS
 
index 095a6efa293b23a79c921a1c335822be8fe359a3..d9e6132052749399f09009553ff75a539853ced4 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use Module::Load;
 
@@ -120,7 +120,7 @@ App::Codeowners::Formatter - Base class for formatting codeowners output
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 SYNOPSIS
 
index a60dc94e6e37830f304529f1187969bd70150d0b..331fec19653b6162bc667cd524afef95d5ba5fa4 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::CSV;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
@@ -63,7 +63,7 @@ App::Codeowners::Formatter::CSV - Format codeowners output as comma-separated va
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index 2ead10c728a2a98c303bd2fce481ae55e4694071..feb023695b8028d4b0693250fe60ad418937040b 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::JSON;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
@@ -42,7 +42,7 @@ App::Codeowners::Formatter::JSON - Format codeowners output as JSON
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index 334233132d8a0375a2ae9c0f10e9416638c91831..6303fb5f428c0eb8df74db6b6d438c21fe69acfa 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::String;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
@@ -136,7 +136,7 @@ App::Codeowners::Formatter::String - Format codeowners output using printf-like
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index b2f22bd8882d616b28d7c3022372282136d37388..4322aaf919bf45d86009643fc770f223a6896a54 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::TSV;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter::CSV';
 
@@ -25,7 +25,7 @@ App::Codeowners::Formatter::TSV - Format codeowners output as tab-separated valu
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index df9bf397435ee41abe59dec6bf3f76b74875f5b7..f6c813c476afe5dbc0685e8d382b4c46c5043195 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::Table;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
@@ -40,7 +40,7 @@ App::Codeowners::Formatter::Table - Format codeowners output as a table
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index 00b4d1e54534261e3b59e00e1bb14fdac4aa64e3..991929014b08670d569e11d424d7561c499b28c1 100644 (file)
@@ -5,7 +5,7 @@ package App::Codeowners::Formatter::YAML;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
@@ -36,7 +36,7 @@ App::Codeowners::Formatter::YAML - Format codeowners output as YAML
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index 1bd3c0f533e4e8d05e29412fdf72d2fb5a13f177..fcc2eae1be3f2db540a87e4765526d12f83c12e0 100644 (file)
@@ -8,7 +8,7 @@ use Getopt::Long 2.39 ();
 use Path::Tiny;
 use Pod::Usage;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 sub early_options {
     return {
@@ -278,7 +278,7 @@ App::Codeowners::Options - Getopt and shell completion for App::Codeowners
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 METHODS
 
index 762f040e0a21153c49f32ed809b4d64a2bf238aa..dbf55132952d43a61a53f098cc0727c6d40e11a5 100644 (file)
@@ -23,7 +23,7 @@ our @EXPORT_OK = qw(
     zip
 );
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 
 sub find_nearest_codeowners {
@@ -280,7 +280,7 @@ App::Codeowners::Util - Grab bag of utility subs for Codeowners modules
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 DESCRIPTION
 
index e7b23deebded4c7e6bbe5a8e98f0624db98d837f..bdaf64c18c31a2a40bb128605c574ab44acbaaf2 100644 (file)
@@ -10,7 +10,7 @@ use Path::Tiny;
 use Scalar::Util qw(openhandle);
 use Text::Gitignore qw(build_gitignore_matcher);
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 sub _croak { require Carp; Carp::croak(@_); }
 sub _usage { _croak("Usage: @_\n") }
@@ -354,7 +354,7 @@ File::Codeowners - Read and write CODEOWNERS files
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 METHODS
 
index a166e71f21f7be9f58059f50aa80e978b9b73a04..532ec288a394ae06dd6fed0f3342d734edc171cc 100644 (file)
@@ -10,7 +10,7 @@ use Encode qw(encode);
 use File::Codeowners;
 use Test::Builder;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.43'; # VERSION
 
 my $Test = Test::Builder->new;
 
@@ -88,7 +88,7 @@ Test::File::Codeowners - Write tests for CODEOWNERS files
 
 =head1 VERSION
 
-version 0.42
+version 0.43
 
 =head1 SYNOPSIS
 
index 28309d3861ca0b802cf938133128494302850377..5ec78cb8e9b37295e94b231ea38f4e862cb80b68 100644 (file)
@@ -72,6 +72,25 @@ END
     };
 };
 
+subtest 'create' => sub {
+    plan skip_all => 'Cannot run git' if !$can_git;
+
+    my $repodir = _setup_git_repo();
+    my $chdir   = pushd($repodir);
+
+    my $codeowners_filepath = path('CODEOWNERS');
+    $codeowners_filepath->remove;
+
+    my ($stdout, $stderr, $exit) = run { App::Codeowners->main(qw{create}) };
+    is($exit, 0, 'exited without error');
+    is($stderr, "Wrote CODEOWNERS\n", 'reportedly wrote a CODEOWNERS file');
+
+    ok($codeowners_filepath->is_file, 'did write CODEOWNERS file');
+
+    my $contents = $codeowners_filepath->slurp_utf8;
+    like($contents, qr/^# This file shows mappings/, 'correct contents of file') or diag $contents;
+};
+
 done_testing;
 exit;
 
This page took 0.042235 seconds and 4 git commands to generate.