Skip to content

Fix {blame,cat-file} --textconv for cases with symlinks

Kirill Smelkov git 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 14 repliesIn review
  2. v23 patches 5 repliesSuperseded
  3. v13 patches 16 repliesSuperseded

Changes in v3 from the cover letter

o Slightly changed patches descriptions as per comment by Matthieu, and added Matthieu's Reviewed-by.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tests: Prepare --textconv tests for correctly-failing conversion programt/t4042-diff-textconv-caching.sh t/t8006-blame-textconv.sh t/t8007-cat-file-textconv.sh+27 -2412 replies
2/3blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinkst/t8006-blame-textconv.sh t/t8007-cat-file-textconv.sh+72 -02 replies
3/3blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''builtin.h builtin/blame.c builtin/cat-file.c +3 more+30 -210 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMatthieu MoyJunio C Hamano
1/3R-b Noticed-by
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

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

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

v3:

o Slightly changed patches descriptions as per comment by Matthieu, and added Matthieu's Reviewed-by.

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(-)
Signature · 1 line
1.7.3.rc2