4 ms·
I don't understand why you need this as a hook. In recent versions of git, "git add" on a directory updates the index to match the entire directory, with modifi
by polpo 11y ago
I don't understand why you need this as a hook. In recent versions of git, "git add" on a directory updates the index to match the entire directory, with modifications, additions, and deletions.
- tzs 11y agoSuppose the project looks like this when clean: README.txt src/ include/ doc/ TODO.oo3 In the midst of development, I may end up with files in some of these directories that are not supposed to go into the repository. There may be output files from test runs that I'm keeping around temporarily while I debug, notes (that will be incorporated into commit messages which is why the notes files do not belong in the repository), short-lived alternative versions of some of the source or include files, and so on. I don't want to "git add" on the project directory, or any of the subdirectories other than TODO.oo3 because I don't want to pick up those files. For everywhere except TODO.oo3, "git add -u" is what I (think I) want. It's only with TODO.oo3 that I want "git add" instead of (or in addition to) "git add -u".
- alblue 11y agoThat's what the .gitignore file is for, or if you don't want/need to change that between other users of the repositor, the .git/info/excludes file.
- k__ 11y agoDeletions feel a bit odd. I mostly use "git add -p" and it misses new files, which doesn't feel right either :\