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

PostScript files: textconv and "git add -p"

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jan 4, 2011, 15:50 UTC
Message-ID
<vpqy670brcb.fsf@bauges.imag.fr>
Hi (and happy new year everybody !),

I have trouble setting up a comfortable configuration to version PostScript files. The particularity they have is that they are "text files" (i.e. git does not detect them as binary files by default, and neither do tools like less, diff, ...), but not meant to be human-readable.

If I do this:
,----[ .gitattributes ]
| *.ps diff=ps
`----
,----[ .gitconfig ]
| [diff "ps"]
|       textconv=ps2ascii
`----

then I get the textconv niceness when running "git diff", which is cool, but "git add -p" still proposes me to stage hunks one by one, which isn't.

If I set "*.ps binary" in .gitattributes, "git add -p" becomes quiet, but textconv is disabled.

I want "git diff" to run the textconv filter, and "git add -p" to consider the file as binary. Is there a way to do this?

Thanks,
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Next: Jeff King
Message 1 of 7 in “PostScript files: textconv and "git add -p"”
  1. Matthieu MoyJan 4, 2011
  2. Jeff KingJan 5, 2011
  3. Matthieu MoyJan 9, 2011
  4. docs: explain diff.*.binary optionJeff King, Jan 9, 2011
  5. Matthieu MoyJan 9, 2011
  6. Junio C HamanoJan 10, 2011
  7. Jeff KingJan 11, 2011

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.