git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Smelkov <kirr@landau.phys.spbu.ru>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Axel Bonnet" <axel.bonnet@ensimag.imag.fr>,
	"Clément Poulain" <clement.poulain@ensimag.imag.fr>,
	"Diane Gasselin" <diane.gasselin@ensimag.imag.fr>,
	"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Jeff King" <peff@peff.net>,
	"Kirill Smelkov" <kirr@landau.phys.spbu.ru>
Subject: [BUG, PATCH v3 0/3] Fix {blame,cat-file} --textconv for cases with symlinks
Date: Fri, 24 Sep 2010 22:24:07 +0400	[thread overview]
Message-ID: <cover.1285351816.git.kirr@landau.phys.spbu.ru> (raw)

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(-)

-- 
1.7.3.rc2

             reply	other threads:[~2010-09-24 18:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 18:24 Kirill Smelkov [this message]
2010-09-24 18:24 ` [PATCH v3 1/3] tests: Prepare --textconv tests for correctly-failing conversion program Kirill Smelkov
2010-09-27 18:23   ` Junio C Hamano
2010-09-28 12:07     ` Kirill Smelkov
2010-09-28 12:20       ` Kirill Smelkov
2010-09-28 12:41         ` Kirill Smelkov
2010-09-28 13:23       ` Jeff King
2010-09-28 14:35         ` Kirill Smelkov
2010-09-28 14:39           ` Jeff King
2010-09-28 15:09             ` Kirill Smelkov
2010-09-28 15:36       ` Junio C Hamano
2010-09-28 15:58         ` Jeff King
2010-09-28 16:12           ` Kirill Smelkov
2010-09-29 11:44             ` Kirill Smelkov
2010-09-24 18:24 ` [PATCH v3 2/3] blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks Kirill Smelkov
2010-09-27 18:27   ` Junio C Hamano
2010-09-28 12:07     ` Kirill Smelkov
2010-09-24 18:24 ` [PATCH v3 3/3] blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664'' Kirill Smelkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1285351816.git.kirr@landau.phys.spbu.ru \
    --to=kirr@landau.phys.spbu.ru \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=axel.bonnet@ensimag.imag.fr \
    --cc=clement.poulain@ensimag.imag.fr \
    --cc=diane.gasselin@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).