summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-03-23 11:57:36 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-03-23 11:57:36 -0700
commit84e2d8ba6c274c24912c5ab2d1f3847c8c5c25d0 (patch)
treec087888c9af6c44c3536fbcdbc208552466a24b1
parent51132c73cacd2ad962028bae72a62667f713579a (diff)
parent9c43d14b9e1f670404f8b5b121632edc0bee373e (diff)
downloadp5-Git-Annex-84e2d8ba6c274c24912c5ab2d1f3847c8c5c25d0.tar.gz
Merge tag 'v0.005' into debian
v0.005 # gpg: Signature made Mon 23 Mar 2020 11:57:23 AM MST # gpg: using RSA key 9B917007AE030E36E4FC248B695B7AE4BF066240 # gpg: issuer "spwhitton@spwhitton.name" # gpg: Good signature from "Sean Whitton <spwhitton@spwhitton.name>" [ultimate] # Primary key fingerprint: 8DC2 487E 51AB DD90 B5C4 753F 0F56 D055 3B6D 411B # Subkey fingerprint: 9B91 7007 AE03 0E36 E4FC 248B 695B 7AE4 BF06 6240
-rw-r--r--Changes5
-rw-r--r--dist.ini2
-rw-r--r--lib/App/annex_review_unused.pm20
3 files changed, 22 insertions, 5 deletions
diff --git a/Changes b/Changes
index b27b32f..7837fcd 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,11 @@ Revision history for Git::Annex
{{$NEXT}}
+0.005 2020-03-23 11:55:48-07:00 America/Phoenix
+ - annex-review-unused: Add missing prompt_yn subroutine.
+ - annex-review-unused: Always pass --force to 'git annex dropunused'.
+ Previously it couldn't be passed at all, which is much less useful.
+
0.004 2020-03-18 17:08:57-07:00 America/Phoenix
- annex-to-annex-dropunused: Fix attempt to call wrong main()
routine.
diff --git a/dist.ini b/dist.ini
index deb765e..b7d27d0 100644
--- a/dist.ini
+++ b/dist.ini
@@ -4,7 +4,7 @@ license = GPL_3
copyright_holder = Sean Whitton <spwhitton@spwhitton.name>
copyright_year = 2019-2020
-version = 0.004
+version = 0.005
[PkgVersion]
[PodWeaver]
diff --git a/lib/App/annex_review_unused.pm b/lib/App/annex_review_unused.pm
index 2527193..eae6cd0 100644
--- a/lib/App/annex_review_unused.pm
+++ b/lib/App/annex_review_unused.pm
@@ -170,11 +170,10 @@ sub main {
}
if (@to_drop) {
- _say_spaced_bullet("Will dropunused"
- . (exists $dropunused_args{force} ? " with --force:" : ":"));
+ _say_spaced_bullet("Will dropunused with --force:");
say "@to_drop\n";
- $annex->annex->dropunused(\%dropunused_args, @to_drop)
- if prompt_yn("Go ahead with this?");
+ $annex->annex->dropunused(\%dropunused_args, "--force", @to_drop)
+ if _prompt_yn("Go ahead with this?");
}
# exit value represents whether or not there are any unused files left
@@ -192,6 +191,19 @@ sub _say_bullet { _say_bold(" • ", @_) }
sub _say_spaced_bullet { _say_bold("\n", " • ", @_, "\n") }
+sub _prompt_yn {
+ my $prompt = shift;
+ local $| = 1;
+ my $response;
+ while (1) {
+ print colored(['bold'], "$prompt ");
+ chomp(my $response = <STDIN>);
+ return 1 if lc($response) eq "y";
+ return 0 if lc($response) eq "n";
+ say "invalid response";
+ }
+}
+
sub exit { $exit_main = shift // 0; goto EXIT_MAIN }
1;