Find a file
Jeff King 9cb92c390c diff: add filter for converting binary to text
When diffing binary files, it is sometimes nice to see the
differences of a canonical text form rather than either a
binary patch or simply "binary files differ."

Until now, the only option for doing this was to define an
external diff command to perform the diff. This was a lot of
work, since the external command needed to take care of
doing the diff itself (including mode changes), and lost the
benefit of git's colorization and other options.

This patch adds a text conversion option, which converts a
file to its canonical format before performing the diff.
This is less flexible than an arbitrary external diff, but
is much less work to set up. For example:

  $ echo '*.jpg diff=exif' >>.gitattributes
  $ git config diff.exif.textconv exiftool
  $ git config diff.exif.binary false

allows one to see jpg diffs represented by the text output
of exiftool.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-18 08:02:55 -07:00
arm fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
compat cygwin: Use native Win32 API for stat 2008-09-30 14:30:06 -07:00
contrib Merge branch 'maint' 2008-10-17 01:52:32 -07:00
Documentation Merge branch 'pb/commit-where' 2008-10-18 07:07:23 -07:00
git-gui Merge git://repo.or.cz/git-gui 2008-09-25 08:41:07 -07:00
gitk-git
gitweb Merge branch 'pb/gitweb-tagcloud' into pb/gitweb 2008-10-03 07:41:25 -07:00
mozilla-sha1 fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
perl Git.pm: Use File::Temp->tempfile instead of ->new 2008-09-10 11:45:22 -07:00
ppc fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
t t4012: use test_cmp instead of cmp 2008-10-18 07:20:36 -07:00
templates Fix permission bits on sources checked out with an overtight umask 2008-09-09 13:32:32 -07:00
xdiff
.gitattributes git-gui: Use gitattribute "encoding" for file content display 2008-09-24 12:48:31 -07:00
.gitignore
.mailmap
abspath.c is_directory(): a generic helper function 2008-09-09 09:27:45 -07:00
alias.c
alloc.c
archive-tar.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
archive-zip.c
archive.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
archive.h
attr.c
attr.h
base85.c
blob.c
blob.h
branch.c
branch.h
builtin-add.c
builtin-annotate.c
builtin-apply.c Merge branch 'maint' 2008-10-12 13:21:17 -07:00
builtin-archive.c Make git archive respect core.autocrlf when creating zip format archives 2008-09-18 19:49:28 -07:00
builtin-blame.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-branch.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-bundle.c
builtin-cat-file.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-check-attr.c
builtin-check-ref-format.c
builtin-checkout-index.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-checkout.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-clean.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-clone.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-commit-tree.c Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk-header-fix 2008-09-18 20:32:50 -07:00
builtin-commit.c Merge branch 'pb/commit-where' 2008-10-18 07:07:23 -07:00
builtin-config.c
builtin-count-objects.c Correct output of git-count-objects. 2008-09-08 14:25:43 -07:00
builtin-describe.c
builtin-diff-files.c diff/diff-files: do not use --cc too aggressively 2008-09-18 10:49:03 -07:00
builtin-diff-index.c
builtin-diff-tree.c Fix git-diff-tree --stdin 2008-09-10 15:00:17 -07:00
builtin-diff.c "git diff <tree>{3,}": do not reverse order of arguments 2008-10-12 12:36:19 -07:00
builtin-fast-export.c
builtin-fetch--tool.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-fetch-pack.c Merge branch 'jc/alternate-push' 2008-09-25 09:39:24 -07:00
builtin-fetch.c Start conforming code to "git subcmd" style part 2 2008-09-09 08:41:29 -07:00
builtin-fmt-merge-msg.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-for-each-ref.c Merge branch 'bc/master-diff-hunk-header-fix' 2008-09-29 11:04:20 -07:00
builtin-fsck.c
builtin-gc.c Use "git_config_string" to simplify "builtin-gc.c" code where "prune_expire" is set 2008-09-30 13:41:50 -07:00
builtin-grep.c git grep: Add "-z/--null" option as in GNU's grep. 2008-10-01 09:14:54 -07:00
builtin-help.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-http-fetch.c Merge branch 'ho/dashless' 2008-09-09 22:57:35 -07:00
builtin-init-db.c git init: --bare/--shared overrides system/global config 2008-10-08 07:18:44 -07:00
builtin-log.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-ls-files.c
builtin-ls-remote.c
builtin-ls-tree.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-merge-base.c parse-opt: migrate git-merge-base. 2008-10-02 18:46:02 -07:00
builtin-merge-file.c parse-opt: migrate builtin-merge-file. 2008-10-02 18:46:02 -07:00
builtin-merge-ours.c
builtin-merge-recursive.c Merge branch 'maint' into bc/master-diff-hunk-header-fix 2008-09-29 10:52:34 -07:00
builtin-merge.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-mv.c
builtin-name-rev.c
builtin-pack-objects.c Replace xmalloc/memset(0) pairs with xcalloc 2008-10-08 07:30:59 -07:00
builtin-pack-refs.c
builtin-prune-packed.c
builtin-prune.c make prune report removed objects on -v 2008-09-30 14:30:00 -07:00
builtin-push.c Merge branch 'maint' 2008-10-08 08:05:43 -07:00
builtin-read-tree.c Merge branch 'jc/maint-checkout-keep-remove' into maint 2008-09-18 19:53:22 -07:00
builtin-receive-pack.c push: receiver end advertises refs from alternate repositories 2008-09-09 09:27:46 -07:00
builtin-reflog.c
builtin-remote.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-rerere.c
builtin-reset.c do not segfault if make_cache_entry failed 2008-10-06 07:19:36 -07:00
builtin-rev-list.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-rev-parse.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-revert.c
builtin-rm.c git rm: refresh index before up-to-date check 2008-10-08 07:04:44 -07:00
builtin-send-pack.c Merge branch 'jc/alternate-push' 2008-09-25 09:39:24 -07:00
builtin-shortlog.c
builtin-show-branch.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-show-ref.c
builtin-stripspace.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-symbolic-ref.c
builtin-tag.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-tar-tree.c Cosmetical command name fix 2008-09-15 23:11:35 -07:00
builtin-unpack-objects.c Replace xmalloc/memset(0) pairs with xcalloc 2008-10-08 07:30:59 -07:00
builtin-update-index.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
builtin-update-ref.c
builtin-upload-archive.c
builtin-verify-pack.c
builtin-verify-tag.c
builtin-write-tree.c
builtin.h Merge branch 'jc/alternate-push' 2008-09-25 09:39:24 -07:00
bundle.c
bundle.h
cache-tree.c
cache-tree.h
cache.h Merge branch 'dp/cywginstat' 2008-10-09 10:24:14 -07:00
check-builtins.sh
check-racy.c
check_bindir
color.c
color.h
combine-diff.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
command-list.txt
commit.c commit.c: make read_graft_file() static 2008-10-02 18:03:35 -07:00
commit.h commit.c: make read_graft_file() static 2008-10-02 18:03:35 -07:00
config.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
config.mak.in Merge branch 'jc/cc-ld-dynpath' 2008-09-07 23:45:56 -07:00
configure.ac
connect.c push: prepare sender to receive extended ref information from the receiver 2008-09-09 09:27:46 -07:00
convert.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
copy.c
COPYING
csum-file.c Merge branch 'maint' 2008-10-10 08:39:20 -07:00
csum-file.h Merge branch 'maint' 2008-10-10 08:39:20 -07:00
ctype.c
daemon.c Merge branch 'jc/alternate-push' 2008-09-25 09:39:24 -07:00
date.c
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c
diff-no-index.c
diff.c diff: add filter for converting binary to text 2008-10-18 08:02:55 -07:00
diff.h Merge branch 'ho/dirstat-by-file' 2008-09-25 08:41:42 -07:00
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h diff: introduce diff.<driver>.binary 2008-10-18 08:02:26 -07:00
dir.c dir.c: make dir_add_name() and dir_add_ignored() static 2008-10-02 17:46:09 -07:00
dir.h dir.c: make dir_add_name() and dir_add_ignored() static 2008-10-02 17:46:09 -07:00
dump-cache-tree.c
editor.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
entry.c
environment.c add have_git_dir() function 2008-09-30 14:30:06 -07:00
exec_cmd.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
exec_cmd.h
fast-import.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
fetch-pack.h
fixup-builtins
fsck.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
fsck.h
generate-cmdlist.sh
git-add--interactive.perl
git-am.sh
git-archimport.perl
git-bisect.sh
git-compat-util.h cygwin: Use native Win32 API for stat 2008-09-30 14:30:06 -07:00
git-cvsexportcommit.perl
git-cvsimport.perl
git-cvsserver.perl
git-filter-branch.sh
git-instaweb.sh
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool.sh
git-parse-remote.sh
git-pull.sh
git-quiltimport.sh
git-rebase--interactive.sh rebase -i: do not fail when there is no commit to cherry-pick 2008-10-10 08:32:03 -07:00
git-rebase.sh Teach rebase -i to honor pre-rebase hook 2008-10-06 01:19:14 -07:00
git-relink.perl
git-repack.sh git-repack uses --no-repack-object, not --no-repack-delta. 2008-09-19 22:23:14 -07:00
git-request-pull.sh
git-send-email.perl send-email: signedoffcc -> signedoffbycc, but handle both 2008-10-01 08:56:58 -07:00
git-sh-setup.sh
git-stash.sh git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1) 2008-10-09 09:09:50 -07:00
git-submodule.sh Merge branch 'bc/master-diff-hunk-header-fix' 2008-09-29 11:04:20 -07:00
git-svn.perl Add git-svn branch to allow branch creation in SVN repositories 2008-10-06 09:00:55 -07:00
GIT-VERSION-GEN GIT 1.6.0.2 2008-09-12 16:18:47 -07:00
git-web--browse.sh git-web--browse: Support for using /bin/start on MinGW 2008-09-24 15:49:21 -07:00
git.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
git.spec.in Update RPM spec for the new location of git-cvsserver. 2008-09-15 21:03:59 -07:00
graph.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
graph.h graph.c: make many functions static 2008-09-25 08:00:28 -07:00
grep.c git grep: Add "-z/--null" option as in GNU's grep. 2008-10-01 09:14:54 -07:00
grep.h git grep: Add "-z/--null" option as in GNU's grep. 2008-10-01 09:14:54 -07:00
hash-object.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
hash.c
hash.h
help.c git wrapper: also use aliases to correct mistyped commands 2008-09-11 23:05:39 -07:00
help.h Merge branch 'ar/autospell' 2008-09-07 23:52:16 -07:00
http-push.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
http-walker.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
http.c Merge branch 'mh/maint-honor-no-ssl-verify' 2008-09-16 00:46:36 -07:00
http.h
ident.c
imap-send.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
index-pack.c Merge branch 'maint' 2008-10-10 08:39:20 -07:00
INSTALL separate build targets for man and html documentation 2008-09-10 15:41:51 -07:00
interpolate.c
interpolate.h
levenshtein.c
levenshtein.h
list-objects.c
list-objects.h
ll-merge.c
ll-merge.h
lockfile.c
log-tree.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
log-tree.h
mailmap.c
mailmap.h
Makefile diff: unify external diff and funcname parsing code 2008-10-18 08:02:21 -07:00
match-trees.c
merge-file.c
merge-index.c
merge-recursive.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
merge-recursive.h
merge-tree.c Replace xmalloc/memset(0) pairs with xcalloc 2008-10-08 07:30:59 -07:00
mktag.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
mktree.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
name-hash.c
object.c
object.h Fix git-diff-tree --stdin 2008-09-10 15:00:17 -07:00
pack-check.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
pack-redundant.c
pack-refs.c
pack-refs.h
pack-revindex.c
pack-revindex.h
pack-write.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
pack.h
pager.c
parse-options.c
parse-options.h
patch-delta.c
patch-id.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
patch-ids.c
patch-ids.h
path.c
pkt-line.c
pkt-line.h
pretty.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
progress.c
progress.h
quote.c
quote.h
reachable.c
reachable.h
read-cache.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
README
reflog-walk.c
reflog-walk.h
refs.c refs: improve comments about "reading" argument of "resolve_ref" 2008-09-09 08:34:00 -07:00
refs.h
RelNotes Start draft release notes for 1.6.0.3 2008-09-19 23:15:13 -07:00
remote.c Merge branch 'maint' 2008-10-17 01:52:32 -07:00
remote.h remote.c: make free_ref(), parse_push_refspec() and free_refspecs() static. 2008-09-25 08:00:28 -07:00
rerere.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
rerere.h
revision.c Merge branch 'tr/rev-list-reverse' 2008-09-18 20:18:37 -07:00
revision.h Merge branch 'tr/rev-list-reverse' 2008-09-18 20:18:37 -07:00
run-command.c run-command.c: remove run_command_v_opt_cd() 2008-10-02 18:02:44 -07:00
run-command.h run-command.c: remove run_command_v_opt_cd() 2008-10-02 18:02:44 -07:00
send-pack.h
server-info.c
setup.c make prefix_path() never return NULL 2008-10-06 00:37:30 -07:00
sha1-lookup.c
sha1-lookup.h
sha1_file.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
sha1_name.c
shallow.c
shell.c
shortlog.h
show-index.c
sideband.c
sideband.h
strbuf.c
strbuf.h
string-list.c
string-list.h
symlinks.c
tag.c
tag.h
tar.h
test-chmtime.c
test-date.c
test-delta.c
test-genrandom.c
test-match-trees.c
test-parse-options.c
test-path-utils.c
test-sha1.c fix openssl headers conflicting with custom SHA1 implementations 2008-10-02 18:06:56 -07:00
test-sha1.sh
thread-utils.c
thread-utils.h
trace.c
transport.c Merge branch 'maint' 2008-10-06 08:56:07 -07:00
transport.h
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unpack-file.c
unpack-trees.c checkout: do not lose staged removal 2008-09-09 22:55:22 -07:00
unpack-trees.h checkout: do not lose staged removal 2008-09-09 22:55:22 -07:00
update-server-info.c
upload-pack.c
usage.c usage.c: remove unused functions 2008-09-29 07:30:16 -07:00
userdiff.c diff: add filter for converting binary to text 2008-10-18 08:02:55 -07:00
userdiff.h diff: add filter for converting binary to text 2008-10-18 08:02:55 -07:00
utf8.c
utf8.h
var.c
walker.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
walker.h
wrapper.c
write_or_die.c
ws.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
wt-status.c Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer 2008-10-12 12:36:19 -07:00
wt-status.h
xdiff-interface.c Merge branch 'maint' 2008-10-17 01:52:32 -07:00
xdiff-interface.h Merge branch 'bc/master-diff-hunk-header-fix' 2008-09-29 11:04:20 -07:00

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.