tbdiff
tbdiff copied to clipboard
Turn off log.decorate when parsing log output
Given lines like:
commit 0245492ee0
commit 5b0af9d6f8 (sahildua/add-copy-branch-feature)
This code would error out with:
Traceback (most recent call last):
File "/home/avar/bin/git-tbdiff", line 400, in <module>
sA, dA = read_patches(rangeA)
File "/home/avar/bin/git-tbdiff", line 92, in read_patches
_, sha1 = line.strip().split()
ValueError: too many values to unpack
Fix that by turning off decorate for the log invocation, and while I'm at it turn off commit abbreviation which isn't needed here either.
I see after opening this that this is a dupe of #7, but the description here is more detailed & this fixes another bug, so it makes sense to merge this one & close the other one unmerged.
while I'm at it turn off commit abbreviation which isn't needed here either.
I think this merits a bit more explanation. How about this?
The abbreviation is *not* used for the `commit <commit-name>` lines
anyway, but only for the `index` lines, which are *ignored* by tbdiff.
And as abbreviation does not necessarily come cheap (see e.g.
https://github.com/gitster/git/commits/ds/find-unique-abbrev-optim),
let's just avoid the unnecessary churn.
I've merged this PR into my fork: https://github.com/tsibley/git-tbdiff
Thanks for the patches!