tbdiff icon indicating copy to clipboard operation
tbdiff copied to clipboard

Turn off log.decorate when parsing log output

Open avar opened this issue 7 years ago • 3 comments

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.

avar avatar Jun 12 '17 09:06 avar

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.

avar avatar Jun 12 '17 09:06 avar

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.

dscho avatar May 02 '18 08:05 dscho

I've merged this PR into my fork: https://github.com/tsibley/git-tbdiff

Thanks for the patches!

tsibley avatar Aug 02 '18 22:08 tsibley