git-annex/doc/bugs/direct_mode_renames.mdwn
Joey Hess 547d7745fb pre-commit: Update direct mode mappings.
Making the pre-commit hook look at git diff-index to find changed direct
mode files and update the mappings works pretty well.

One case where it does not work is when a file is git annex added, and then
git rmed, and then this is committed. That's a no-op commit, so the hook
probably doesn't even run, and it certianly never notices that the file
was deleted, so the mapping will still have the original filename in it.

For this and other reasons, it's important that the mappings still be
treated as possibly inconsistent.

Also, the assistant now allows the pre-commit hook to run when in direct
mode, so the mappings also get updated there.
2013-02-06 12:44:19 -04:00

15 lines
669 B
Markdown

When in direct mode, renaming a file with `git mv` does not update the
direct mode mapping to use the new filename. --[[Joey]]
Consistency checks now prevent anything bad happening when the mapping file
contains old filenames. Still, missing the new filename will prevent that
file working properly in direct mode.
Perhaps the pre-commit hook needs to update the mapping for files that were
deleted or added.
This also affects moves of files when the assistant is being used.
In this case, the assistant updates the mapping to add the new name,
but does not delete the old name from the mapping.
> [[done]]; the pre-commit hook now updates the mappings. --[[Joey]]