Please describe the problem.
I have a repository that is being synced with a normal Bitbucket git repository (with annex-ignore = true
). It's been created with the webapp in direct mode and I'm using the assistant.
Everything is working fine, but after running git annex forget
the git-annex branch in Bitbucket stopped being pushed. git-annex is still working correctly, but I have a lot of useless commits in the history.
So currently I have this branches:
# git branch -a
* annex/direct/master
git-annex
master
synced/master
remotes/bitbucket/git-annex
remotes/bitbucket/master
remotes/bitbucket/synced/git-annex
remotes/bitbucket/synced/master
And remotes/bitbucket/git-annex
isn't being updated with the content of git-annex
What version of git-annex are you using? On what operating system?
5.20150812 and 5.20150731 in Debian Sid and Testing
Please provide any additional information below.
As I've said, git-annex is still working normally, so the solution might be to simply remove that branch.
Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
I use git-annex
daily with 3 repositories with a total of ~112GB, and I'm really happy with it. Thank you very much for the effort.
"You may need to force git to push the branch to any git repositories not running git-annex." -- git-annex-forget man page
I guess bitbucket doesn't accept pushes that replace an existing branch with one with a disconnected history. git push --force should sort it out.
I'm not clear how this is a bug. Is there some change needed in the documentation or perhaps in git-annex sync?
Ok, sorry, must have miss that info.
Couldn't git-annex take care of the
push -f
?What git-annex command?
git-annex sync
should already deal with this, AFAICS. It forces the push to the remote's synced/git-annex branch.Some remote's may have receive.denyNonFastForwards set, which will prevent even a forced push. git-annex sync prints out some hints if this happens.
synced/git-annex
branch is being pushed correctly, it's thegit-annex
branch the one giving trouble.For all git-annex knows, the remote repository may be actively making changes to its own git-annex branch. So, forcing pushes of it could lose data, and are not a good idea, and so not done, whereas synced/git-annex is force pushed.
If git-annex is indeed being run in the remote repository, it will eventually try to merge the newly pushed synced/git-annex with its local git-annex branch, notice the forget operation has started, and automatically handle updating its git-annex branch appropriatly to be a child of the new synced/git-annex branch. At that point, pushes of the git-annex branch will work again.
Since your remote is on a hosting service that doesn't use git-annex, that doesn't happen, and you'll need to force push to get that branch to update. (Although it's somewhat optional to do so; other clients using that remote with git-annex sync will pull down the synced/git-annex branch and keep working fine even if you never force push the git-annex branch.)
Clearly all this is pretty complicated, but I don't see a good way to improve the behavior, unless there's some way to detect that the remote repository is not running git-annex, and so assume it's safe to auto-force-push that branch. I suppose it could check to see if the remote repository has an annex.uuid set, and if not, assume it's not using git-annex. But, if this assumption turns out to be wrong (due to a race, or a problem communicating the annex.uuid, etc), data loss could result.
Maybe a better fix would be to improve the note about this on git-annex forget's man page, and perhaps also make git-annex sync print some helpful message when it detects this situation.