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

Re: [PATCH 1/3] tests: Prepare --textconv tests for correctly-failing conversion program

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 18, 2010, 19:14 UTC
Message-ID
<vpqiq22vp72.fsf@bauges.imag.fr>
In-Reply-To
<26d0544dac2515e76bee0608881cfd8c23bf1ebf.1284830388.git.kirr@landau.phys.spbu.ru>
Kirill Smelkov <kirr@landau.phys.spbu.ru> writes:
> Recently I've spot a bug

We usually avoid the first person in commit messages. The cover letter is a good place to tell about your personal story, but the commit message is what will remain, what people will read after a blame or bisect. They won't care whether you've "recently" found a bug, or in which circumstances you've found it.

I'd write stg like (which would probably go to PATCH 2/3 instead of here):

-----8<---- git blame --textconv is wrongly calling the textconv filter on symlinks: symlinks are stored as blobs whose content is the target of the link, and blame calls the textconv filter on a temporary file filled-in with the content of this blob.

For example:
Show 7 quoted lines
>     $ 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
-----8<----
> So git-blame is wrong here, and I'm going to write problem-demonstration
> tests + try to fix it, but first we have to convert existing textconv
> converter, so it will mimic pdftext behaviour -- if there is no '^bin:'
> in input -- it's not a "binary" file and helper exits with error.

What's interesting here is not that you mimick pdftext behavior, but that you allow to easily distinguish file content and symlink target.

Here's my try:

-----8<---- The textconv filter is sometimes incorrectly ran on a temporary file whose content is the target of a symbolic link, instead of actual file content. Prepare to test this by marking the content of the file to convert with "bin:", and let the helper die if "bin:" is not found in the file content. -----8<----

> No other semantic changes at this stage.
Otherwise, the code looks OK.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Kirill SmelkovNext: Kirill Smelkov
Message 3 of 35 in “Fix {blame,cat-file} --textconv for cases with symlinks”
  1. 0/3 Fix {blame,cat-file} --textconv for cases with symlinksKirill Smelkov, Sep 18, 2010
  2. 1/3 tests: Prepare --textconv tests for correctly-failing conversion programKirill Smelkov, Sep 18, 2010
  3. Matthieu MoySep 18, 2010
  4. 2/3 blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinksKirill Smelkov, Sep 18, 2010
  5. Matthieu MoySep 18, 2010
  6. 3/3 RFC: blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''Kirill Smelkov, Sep 18, 2010
  7. Matthieu MoySep 18, 2010
  8. Jeff KingSep 20, 2010
  9. Kirill SmelkovSep 20, 2010
  10. Matthieu MoySep 20, 2010
  11. Kirill SmelkovSep 21, 2010
  12. sha1_name.c: update comment to mention :/foo syntaxMatthieu Moy, Sep 20, 2010
  13. Junio C HamanoSep 21, 2010
  14. Matthieu MoySep 21, 2010
  15. Junio C HamanoSep 21, 2010
  16. update comment and documentation for :/foo syntaxMatthieu Moy, Sep 24, 2010
  17. Matthieu MoySep 18, 2010
  18. Junio C HamanoSep 18, 2010
  19. Matthieu MoySep 19, 2010
  20. Junio C HamanoSep 19, 2010
  21. Jeff KingSep 20, 2010
  22. Johannes SixtSep 20, 2010
  23. Junio C HamanoSep 21, 2010
  24. Jeff KingSep 21, 2010
  25. Jeff KingSep 21, 2010
  26. 0/2 better userdiff behavior for symlinksJeff King, Sep 21, 2010
  27. 1/2 diff: don't use pathname-based diff drivers for symlinksJeff King, Sep 21, 2010
  28. Matthieu MoySep 22, 2010
  29. Jeff KingSep 22, 2010
  30. 2/2 diff: add a special SYMLINK user-diff driverJeff King, Sep 21, 2010
  31. Ævar Arnfjörð BjarmasonSep 22, 2010
  32. Jeff KingSep 22, 2010
  33. Ævar Arnfjörð BjarmasonSep 22, 2010
  34. Matthieu MoySep 22, 2010
  35. Matthieu MoySep 22, 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.