Closed langfield closed 1 year ago
If we say, "deleting symlinks means delete the note", then what happens if the user deletes a symlink but makes an edit to the note source???? That is bad.
How about a pre-commit hook that just prints a warning and reverts the deletion of symlinks? You must make changes to the note source in .ki/notes/
if you want to get rid of it or something. The pre-commit hook will prune dangling symlinks.
This will be made obsolete by #157.
The Anki program does not allow you to delete individual cards, you can only delete notes. Possibly we could add a commit-hook that deletes the other links and the target note in
.ki/notes/
if any cards are missing.That seems bad though, anything that deletes files automatically is bad. Instead it could detect when cards are missing and warn the user. There should be a
ki mkcards <guid>
subcommand that regenerates cards. You give it aguid
and it regenerates all missing card symlinks depending on what deck you're current in. Possibly it should take the deck as an argument instead of using the current working directory.So the commit hook would do something like this:
But actually, maybe it is just better to delete the note. Because it is not deleting any old file. It is deleting a file that was committed and then its deletion was also committed. So there's no chance of data loss.