[Freeipa-devel] [TIP] Make patches from Git more informative

Petr Viktorin pviktori at redhat.com
Fri Apr 26 13:47:18 UTC 2013


I'm sure you're aware of hunk header lines in patches:
     @@ -24,5 +24,5 @@ class SomeClass(object):

It's possible to configure which source line Git selects for the hunk 
header. By default it uses non-indented lines.
A "python" regexp, which selects functions, classes and methods, is 
already included in Git; you just have to enable it. I also use custom 
regexps for ldifs and API.txt:

$ cat ~/.gitattributes  # (Or .git/info/attributes for project-specific 
*.py diff=python
API.txt diff=apitxt
*.ldif diff=ldif
*.update diff=ldif

$ git config -l  # set with e.g. `git config --global key="value"`
diff.apitxt.xfuncname=^command: .*

Enjoy your Friday!


More information about the Freeipa-devel mailing list