git-annex/ upgrades/ SHA size

Before version 2 of the git-annex repository, files added to the SHA backends did not have their file size tracked, while files added to the WORM backend did. The file size information is used for disk free space checking.

Files added to the SHA backends after the conversion will have their file size tracked automatically. This disk free space checking is an optional feature and since you're more likely to be using more recently added files, you're unlikely to see any bad effect if you do nothing.

That said, if you have old files added to SHA backends that lack file size tracking info, here's how you can add that info. After upgrading to repository version 2, in each repository run:

    git annex migrate
    git commit -m 'migrated keys for v2'

The usual caveats about migrating data to a new backend apply; you will end up with unused keys that you can later clean up with `git annex unused`.

The fact that the keys changed causes merge conflicts

FYI, I have run into a problem where if you 'git annex sync' between various 'git annex v3' repositories, if the different repositories are using different encodings of the SHA1 information (one including size, one not), then the 'git merge' will declare that they conflict.

There's no indication that 'git annex migrate' is the right tool to run, except from perusing the 'git annex' man page. In my opinion this is a major user interface problem.

-- Asheesh.

Comment by https://www.google.com/accounts/o8/id?id=AItOawkjvjLHW9Omza7x1VEzIFQ8Z5honhRB90I — Tue Jul 22 18:11:47 2025
Comments on this page are closed.