Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
git hooks to CYA when using hg-git mode with git-remote-hg
#!/bin/sh
test "2" = `grep -e '^--HG--$' -e '^branch : [^ ][^ ]*$' "$1"|wc -l` || {
echo >&2 Missing hg branch specification.
exit 1
}
#!/bin/sh
grep -q '^--HG--$' "$1" || echo '--HG--
branch : '"`git symbolic-ref -q --short HEAD`" >> "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment