threads / bug / 48981

Strange bug with "git log" - pdftotext?

Subject: Strange bug with "git log" - pdftotext?

## tl;dr

4 messages between Jul 30, 2018 and Jul 30, 2018.

replies: 3people: 3as markdown or json

Jeremy Morton· Jul 30, 2018, 12:49 UTC · lore

I'm trying to search my git log history for a particular term - "unobtrusive" - so I run this command:

git log -S unobtrusive --oneline

When I do this, this is displayed and I'm in an interactive less terminal or something:

pdftotext version 4.00
Copyright 1996-2017 Glyph & Cog, LLC
Usage: pdftotext [options] <PDF-file> [<text-file>]
  -f <int>             : first page to convert
  -l <int>             : last page to convert
  -layout              : maintain original physical layout
  -simple              : simple one-column page layout
  -table               : similar to -layout, but optimized for tables
  -lineprinter         : use strict fixed-pitch/height layout
  -raw                 : keep strings in content stream order
  -fixed <number>      : assume fixed-pitch (or tabular) text
  -linespacing <number>: fixed line spacing for LinePrinter mode
  -clip                : separate clipped text
  -nodiag              : discard diagonal text
  -enc <string>        : output text encoding name
  -eol <string>        : output end-of-line convention (unix, dos, or mac)
  -nopgbrk             : don't insert page breaks between pages
  -bom                 : insert a Unicode BOM at the start of the text 
file
  -opw <string>        : owner password (for encrypted files)
  -upw <string>        : user password (for encrypted files)
  -q                   : don't print any messages or errors
  -cfg <string>        : configuration file to use in place of .xpdfrc
  -v                   : print copyright and version info
:

When I hit the down arrow, it scrolls down, repeating this output infinitely until I hit 'q'. What is going on here??

-- 
Best regards,
Jeremy Morton (Jez)
Jeff King· Jul 30, 2018, 15:37 UTC · re: Jeremy Morton · lore

Re: Strange bug with "git log" - pdftotext?

On Mon, Jul 30, 2018 at 01:49:46PM +0100, Jeremy Morton wrote:
Show 10 quoted lines
> I'm trying to search my git log history for a particular term -
> "unobtrusive" - so I run this command:
> 
> git log -S unobtrusive --oneline
> 
> When I do this, this is displayed and I'm in an interactive less terminal or
> something:
> 
> pdftotext version 4.00
> [...]
That's definitely weird.

My guess is that the repository has some .gitattributes set up to diff pdf files in a particular way, and you have some matching config that tries to call pdftotext.

What does:
  git config --list | grep ^diff

say? I'd expect to see an external or textconv option there running pdftotext.

Another option is that your pager is somehow set up to call pdftotext, but that seems much more nonsensical to use the tool there (but try "git var GIT_PAGER" and "git config pager.log" to check).

-Peff
Jeremy Morton· Jul 30, 2018, 15:51 UTC · re: Jeff King · lore

Re: Strange bug with "git log" - pdftotext?

I discovered it was an issue with the version of Git for Windows I was using. Upgraded to the latest version and it works now.

-- 
Best regards,
Jeremy Morton (Jez)

On 30/07/2018 16:37, Jeff King wrote:
> On Mon, Jul 30, 2018 at 01:49:46PM +0100, Jeremy Morton wrote:
>
>> I'm trying to search my git log history for a particular term -
>> "unobtrusive" - so I run this command:
>>
>> git log -S unobtrusive --oneline
>>
>> When I do this, this is displayed and I'm in an interactive less terminal or
>> something:
>>
>> pdftotext version 4.00
>> [...]
>
> That's definitely weird.
>
> My guess is that the repository has some .gitattributes set up to diff
> pdf files in a particular way, and you have some matching config that
> tries to call pdftotext.
>
> What does:
>
>    git config --list | grep ^diff
>
> say? I'd expect to see an external or textconv option there running
> pdftotext.
>
> Another option is that your pager is somehow set up to call pdftotext,
> but that seems much more nonsensical to use the tool there (but try "git
> var GIT_PAGER" and "git config pager.log" to check).
>
> -Peff
>
stefan.naewe@atlas-elektronik.com· Jul 30, 2018, 15:41 UTC · re: Jeremy Morton · lore

Re: Strange bug with "git log" - pdftotext?

Am 30.07.2018 um 14:49 schrieb Jeremy Morton:
Show 33 quoted lines
> I'm trying to search my git log history for a particular term - "unobtrusive" - so I run this command:
> 
> git log -S unobtrusive --oneline
> 
> When I do this, this is displayed and I'm in an interactive less terminal or something:
> 
> pdftotext version 4.00
> Copyright 1996-2017 Glyph & Cog, LLC
> Usage: pdftotext [options] <PDF-file> [<text-file>]
>  -f <int>             : first page to convert
>  -l <int>             : last page to convert
>  -layout              : maintain original physical layout
>  -simple              : simple one-column page layout
>  -table               : similar to -layout, but optimized for tables
>  -lineprinter         : use strict fixed-pitch/height layout
>  -raw                 : keep strings in content stream order
>  -fixed <number>      : assume fixed-pitch (or tabular) text
>  -linespacing <number>: fixed line spacing for LinePrinter mode
>  -clip                : separate clipped text
>  -nodiag              : discard diagonal text
>  -enc <string>        : output text encoding name
>  -eol <string>        : output end-of-line convention (unix, dos, or mac)
>  -nopgbrk             : don't insert page breaks between pages
>  -bom                 : insert a Unicode BOM at the start of the text file
>  -opw <string>        : owner password (for encrypted files)
>  -upw <string>        : user password (for encrypted files)
>  -q                   : don't print any messages or errors
>  -cfg <string>        : configuration file to use in place of .xpdfrc
>  -v                   : print copyright and version info
> :
> 
> When I hit the down arrow, it scrolls down, repeating this output infinitely until I hit 'q'.  What is going on here??
> 
Wild guess: You're using "Git for Windows" on a version less than "2.18.0.windows.1" ?
Try upgrading (at least) to that version. IIRC that's one of the issues it fixes.

HTH Stefan

-- 
----------------------------------------------------------------
/dev/random says: Never underestimate the power of human stupidity.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')" 
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF

← back to recent threads