git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG, PATCH v2 0/3] Fix {blame,cat-file} --textconv for cases with symlinks

From
Kirill Smelkov <kirr@landau.phys.spbu.ru>
Date
Sep 20, 2010, 20:39 UTC
Message-ID
<cover.1285013802.git.kirr@landau.phys.spbu.ru>

Recently I've spot a bug in git blame --textconv, which was wrongly calling pdftotext (my *.pdf conversion program) on a symlink.pdf, and I was getting something like

    $ git blame -C -C regular-file.pdf
    Error: May not be a PDF file (continuing anyway)
    Error: PDF file is damaged - attempting to reconstruct xref table...
    Error: Couldn't find trailer dictionary
    Error: Couldn't read xref table
    Warning: program returned non-zero exit code #1
    fatal: unable to read files to diff

That errors come from pdftotext run on symlink.pdf being extracted to /tmp/ with one-line plain-text content pointing to link destination.

Please apply and thanks, Kirill

v2:
 o Incorporated suggestions by Matthieu and Jeff (details in each patch)
Kirill Smelkov (3):
  tests: Prepare --textconv tests for correctly-failing conversion
    program
  blame,cat-file: Demonstrate --textconv is wrongly running converter
    on symlinks
  blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
 builtin.h                        |    2 +-
 builtin/blame.c                  |   33 ++++++++++++++-------
 builtin/cat-file.c               |    2 +-
 sha1_name.c                      |    2 +
 t/t4042-diff-textconv-caching.sh |   25 ++++++++--------
 t/t8006-blame-textconv.sh        |   58 +++++++++++++++++++++++++++++++++----
 t/t8007-cat-file-textconv.sh     |   36 ++++++++++++++++++++---
 7 files changed, 121 insertions(+), 37 deletions(-)
-- 
1.7.3.rc2
Next: Kirill Smelkov
Message 1 of 9 in “Fix {blame,cat-file} --textconv for cases with symlinks”
  1. 0/3 Fix {blame,cat-file} --textconv for cases with symlinksKirill Smelkov, Sep 20, 2010
  2. 1/3 tests: Prepare --textconv tests for correctly-failing conversion programKirill Smelkov, Sep 20, 2010
  3. 2/3 blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinksKirill Smelkov, Sep 20, 2010
  4. Matthieu MoySep 20, 2010
  5. Kirill SmelkovSep 21, 2010
  6. Matthieu MoySep 21, 2010
  7. Jeff KingSep 21, 2010
  8. Kirill SmelkovSep 24, 2010
  9. 3/3 blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''Kirill Smelkov, Sep 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.