3 #=======================================================================
5 # File ID: 8af4d956-f358-11e4-b717-000df06acc56
7 # Get new files from the last month (can be overridden) that haven't got
8 # enough copies in git-annex yet, then optionally execute a fast fsck to
9 # check that the files have enough copies.
11 # Author: Øyvind A. Holm <sunny@sunbase.org>
12 # License: GNU General Public License version 2 or later.
13 #=======================================================================
33 " -n "$progname" -- "$@
")"
34 test "$?" = "0" ||
exit 1
46 --from) opt_from
="$2"; shift 2 ;;
47 --fsck) opt_fsck
=1; shift ;;
48 -h|
--help) opt_help
=1; shift ;;
49 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
50 -r|
--resume) opt_resume
=1; shift ;;
51 -s|
--since) opt_since
="$2"; shift 2 ;;
52 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
53 --version) echo $progname $VERSION; exit 0 ;;
55 *) echo $progname: Internal error
>&2; exit 1 ;;
58 opt_verbose
=$
(($opt_verbose - $opt_quiet))
60 var_disable
=ga-getnew.disable
62 if test "$opt_help" = "1"; then
63 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
66 Get new files from the last month (can be overridden) that haven't got
67 enough copies in git-annex yet, then optionally execute a fast fsck to
68 check that the files have enough copies.
70 Arguments and options after " -- " are delivered to git-allfiles(1)
71 which delivers them further to "git log".
73 Usage: $progname [options] [ -- options_to_git-allfiles ]
78 Get new files from Git remote REMOTE.
80 Execute "ga fsck" after the files are copied.
84 Be more quiet. Can be repeated to increase silence.
86 Don't execute an initial "ga sync", resume an earlier interrupted
88 -s TIMESPAN, --since TIMESPAN
89 Get new files since TIMESPAN, same syntax as --since in "git log".
91 Increase level of verbosity. Can be repeated.
93 Print version information.
95 If the Git option $var_disable is set to a non-empty value in a repo,
96 the repo is skipped. For example:
98 git config $var_disable 1
106 echo ==== $progname: $
*
109 if test -n "$(git config --get $var_disable)"; then
110 echo $progname: $var_disable is
set, skipping repo
114 toplevel
="$(git rev-parse --show-toplevel)"
116 echo $progname: $toplevel: Cannot chdir to top of repo
>&2
120 if test "$opt_resume" != "1"; then
121 # Using backslash before { and } to suppress folding when editing this
125 echo $progname: ga sync \
}\
}\
}
128 if test -n "$opt_from"; then
129 from_str
=" --from=$opt_from"
134 msg git allfiles
--since=$opt_since $
*
135 msg ga get
--auto$from_str
136 git allfiles
--since=$opt_since "$@" |
138 xargs -d \\n
--no-run-if-empty ga get
--auto$from_str
140 if test "$opt_fsck" = "1"; then
141 msg ga fsck
--fast --quiet
142 git allfiles
--since=$opt_since "$@" |
144 xargs -d \\n
--no-run-if-empty ga fsck
--fast --quiet
149 echo $progname: ga sync \
}\
}\
}