14 Nov 2011
I made a mistake when merging branch last week, I forgot to remove a conflict syntax "<<<<<< HEAD" and push it to remote repository. It breaks other one's development. So stupid to make such mistake.
To avoid making such mistake anymore, I write a git hook .git/hooks/pre-commit to check conflict syntax "<<<<<<" and ">>>>>>"
#!/usr/bin/env ruby `git diff-index --name-status HEAD`.split("\n").each do |status_with_filename| status, filename = status_with_filename.split(/\s+/) next if status ==...