Commit 18a79d8
committed
feat(blame): Support custom
The `git blame` CLI offers a repeated `-C` option that can be used to detect
lines that move within/between files. While a slower operation, it yields more
accurate authorship reports.
https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt
While GitPython does enable passing custom kwargs to the command line `git`
invocation, the fact that kwargs is a dictionary (i.e. no duplicate keys) means
that there was no way to request the `-C` option in `git blame` more than once.
This commit adds an optional `rev_opts` parameter to the `blame` method which
accepts a list of strings to propagate to the CLI invocation of `git blame`. By
using a `List[str]` for `rev_opts`, users of GitPython can pass now the `-C`
option multiple times to get more detailed authorship reports from `git blame`.rev_opts for blame1 parent 73bde1f commit 18a79d8Copy full SHA for 18a79d8
3 files changed
+16-3Lines changed: 16 additions & 3 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- git/repo
- test
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
49 | 49 | |
50 | 50 | |
51 | 51 | |
| 52 | + |
52 | 53 | |
Collapse file
+8-3Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
950 | 950 | |
951 | 951 | |
952 | 952 | |
953 | | - |
| 953 | + |
| 954 | + |
| 955 | + |
| 956 | + |
| 957 | + |
| 958 | + |
954 | 959 | |
955 | 960 | |
956 | 961 | |
| ||
962 | 967 | |
963 | 968 | |
964 | 969 | |
965 | | - |
966 | | - |
| 970 | + |
| 971 | + |
967 | 972 | |
968 | 973 | |
969 | 974 | |
|
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
553 | 553 | |
554 | 554 | |
555 | 555 | |
| 556 | + |
| 557 | + |
| 558 | + |
| 559 | + |
| 560 | + |
| 561 | + |
| 562 | + |
556 | 563 | |
557 | 564 | |
558 | 565 | |
|
0 commit comments