I create a preferred content expression for a host by running git annex wanted . <some expression>
for a test. Now I want to clear this completely. However, if I manually delete the preferred-content.log
, every time I do a git annex add
it pops back up.
How can I just delete this completely so it stays deleted? One of the reasons I want to clear this is since git annex sync
behavior is changing to start doing sync --content
by default. I know that having it as standard should be effectively the same, but there's gotta be a way to completely undo it.
The automatic union merging done to the git-annex branch does not allow deleting files from it without heroic measures. Anyway, the current content of the config file remains stored in the git history even if it gets deleted.
Just set it to "anything". That, not "standard" is the actual default.
I tried setting it to
anything
, I still get the warninggit-annex sync will change default behavior in the future to send content to repositories that have preferred content configured. If you do not want this to send any content, use --no-content (or -g) to prepare for that change.
. My guess is that this means that git annex will start trying to sync content in the future (and see that there's nothing to do). I'd prefer having it not try to sync content at all. (I do know that setting annex.synccontent to true does exactly that)One thing is that I'm a git afficionado, and I DID go through some heroic measures and I'm VERY surprised that this is still happening and can't understand it. I even tried squashing all the commits in the git-annex branch into one, and git-annex STILL somehow managed to bring the preferred-content.log back.
I can share a script to show what I did if that helps. I'm mostly just looking to understand how this is possible since I just can't figure it out.
Ah, you're right that this future change in
git-annex sync
behavior is one way that "anything" is different from not configured.It turns out that you can just use
git-annex wanted here ""
to get back the same behavior as the preferred content being unset. I had forgotten about that, and it was not really documented anywhere, which I've corrected.Running
git-annex sync
without --content with preferred content set to "" currently warns about the transition, but that warning is false. I'm fixing it to not warn in this case.As to the heroic measures, .git/annex/index gets merged into whatever is in the git-annex branch, so you need to delete that file as well as rewriting the branch. And you need to do this in every single repository that has received the unwanted change. And since it also auto-merges git-annex branches from remotes, you probably will want to temporarily remove the remote tracking branches from git's ref list.
Thanks, Joey. That seems to work based on my testing. Appreciate the quick and precise response!
Fixing my actual repo will have to wait since one of my nodes is now offline, but hopefully that goes off without a glitch.
Also just want to say how awesome git annex is. I've been using it for nearly 10 years now and don't see myself ever wanting to stop.