Closed christolis closed 4 months ago
I dont quite get the point of this. Untracked files should NOT be automatically included in commits. Otherwise you can not keep files untracked, which can be on purpose (I do this quite often). @marko-radosavljevic for review please
For reference the -A
option, found in the original code, works like this (source, emphasis mine):
Update the index not only where the working tree has a file matching
but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree. If no
is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
The -u
option in the PR works like this (source, emphasis mine):
Update the index just where it already has an entry matching
. This removes as well as modifies index entries to match the working tree, but adds no new files. If no
is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).
Fixes #1039.
With this pull request, untracked files do not get included in commits handled by the pre-commit hook.
Screenshots