Skip to content

Instantly share code, notes, and snippets.

@barrbrain
Last active December 19, 2015 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barrbrain/5931547 to your computer and use it in GitHub Desktop.
Save barrbrain/5931547 to your computer and use it in GitHub Desktop.
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