summaryrefslogtreecommitdiff
path: root/bin/annex-to-annex-reinject
blob: b3f5970381b6408793a8f865d64a22014fcf6366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
# PODNAME: annex-to-annex-reinject
# ABSTRACT: use 'git annex reinject' to redo annex-to-annex
#
# Copyright (C) 2019-2020 Sean Whitton
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

=head1 SYNOPSIS

B<annex-to-annex-reinject> I<SOURCEANNEX> I<DESTANNEX>

=head1 DESCRIPTION

Wrapper around B<git annex reinject --known>, invoked in I<DESTANNEX>,
on the files in the git-annex objects dir of the I<SOURCEANNEX>
(usually I<SOURCEANNEX>/.git/annex/objects).  After reinjecting files,
the git-annex branch of I<SOURCEANNEX> is updated so that it does not
think the content is present there anymore.

Suppose that you use annex-to-annex(1) to migrate files from ~/work to
~/old on your laptop, where each of ~/work and ~/old are git annexes.
Then on your USB backup drive, you can use this script to move the
contents of migrated files from your clone of ~/work to your clone of ~/old:

=over 4

    % annex-to-annex-reinject /media/spwhitton/usb/work /media/spwhitton/usb/old

=back

=head1 OPTIONS

None.

=head1 SEE ALSO

git-annex-reinject(1), annex-to-annex(1), annex-to-annex-dropunused(1)

=cut

use App::annex_to_annex_reinject;
exit App::annex_to_annex_reinject->main;