Skip to content

Conversation

@avar
Copy link

@avar avar commented Jun 12, 2017

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.

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 avar force-pushed the turn-off-log-decorate branch from 7f9d58d to 6d43746 Compare June 12, 2017 09:01
@avar
Copy link
Author

avar commented Jun 12, 2017

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.

@dscho
Copy link

dscho commented May 2, 2018

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.

tsibley added a commit to tsibley/git-tbdiff that referenced this pull request Aug 2, 2018
Merges trast#8 after incorporating
@dscho's comment explaining the abbreviation change.
@tsibley
Copy link

tsibley commented Aug 2, 2018

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

Thanks for the patches!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants