What are the arguments that git diff uses for diff command? -
when invoke git diff
, it's using diff
utility compare files, however, not in default way. it's using number of options, can name are:
- different markers before lines: +/- instead of >/<.
- a few lines of context before , after different lines.
but i'm not sure these changes. others , command line arguments git
pass diff
achieve it's default output? , if want compare, say, a.txt
b.txt
, make diff file way git makes it, command line should use?
git not use default *nix or gnu diff, implements own diff algorithm.
the code located in files builtin/diff.c
, builtin/diff-tree.c
, builtin/diff-index.c
, builtin/diff-files.c
in git source tree.
it can thereby fancy things advanced word-diff , has reliable implementation platforms.
the default (line-based) unified-diff format patches can produce compatible other imlementations of format. iirc, gnu diff (or patch?) added more tolerance extras git puts in diff, more resilient when applying git-generated patches.
Comments
Post a Comment