From 1310b2163f0631b96bfaaef1f300190266d7ad3a Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 1 Aug 2017 13:36:07 +0200 Subject: [PATCH] Document how I use .gitattributes to clean git diffs. --- .gitattributes | 11 +++++++++++ README.rst | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..7f909e53 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Usefull with: +# +# cat < ~/.local/bin/podiff +# #!/bin/sh +# grep -v '^#:' "$1" +# EOF +# chmod a+x ~/.local/bin/podiff +# git config diff.podiff.textconv podiff + +*.po diff=podiff +*.pot diff=podiff diff --git a/README.rst b/README.rst index 319a6003..aba340a2 100644 --- a/README.rst +++ b/README.rst @@ -190,6 +190,26 @@ became the official french Python documentation translation thanks to `PEP 545 `_. +Simplify git diffs +------------------ + +Git diffs are often crowded with useless line number changes, like: + + -#: ../Doc/library/signal.rst:406 + +#: ../Doc/library/signal.rst:408 + +To tell git they are not usefull information, you can do the following +after ensuring ``~/.local/bin/`` is in your ``PATH``. + + cat < ~/.local/bin/podiff + #!/bin/sh + grep -v '^#:' "$1" + EOF + + chmod a+x ~/.local/bin/podiff + + git config diff.podiff.textconv podiff + Maintenance -----------