Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off log.decorate when parsing log output #8

Open
wants to merge 1 commit into
base: master
from

Conversation

@avar
Copy link

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 avar:turn-off-log-decorate branch from 7f9d58d to 6d43746 Jun 12, 2017
@avar

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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
Projects
None yet
3 participants
You can’t perform that action at this time.