| 1 |
#!/usr/bin/perl |
| 2 |
# PODNAME: annex-to-annex-reinject |
| 3 |
# ABSTRACT: use 'git annex reinject' to redo annex-to-annex |
| 4 |
# |
| 5 |
# Copyright (C) 2019-2020 Sean Whitton |
| 6 |
# |
| 7 |
# This program is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or (at |
| 10 |
# your option) any later version. |
| 11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
# General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
=head1 SYNOPSIS |
| 21 |
|
| 22 |
B<annex-to-annex-reinject> I<SOURCEANNEX> I<DESTANNEX> |
| 23 |
|
| 24 |
=head1 DESCRIPTION |
| 25 |
|
| 26 |
Wrapper around B<git annex reinject --known>, invoked in I<DESTANNEX>, |
| 27 |
on the files in the git-annex objects dir of the I<SOURCEANNEX> |
| 28 |
(usually I<SOURCEANNEX>/.git/annex/objects). After reinjecting files, |
| 29 |
the git-annex branch of I<SOURCEANNEX> is updated so that it does not |
| 30 |
think the content is present there anymore. |
| 31 |
|
| 32 |
Suppose that you use annex-to-annex(1) to migrate files from ~/work to |
| 33 |
~/old on your laptop, where each of ~/work and ~/old are git annexes. |
| 34 |
Then on your USB backup drive, you can use this script to move the |
| 35 |
contents of migrated files from your clone of ~/work to your clone of ~/old: |
| 36 |
|
| 37 |
=over 4 |
| 38 |
|
| 39 |
% annex-to-annex-reinject /media/spwhitton/usb/work /media/spwhitton/usb/old |
| 40 |
|
| 41 |
=back |
| 42 |
|
| 43 |
=head1 OPTIONS |
| 44 |
|
| 45 |
None. |
| 46 |
|
| 47 |
=head1 SEE ALSO |
| 48 |
|
| 49 |
git-annex-reinject(1), annex-to-annex(1), annex-to-annex-dropunused(1) |
| 50 |
|
| 51 |
=cut |
| 52 |
|
| 53 |
use App::annex_to_annex_reinject; |
| 54 |
exit App::annex_to_annex_reinject->main; |