Please describe the problem.
After adding a directory special remote to a git annex repository, the git annex push push-win-remote fails with the following error:
Not updating export to push-win-remote because adjusted/main(unlocked) does not exist. (As configured by remote.push-win-remote.annex-tracking-branch)
The problem does not occur on Linux or macOS.
What steps will reproduce the problem?
mkdir push-win-repo
mkdir push-win-rmt
cd push-win-repo
git init --initial-branch main
git annex init push-win-repository
git annex config --set annex.largefiles include=*.xtx
echo "push test file" >> push-test.xtx
git annex add .
git commit -m "add push test file"
git annex initremote push-win-remote type=directory directory=../push-win-rmt autoenable=true encryption=none exporttree=yes importtree=yes
git config remote.push-win-remote.annex-tracking-branch adjusted/main(unlocked)
git annex group push-win-remote manual
git annex wanted push-win-remote include=*.xtx
git annex push push-win-remote
What version of git-annex are you using? On what operating system?
- git-annex version: 10.20230803-gd467c70ef7
- git version 2.41.0.windows.2
- OS Name: Microsoft Windows 10 Pro
- OS Version: 10.0.19045 N/A Build 19045
Please provide any additional information below.
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
C:\win-push-bug>mkdir push-win-repo
C:\win-push-bug>mkdir push-win-rmt
C:\win-push-bug>cd push-win-repo
C:\win-push-bug\push-win-repo>git init --initial-branch main
Initialized empty Git repository in C:/win-push-bug/push-win-repo/.git/
C:\win-push-bug\push-win-repo>git annex init push-win-repository
init push-win-repository
Detected a filesystem without fifo support.
Disabling ssh connection caching.
Detected a crippled filesystem.
Entering an adjusted branch where files are unlocked as this filesystem does not support locked files.
Switched to branch 'adjusted/main(unlocked)'
ok
(recording state in git...)
C:\win-push-bug\push-win-repo>git annex config --set annex.largefiles include=*.xtx
annex.largefiles include=*.xtx ok
(recording state in git...)
C:\win-push-bug\push-win-repo>echo "push test file" 1>>push-test.xtx
C:\win-push-bug\push-win-repo>git annex add .
add push-test.xtx
ok
(recording state in git...)
C:\win-push-bug\push-win-repo>git commit -m "add push test file"
[adjusted/main(unlocked) f3262a2] add push test file
1 file changed, 1 insertion(+)
create mode 100644 push-test.xtx
C:\win-push-bug\push-win-repo>git annex initremote push-win-remote type=directory directory=../push-win-rmt autoenable=true encryption=none exporttree=yes importtree=yes
initremote push-win-remote ok
(recording state in git...)
C:\win-push-bug\push-win-repo>git config remote.push-win-remote.annex-tracking-branch adjusted/main(unlocked)
C:\win-push-bug\push-win-repo>git annex group push-win-remote manual
group push-win-remote ok
(recording state in git...)
C:\win-push-bug\push-win-repo>git annex wanted push-win-remote include=*.xtx
wanted push-win-remote ok
(recording state in git...)
C:\win-push-bug\push-win-repo>git annex push push-win-remote
Not updating export to push-win-remote because adjusted/main(unlocked) does not exist. (As configured by remote.push-win-remote.annex-tracking-branch)
C:\win-push-bug\push-win-repo>
# End of transcript or log.
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)
Yes. I am developing the easy-git-annex api.
If I put the same file in the remote under the name pull-test.xtx and invoke the command git annex pull push-win-remote, git annex outputs:
list push-win-remote ok
import push-win-remote pull-test.xtx
ok
update refs/remotes/push-win-remote/adjusted/main(unlocked) ok
(recording state in git...)
But the file is not present in the repository.
The same behavior can be observed on linux. I just ran
git annex adjust --unlock
after committing to get into the same state as on Windows.It's actually not supported to set annex-tracking-branch to an adjusted branch. Instead, you ought to set:
When pulling a new file, as in comment #1, that results in the change getting merged into main, and then the adjusted branch is automatically updated as well.
When pushing a newly added file, I first had to run
git-annex adjust --unlock
in order to update main. That was a bug ingit-annex push
; it ought to update main for you in this case; it already does when pushing to a regular git remote. Fixed that.The "Not updating export to push-win-remote because adjusted/main(unlocked) does not exist" message is misleading. I've improved that to be "Not updating export to push-win-remote because tracking branch name is not valid" which at least hints in the right direction.