News for hackers. Stuff that matters.
Re:Show HN: Git Confirm. Git hook to catch accidentally comm... by delinka on Wednesday August 03, 2016 @04:43PM (#12221346)

  curl ... >> .git/hooks/pre-commit
Append instead
Re:Show HN: Git Confirm. Git hook to catch accidentally comm... by avar on Wednesday August 03, 2016 @06:17PM (#12221986)
That's horrible advice. The existing .git/hooks/pre-commit may not even be a shellscript, you could be appending to a binary file.

Even if it's a shellscript you can't just concatenate shellscripts together and expect them to work as thought you'd run them as two independent shellscripts.

Re:Show HN: Git Confirm. Git hook to catch accidentally comm... by delinka on Wednesday August 03, 2016 @07:36PM (#12222336)
Presumably, one's git hooks are not in danger of being lost to oblivion. If that's the case, neither bit of advice is ideal. If, however, one is careless enough that unix plumbing with obliterate the hook for eternity, then appending at least allows the original to exist some place.