Skip to content

Instantly share code, notes, and snippets.

@tsvayer
Created May 26, 2014 15:34
Show Gist options
  • Select an option

  • Save tsvayer/6bb0f361803c8b434eeb to your computer and use it in GitHub Desktop.

Select an option

Save tsvayer/6bb0f361803c8b434eeb to your computer and use it in GitHub Desktop.
limit file size on windows hg commit
[hooks]
precommit.bigfile = hg diff | powershell -c "$input |?{$_.StartsWith('diff')}| %{$_.Split(' ')[3]}| %{if((gi $_).length -ge 1000000){ write-host $_ ":" (gi $_).length "bytes, must be less than 1Mb"; exit 1;}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment