diff options
author | Eric Wong <e@80x24.org> | 2022-11-28 05:32:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-11-28 23:38:58 +0000 |
commit | 37131af8eb12f6b0d715fd291c885cafec8be577 (patch) | |
tree | 814dfa71c702faf1e0367897814a5d75178df768 | |
parent | aa82a5a136595d935705e8c9fbffe362e44b8917 (diff) | |
download | public-inbox-37131af8eb12f6b0d715fd291c885cafec8be577.tar.gz |
We need to be able to get rid of removed branches and tags on the remote. --prune-tags is implied for non-objstore repos, and incompatible with objstore repos.
-rw-r--r-- | Documentation/public-inbox-clone.pod | 7 | ||||
-rw-r--r-- | Documentation/public-inbox-fetch.pod | 6 | ||||
-rw-r--r-- | lib/PublicInbox/LeiMirror.pm | 2 | ||||
-rwxr-xr-x | script/public-inbox-clone | 1 | ||||
-rwxr-xr-x | script/public-inbox-fetch | 1 |
5 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/public-inbox-clone.pod b/Documentation/public-inbox-clone.pod index 9288b175..bcf7dcc1 100644 --- a/Documentation/public-inbox-clone.pod +++ b/Documentation/public-inbox-clone.pod @@ -104,6 +104,13 @@ C<DESTINATION> directory. If only C<--manifest => is specified where C<FILE > is an empty string (C<"">), then C<manifest.js.gz> (C<$DESTINATION/manifest.js.gz>) is the implied value of C<FILE>. +=item -p + +=item --prune + +Pass the C<--prune> and C<--prune-tags> flags to L<git-fetch(1)> +calls on incremental clones. + =item -n =item --dry-run diff --git a/Documentation/public-inbox-fetch.pod b/Documentation/public-inbox-fetch.pod index c78ffc0b..c5e73d38 100644 --- a/Documentation/public-inbox-fetch.pod +++ b/Documentation/public-inbox-fetch.pod @@ -61,6 +61,12 @@ there are no updates: public-inbox-fetch -q --exit-code && public-inbox-index test $? -eq 0 || exit $? +=item -p + +=item --prune + +Pass the C<--prune> and C<--prune-tags> flags to L<git-fetch(1)> calls. + =item -v =item --verbose diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 0e8689ca..2473c74b 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -275,6 +275,7 @@ sub fetch_args ($$) { push @cmd, '-q' if $lei->{opt}->{quiet} || ($lei->{opt}->{jobs} // 1) > 1; push @cmd, '-v' if $lei->{opt}->{verbose}; + push(@cmd, '-p') if $lei->{opt}->{prune}; @cmd; } @@ -527,6 +528,7 @@ sub resume_fetch { } my $cmd = [ @{$self->{-torsocks}}, @git, fetch_args($self->{lei}, $opt), $rn ]; + push @$cmd, '-P' if $self->{lei}->{prune}; # --prune-tags implied start_cmd($self, $cmd, $opt, $fini); } diff --git a/script/public-inbox-clone b/script/public-inbox-clone index 9a22fa21..df9ddd37 100755 --- a/script/public-inbox-clone +++ b/script/public-inbox-clone @@ -24,6 +24,7 @@ options: EOF GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ include|I=s@ exclude=s@ inbox-config=s inbox-version=i objstore=s manifest=s + prune|p dry-run|n jobs|j=i no-torsocks torsocks=s epoch=s)) or die $help; if ($opt->{help}) { print $help; exit }; require PublicInbox::Admin; # loads Config diff --git a/script/public-inbox-fetch b/script/public-inbox-fetch index 4b991a90..6fd15328 100755 --- a/script/public-inbox-fetch +++ b/script/public-inbox-fetch @@ -23,6 +23,7 @@ options: -C DIR chdir to specified directory EOF GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ try-remote|T=s@ + prune|p no-torsocks torsocks=s exit-code)) or die $help; if ($opt->{help}) { print $help; exit }; require PublicInbox::Fetch; # loads Admin |