Skip to content

Instantly share code, notes, and snippets.

@alikins
Created October 7, 2014 14:02
Show Gist options
  • Save alikins/a0ee9c0316260714d57e to your computer and use it in GitHub Desktop.
Save alikins/a0ee9c0316260714d57e to your computer and use it in GitHub Desktop.
po/pot file attributes for textconf and diff (ie, make git diff on gettext files less useless)
*.pot diff=msgcat
*.po diff=msgcat
# from http://stackoverflow.com/questions/2006351/gettext-po-files-under-version-control/11291001#11291001
# more verbose than my minimal version
[diff "msgcat"]
textconv = msgcat --no-location --no-wrap --sort-output
# these diff defs use po_diff/pot_diff from https://github.com/alikins/gitconfig
# change the 'diff' in .gitattributes to diff=po or diff=pot to use
# convert po files to a less noisy
# # variant for display in git log -p etc
# # note that textconv does not affect
# # git-format-patch output
[diff "po"]
textconv = po_diff
cachetextconv = true
[diff "pot"]
textconv = pot_diff
# the line's it was picking for the "funcname"
# context were kind of terrible for this case, so
# just match a blank line so it's empty
xfuncname = ^$
cachetextconv = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment