Some users really want to minimize the amount of data they store on the
local system, especially for large checkouts. Let's add two options,
--recent and --force, the former which ignores the recency settings and
the latter which additionally prunes objects which are currently checked
out. We will never prune objects that are unpushed, even with these
options, including stashed objects.
Add tests and documentation for both of these options.
Per PR advice from bk2204, we switch to using printf instead of
echo in the t-prune.go tests of stashed changes.
We also fixup one code comment to match the count of processes
in commands/command_prune.go.
It was impossible to pop a stash with LFS data successfully
after running any lfs prune command before this fix, because
prune would consider stashed data unreferenced.
This fixes#4206
Currently, our default branch in tests is "master". This is the Git
default, but the Git default will likely change in the future, so it
makes sense to update our testsuite to be explicit about the branch
name. We'll ensure this continues by building against older versions of
Git as well as newer versions.
We use "main" for the new branch name, since that's the proposed value
upstream.
This commit was made entirely by automated means using the following
command:
git grep -l master t | xargs sed -i -e 's/master/main/g'
We use package 'tasklog' to print progress messages to the command line
interface, as in the case of 'git-migrate-import(1)' or
'git-lfs-prune(1)'.
This package aims to mimic the style of upstream Git's progress log
lines, which are identical in every way, except for the trailing period
at the end of 'done'.
Git does print this period, but Git LFS does not. Let's make the two
more similar by having LFS print this period, too.