Added a comment: forgot to add the new ignored link + shortcoming of 'ln' command
authornobodyinperson <nobodyinperson@web>
Mon, 20 Nov 2023 10:25:52 +0000 (10:25 +0000)
committeradmin <admin@branchable.com>
Mon, 20 Nov 2023 10:25:52 +0000 (10:25 +0000)
doc/git-annex-uninit/comment_5_3fe7520813dee36ffb5419ed70ea43b5._comment [new file with mode: 0644]

diff --git a/doc/git-annex-uninit/comment_5_3fe7520813dee36ffb5419ed70ea43b5._comment b/doc/git-annex-uninit/comment_5_3fe7520813dee36ffb5419ed70ea43b5._comment
new file mode 100644 (file)
index 0000000..7514aa5
--- /dev/null
@@ -0,0 +1,24 @@
+[[!comment format=mdwn
+ username="nobodyinperson"
+ avatar="http://cdn.libravatar.org/avatar/736a41cd4988ede057bae805d000f4f5"
+ subject="forgot to add the new ignored link + shortcoming of 'ln' command"
+ date="2023-11-20T10:25:52Z"
+ content="""
+You forgot to add your (gitignore'd) `what.foo` to git. Another `git annex add --no-check-gitignore;git commit -m \"add link\"` will make the subsequent `git annex uninit` work properly. This is also what the error message says, btw.
+
+But there's another problem underneath: Why is `what.foo` an annex-style symlink anyway? It should just point to `example.txt`, right?
+
+```
+🐟 ❯ ln -nrs example.txt what.foo
+yann in yann-desktop-nixos in …/uninit-test on  main 
+🐟 ❯ ls -l
+lrwxrwxrwx 186 yann users 20 Nov 11:08  example.txt -> .git/annex/objects/mK/4w/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03.txt/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03.txt
+lrwxrwxrwx 186 yann users 20 Nov 11:08  what.foo -> .git/annex/objects/mK/4w/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03.txt/SHA256E-s6--5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03.txt
+```
+
+For some reason `ln` dereferences `example.txt` before linking, resulting in `what.foo` pointing to the same as `example.txt` -- not just to `example.txt` -- causing `what.foo` to look exactly like an annex link. I thought `-n` could fix this, but it would operate on the target `what.foo`, not the source `example.txt` 🤦. I couldn't make `ln` do this properly, except for renaming/removing `example.txt`, then `ln -rsf example.txt what.foo`, then restoring `example.txt`. Not viable. A better solution is `cp -s example.txt what.foo`. That will make `what.foo` point properly to just `example.txt` and not *its* target.
+
+BTW you can still just `git add` things like normal non-annex symlinks like `what.foo`, no need for `git annex add` here.
+
+Also, joey prefers to have bug reports/questions and the like in either [[todo]], [[bugs]] or [[forum]], because it's clear those are the places to look through for issues. Comments below random manpages are quick to be forgotten about. 🙂
+"""]]