[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



Hello,

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 config)
*.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"`
...
core.attributesfile=~/.gitattributes
diff.apitxt.xfuncname=^command: .*
diff.ldif.xfuncname=^dn:.*


Enjoy your Friday!

--
PetrĀ³


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]