GIT-DIFF-PAIRS(1) Git GIT-DIFF-PAIRS(1) (NAME) git-diff-pairs - (SYNOPSIS) git diff-pairs -z [] (DESCRIPTION) stdin. NUL git diff-tree -z -r --raw . stdin (patch) . NUL stdin stdin . NUL . diff diff-pairs . diff-tree (frontend) . git diff-tree -p -M diff-tree blob . blob diff-pairs : git diff-tree -z -r -M $a $b | git diff-pairs -z diff-pairs . (pathspec) diff-pairs . . (tree objects) . diff-pairs . --abbrev . (OPTIONS) -p, -u, --patch ( " -P (GENERATING PATCH TEXT WITH -P)"). . -s, --no-patch diff. git show --patch --stat (alias) . -U, --unified= diff (context). diff.context . (-U -p ). --patch . --output= (stdout). --output-indicator-new=, --output-indicator-old=, --output-indicator-context= . + - ' ' . --raw diff (raw). --patch-with-raw -p --raw. --indent-heuristic (heuristic) diff . . --no-indent-heuristic (indent heuristic). --minimal diff . --patience diff <>. --histogram diff <>. --anchored= diff <>. . . <> . --diff-algorithm=(patience|minimal|histogram|myers) diff. : default, myers diff. . minimal diff . patience <> . histogram patience << >> . diff.algorithm --diff-algorithm=default . --stat[=[,[,]]] diffstat. . . diff.statNameWidth= . --stat-graph-width= diff.statGraphWidth= . --stat --stat-graph-width (stat graph) diff.statNameWidth diff.statGraphWidth git format-patch . ... . --stat-width= --stat-name-width= --stat-count= . --compact-summary ("new" "gone" +l) (+x -x ) diffstat. . --stat . --numstat --stat . 0 0 - . --shortstat --stat . -X [,...], --dirstat[=,...] . --dirstat . diff.dirstat ( git-config(1) ). : changes dirstat . . . . lines dirstat diff /. ( ). --dirstat changes . --*stat . files dirstat . dirstat . --dirstat . cumulative . cumulative . () noncumulative . ( ) . . : : --dirstat=files,10,cumulative. --cumulative --dirstat=cumulative. --dirstat-by-file[=,...] --dirstat=files,,.... --summary / (mode). --patch-with-stat -p --stat. -z --raw --numstat --name-only --name-status NUL . <<>> core.quotePath (quote) ( git-config(1) ). --name-only (post-image). UTF-8 . git-log(1) . --name-status ( ) . --diff-filter . --name-only UTF-8 . --submodule[=] (submodules). --submodule=short short . . --submodule --submodule=log log . git-submodule(1) summary . --submodule=diff diff . diff . diff.submodule short . --color[=] diff . --color ( =) --color=always . always never auto . color.ui color.diff . --no-color diff. . --color=never . --color-moved[=] . diff.colorMoved . no zebra . : no . default zebra . . plain [-removed-] {added}. . blocks - . color.diff.(old|new)Moved . . zebra blocks . color.diff.(old|new)Moved color.diff.(old|new)MovedAlternative . . dimmed-zebra zebra (dim) . . dimmed_zebra . --no-color-moved . . --color-moved=no . --color-moved-ws=,... --color-moved . diff.colorMovedWS . : no . ignore-space-at-eol (EOL). ignore-space-change . . ignore-all-space . . allow-indentation-change . . --no-color-moved-ws . . --color-moved-ws=no . --word-diff[=] --word-diff-regex . plain : color . --color . plain [-removed-] {added}. . porcelain . // diff (unified diff) +/-/` ` . (newlines) ~ . none (word diff). . --word-diff diff (hunk) . diff word-diff . . --diff-algorithm . --word-diff-regex= . --word-diff . . (!). |[^[:space:]] . (newline) (!) . --word-diff-regex=. . (regex) diff gitattributes(5) git- config(1) . diff . diff . --color-words[=] --word-diff=color ( ) --word-diff-regex=. --no-renames . --rename-empty, --no-rename-empty blob . --check . core.whitespace . ( ) . . --exit-code . --ws-error-highlight= context old new diff. none default new all old,new,context . diff.wsErrorHighlight new . color.diff.whitespace . --full-index (patch) blob pre-image post-image "index" . --binary --full-index diff git-apply . --patch . --abbrev[=] diff-raw diff-tree . diff-patch --full-index --full-index blob --abbrev . --abbrev= . -B[][/], --break-rewrites[=[][/]] . : (context) -B ( ). -B/70% ( ). -M ( -M ) -B ( ). -B20% . -M[], --find-renames[=] . ( / ). -M90% / . % -M5 -M50% . -M05 -M5% . -M100% . . -C[], --find-copies[=] . --find-copies-harder. -M . --find-copies-harder -C changeset . . . -C . -D, --irreversible-delete preimage diff preimage /dev/null . patch git apply . ( ) . -B preimage / . -l -M -C / . ( ). N O(N^2) . / / . diff.renameLimit . 0 . --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]] (A) (C) (D) (M) (R) ( ...) (T) (U) (X) (B). ( ) . * ( ) . --diff-filter=ad . diff . . -S ( /). . ( struct) : preimage -S . . -G / . -S --pickaxe-regex -G diff : + return frotz(nitfol, two->ptr, 1, 0); ... - hit = frotz(nitfol, mf2.ptr, 1, 0); git log -G"frotz\(nitfol" git log -S"frotz\(nitfol" --pickaxe-regex ( ). --text textconv . pickaxe gitdiffcore(7) . --find-object= . -S . blob . -t git-log (trees) . --pickaxe-all -S -G changeset . --pickaxe-regex -S POSIX . -O . diff.orderFile (override) ( git-config(1) ). diff.orderFile -O/dev/null . glob . ( ) . . ( ) . : o . o ("#") () . ("\") . o . fnmatch(3) FNM_PATHNAME . "foo*bar" "fooasdfbar" "foo/bar/baz/asdf" "foobarx" . --skip-to=, --rotate-to= ( skip to) ( rotate to). git difftool . -R (swap) index . --relative[=], --no-relative . ( bare) . --no-relative diff.relative --relative . -a, --text . --ignore-cr-at-eol (carriage-return) . --ignore-space-at-eol (EOL) . -b, --ignore-space-change . . -w, --ignore-all-space . . --ignore-blank-lines . -I, --ignore-matching-lines= . . --inter-hunk-context= (context) (hunks) diff . diff.interHunkContext 0 . -W, --function-context (context) . git diff ( " (Defining a custom hunk-header)" gitattributes(5) ). --exit-code diff(1) . 1 0 . --quiet . --exit-code . diff diff.trustExitCode diff..trustExitCode GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE false . --ext-diff diff . diff gitattributes(5) git-log(1) . --no-ext-diff diff . --textconv, --no-textconv ( ) . gitattributes(5) . textconv diff (apply) . textconv git-diff(1) git- log(1) git- format-patch(1) (plumbing) diff . --ignore-submodules[=(none|untracked|dirty|all)] diff . all . none HEAD (superproject) (modified) ignore git-config(1) gitmodules(5) . untracked (dirty) ( ). dirty ( 1.7.0 ). all . --src-prefix= "a/" . --dst-prefix= "b/" . --no-prefix . --default-prefix ("a/" "b/") . diff.noprefix, diff.srcPrefix, diff.dstPrefix diff.mnemonicPrefix ( git-config(1) ). --line-prefix= . --ita-invisible-in-index git add -N git diff git diff --cached . git diff git diff --cached . --ita-visible-in-index . . --max-depth= (pathspec) . -1 . (wildcards) pathspec . foo/bar/baz : o --max-depth=0 -- foo: foo o --max-depth=1 -- foo: foo/bar o --max-depth=1 -- foo/bar: foo/bar/baz o --max-depth=1 -- foo foo/bar: foo/bar/baz o --max-depth=2 -- foo: foo/bar/baz (pathspec) . --max-depth=0 foo . . diff (tree objects) . gitdiffcore(7) . gitdiffcore(7) . P- (GENERATING PATCH TEXT WITH -P) git-diff(1) git-log(1) git-show(1) git-diff- index(1) git-diff-tree(1) git-diff-files(1) -p . GIT_EXTERNAL_DIFF GIT_DIFF_OPTS ( git(1)) diff ( gitattributes(5)) . -p : 1. "git diff" : diff --git a/file1 b/file2 a/ b/ / . /dev/null a/ b/ . / file1 file2 / / . 2. : old mode new mode deleted file mode new file mode copy from copy to rename from rename to similarity index dissimilarity index index .. . a/ b/ . (similarity index) (dissimilarity index) . . . index blob . . 3. <<>> core.quotePath ( git-config(1)). 4. file1 file2 . . a b : diff --git a/a b/b rename from a rename to b diff --git a/b b/a rename from b rename to a 5. (Hunk headers) . "Defining a custom hunk-header" gitattributes(5) . (COMBINED DIFF FORMAT) (diff) -c --cc (combined diff) (merge) . git-diff(1) git-show(1) . --diff-merges . << >> : diff --combined describe.c index fabadb8,cc95eb0..4866510 --- a/describe.c +++ b/describe.c @@@ -98,20 -98,12 +98,20 @@@ return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; } - static void describe(char *arg) -static void describe(struct commit *cmit, int last_one) ++static void describe(char *arg, int last_one) { + unsigned char sha1[20]; + struct commit *cmit; struct commit_list *list; static int initialized = 0; struct commit_name *n; + if (get_sha1(arg, sha1) < 0) + usage(describe_usage); + cmit = lookup_commit_reference(sha1); + if (!cmit) + usage(describe_usage); + if (!initialized) { initialized = 1; for_each_ref(get_name); 1. "git diff" ( -c ): diff --combined file ( --cc ): diff --cc file 2. ( ): index ,.. mode ,.. new file mode deleted file mode , mode ,.. . ( ) . 3. from-file/to-file : --- a/file +++ b/file (unified) /dev/null . --combined-all-paths from-file/to-file N+1 from-file/to-file N : --- a/file --- a/file --- a/file +++ b/file . 4. (chunk) patch -p1 . (apply) . index : @@@ @@@ ( + ) @ (chunk) . (unified) A B - ( -- A B ) + ( -- A B ) " " ( -- ) file1 file2... X X fileN . fileN X . - N fileN . + N fileN ( ). ( - file1 file2 ++ file1 file2 ). file1 file2 ( + ). git diff-tree -c ( file1..fileN ). git diff-files -c ( file1 << >> file2 << >> ). (SEE ALSO) git-diff(1), git-diff-tree(1), git-diff-files(1), git-diff-index(1), gitdiffcore(7), git(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-DIFF-PAIRS(1)