News for hackers. Stuff that matters.
Re:I'm going to slowly move on from Mercurial by polpo on Monday January 25, 2016 @02:56PM (#10969510)
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.
Re:I'm going to slowly move on from Mercurial by tzs on Monday January 25, 2016 @03:25PM (#10969682)
Suppose 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".

Re:I'm going to slowly move on from Mercurial by alblue on Monday January 25, 2016 @03:37PM (#10969760)
That'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.
Re:I'm going to slowly move on from Mercurial by k__ on Monday January 25, 2016 @03:30PM (#10969725)
Deletions feel a bit odd.

I mostly use "git add -p" and it misses new files, which doesn't feel right either :\