From: Junio C Hamano Date: Thu, 13 Jan 2011 19:38:05 +0000 (-0800) Subject: Merge branch 'jn/perl-funcname' X-Git-Tag: v1.7.4-rc2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/17e1c9e2fdf684422a91f0b1bc2e0926c1956651?ds=inline;hp=-c Merge branch 'jn/perl-funcname' * jn/perl-funcname: userdiff/perl: catch BEGIN/END/... and POD as headers diff: funcname and word patterns for perl --- 17e1c9e2fdf684422a91f0b1bc2e0926c1956651 diff --combined Documentation/gitattributes.txt index a282adb31e,e59b878293..7e7e12168e --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@@ -335,16 -335,6 +335,16 @@@ input that is already correctly indente smudge filter means that the clean filter _must_ accept its own output without modifying it. +Sequence "%f" on the filter command line is replaced with the name of +the file the filter is working on. A filter might use this in keyword +substitution. For example: + +------------------------ +[filter "p4"] + clean = git-p4-filter --clean %f + smudge = git-p4-filter --smudge %f +------------------------ + Interaction between checkin/checkout attributes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@@ -504,6 -494,8 +504,8 @@@ patterns are available - `pascal` suitable for source code in the Pascal/Delphi language. + - `perl` suitable for source code in the Perl language. + - `php` suitable for source code in the PHP language. - `python` suitable for source code in the Python language. @@@ -591,39 -583,6 +593,39 @@@ and now produces better output), you ca manually with `git update-ref -d refs/notes/textconv/jpg` (where "jpg" is the name of the diff driver, as in the example above). +Marking files as binary +^^^^^^^^^^^^^^^^^^^^^^^ + +Git usually guesses correctly whether a blob contains text or binary +data by examining the beginning of the contents. However, sometimes you +may want to override its decision, either because a blob contains binary +data later in the file, or because the content, while technically +composed of text characters, is opaque to a human reader. For example, +many postscript files contain only ascii characters, but produce noisy +and meaningless diffs. + +The simplest way to mark a file as binary is to unset the diff +attribute in the `.gitattributes` file: + +------------------------ +*.ps -diff +------------------------ + +This will cause git to generate `Binary files differ` (or a binary +patch, if binary patches are enabled) instead of a regular diff. + +However, one may also want to specify other diff driver attributes. For +example, you might want to use `textconv` to convert postscript files to +an ascii representation for human viewing, but otherwise treat them as +binary files. You cannot specify both `-diff` and `diff=ps` attributes. +The solution is to use the `diff.*.binary` config option: + +------------------------ +[diff "ps"] + textconv = ps2ascii + binary = true +------------------------ + Performing a three-way merge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~