adjust --hide-missing

* At long last there's a way to hide annexed files whose content
  is missing from the working tree: git-annex adjust --hide-missing
* When already in an adjusted branch, running git-annex adjust
  again will update the branch as needed. This is mostly
  useful with --hide-missing to hide/unhide files after their content
  has been dropped or received.

Still needs integration with sync and the assistant, and not as fast as it
could be, but already usable.

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2018-10-18 15:32:42 -04:00
parent a6c8de84b6
commit 24838547e2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 148 additions and 23 deletions

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="joey"
subject="""comment 5"""
date="2018-10-18T18:59:54Z"
content="""
Good news everyone! `git annex adjust --hide-missing` sets up a branch
where only files with content available are included. And once in such a
branch, `git annex sync` updates it as necessary to reflect changes in
content availability.
"""]]

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="joey"
subject="""comment 5"""
date="2018-10-18T18:59:54Z"
content="""
Good news everyone! `git annex adjust --hide-missing` sets up a branch
where only files with content available are included. And once in such a
branch, `git annex sync` updates it as necessary to reflect changes in
content availability.
"""]]

View file

@ -4,7 +4,7 @@ git-annex adjust - enter an adjusted branch
# SYNOPSIS
git annex adjust `--unlock|--fix`
git annex adjust `--unlock|--fix|--hide-missing [--unlock|--fix]`
# DESCRIPTION
@ -20,9 +20,14 @@ While in the adjusted branch, you can use git-annex and git commands as
usual. Any commits that you make will initially only be made to the
adjusted branch.
To propagate changes from the adjusted branch back to the original branch,
To propagate commits from the adjusted branch back to the original branch,
and to other repositories, as well as to merge in changes from other
repositories, use `git annex sync`.
repositories, run `git annex sync`.
Re-running this command with the same options
while inside the adjusted branch will update the adjusted branch
as necessary (eg for `--hide-missing`), and will also propagate commits
back to the original branch.
This command can only be used in a v6 git-annex repository.
@ -40,6 +45,22 @@ This command can only be used in a v6 git-annex repository.
unusual way that prevents the symlinks committed to git from pointing at
the annex objects.
* `--hide-missing`
Only include annexed files in the adjusted branch when their content
is present.
The adjusted branch is not immediately changed when content availability
changes, so if you `git annex drop` files, they will become broken
links in the usual way. And when files that were missing are copied into the
repository from elsewhere, they won't immediatly become visible in the
branch.
To update the adjusted branch to reflect changes to content availability,
run `git annex adjust --hide-missing` again.
This option can be combined with --unlock or --fix.
# SEE ALSO
[[git-annex]](1)

View file

@ -0,0 +1,25 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2018-10-18T19:27:43Z"
content="""
I implemented `git annex adjust --hide-missing`.
It can be run after any change to content availability to update
the adjusted branch, hiding or unhiding files.
My implementation is not as fast as it could be; each update
is a linear scan of the whole original branch and rebuild of the adjusted
branch. But it all works so we'll defer speeding this up to later bug
reports about it being too slow. ;)
What still needs to be done:
* `git annex sync --content` needs to scan the original branch, not the
adjusted branch, to find files to transfer.
* `git annex sync` needs to update the adjusted branch.
* The assistant also needs to scan the original branch when looking for
files to download.
* The assistant ought to update the adjusted branch at some point after
downloads, but it's not clear when. Perhaps this will need to be deferred
until it can be done more cheaply, so it can do it after every file.
"""]]