path: root/Documentation/git-diff.txt
AgeCommit message (Collapse)Author
2018-05-25Use proper syntax for replaceables in command docsRobert P. J. Day
The standard for command documentation synopses appears to be: [...] means optional <...> means replaceable [<...>] means both optional and replaceable So fix a number of doc pages that use incorrect variations of the above. Signed-off-by: Robert P. J. Day <> Signed-off-by: Junio C Hamano <>
2018-05-06doc: normalize [--options] to [options] in git-diffAndreas Heiduk
SYNOPSIS and other manuals use [options] but DESCRIPTION used [--options]. Signed-off-by: Andreas Heiduk <> Signed-off-by: Junio C Hamano <>
2018-05-06doc: align 'diff --no-index' in text and synopsisAndreas Heiduk
Make the two '<path>' parameters in DESCRIPTION mandatory and move the `--options` part to the same place where the other variants show them. And finally make `--no-index` in SYNOPSIS as mandatory as in DESCRIPTION. Signed-off-by: Andreas Heiduk <> Reviewed-by: Martin Ågren <> Signed-off-by: Junio C Hamano <>
2017-04-13diff-files: document --ours etc.Andreas Heiduk
git-diff understands "--ours", "--theirs" and "--base" for files with conflicts. But so far they were not documented for the central diff command but only for diff-files. Signed-off-by: Andreas Heiduk <> Signed-off-by: Junio C Hamano <>
2014-03-31Documentation: fix misuses of "nor"Justin Lebar
Signed-off-by: Justin Lebar <> Signed-off-by: Junio C Hamano <>
2014-02-05Documentation: fix typos in man pagesØystein Walle
Signed-off-by: Øystein Walle <> Signed-off-by: Junio C Hamano <>
2013-08-28diff --no-index: describe in a separate paragraphJunio C Hamano
The documentation for "diff-files" mode of "git diff" primarily talks about how changes in the files in the working tree are shown relative to the contents previously added to that index, and tucks explanation on how "--no-index" mode, which works in a quite different way, may be implicitly used instead. Instead, add a separate paragraph to explain what "--no-index" mode does, and also mention when "--no-index" can be omitted from the command line (essentially, when it is obvious from the context). Signed-off-by: Junio C Hamano <>
2013-08-22diff --no-index: clarify operation when not inside a repositoryDale R. Worley
Clarify documentation for "diff --no-index". State that when not inside a repository, --no-index is implied and two arguments are mandatory. Clarify error message from diff-no-index to inform user that CWD is not inside a repository and thus two arguments are mandatory. Signed-off-by: Dale Worley <> Signed-off-by: Junio C Hamano <>
2013-07-22Merge branch 'kb/diff-blob-blob-doc' into maintJunio C Hamano
* kb/diff-blob-blob-doc: Documentation: Move "git diff <blob> <blob>"
2013-06-18Documentation: Move "git diff <blob> <blob>"Kevin Bracey
The section describing "git diff <blob> <blob>" had been placed in a position that disrupted the statement "This is synonymous to the previous form". Reorder to place this form after all the <commit>-using forms, and the note applying to them. Also mention this form in the initial description paragraph. Signed-off-by: Kevin Bracey <> Signed-off-by: Junio C Hamano <>
2013-02-01Documentation: the name of the system is 'Git', not 'git'Thomas Ackermann
Signed-off-by: Thomas Ackermann <> Signed-off-by: Junio C Hamano <>
2012-12-18Documentation: Describe "git diff <blob> <blob>" separatelyJunio C Hamano
As it was not a common operation, it was described as if it is a side note for the more common two-commit variant, but this mode behaves very differently, e.g. it does not make any sense to ask recursive behaviour, or give the command a pathspec. Signed-off-by: Junio C Hamano <>
2011-03-11doc: drop author/documentation sections from most pagesJeff King
The point of these sections is generally to: 1. Give credit where it is due. 2. Give the reader an idea of where to ask questions or file bug reports. But they don't do a good job of either case. For (1), they are out of date and incomplete. A much more accurate answer can be gotten through shortlog or blame. For (2), the correct contact point is generally git@vger, and even if you wanted to cc the contact point, the out-of-date and incomplete fields mean you're likely sending to somebody useless. So let's drop the fields entirely from all manpages except git(1) itself. We already point people to the mailing list for bug reports there, and we can update the Authors section to give credit to the major contributors and point to shortlog and blame for more information. Each page has a "This is part of git" footer, so people can follow that to the main git manpage.
2011-02-07diff: support --cached on unborn branchesNguyễn Thái Ngọc Duy
"git diff --cached" (without revision) used to mean "git diff --cached HEAD" (i.e. the user was too lazy to type HEAD). This "correctly" failed when there was no commit yet. But was that correctness useful? This patch changes the definition of what particular command means. It is a request to show what _would_ be committed without further "git add". The internal implementation is the same "git diff --cached HEAD" when HEAD exists, but when there is no commit yet, it compares the index with an empty tree object to achieve the desired result. Signed-off-by: Junio C Hamano <> Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
2010-11-05docs: clarify git diff modes of operationJeff King
It is an oversimplification to say that we can take "[<commit> [<commit>]]", as it really depends on what options have been given. Instead, let's list the major modes of operation separately, as we do in other manpages. This patch also adjusts the text immediately after the synopsis to match the lines given in the synopsis. For git-difftool, which has the same issue, let's refer the user to the git-diff manpage rather than spelling it all out again. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2010-11-05diff,difftool: Don't use the {0,2} notation in usage stringsŠtěpán Němec
This was the only occurence of that usage, and square brackets are sufficient and already well-established for that purpose. Signed-off-by: Štěpán Němec <> Acked-by: Sverre Rabbelier <> Signed-off-by: Junio C Hamano <>
2010-10-14Documentation: update implicit "--no-index" behavior in "git diff"Jonathan Nieder
Originally "--no-index" mode triggered for untracked files within the tracked tree, but with v1.5.6-rc1~41 (Merge branch 'jc/diff-no-no-index, 2008-05-26) the command was fixed to only implicitly trigger when paths outside the tracked tree are mentioned. Reported-by: Yann Dirson <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-10-14Documentation: expand 'git diff' SEE ALSO sectionJonathan Nieder
Point in many directions in the hope of helping the reader find what is needed more quickly. This commit also removes the summary attached to the SEE ALSO entry for difftool, to avoid making the SEE ALSO list too verbose. If the reader wants a summary of the commands referred to, she can always look to the top of the named pages or to the table of contents on the main git(1) page. Suggested-by: Goswin von Brederlow <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-10-14Documentation: diff can compare blobsJonathan Nieder
Meanwhile, there is no plumbing command to compare two blobs. Strange. Reported-by: Yann Dirson <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-10-14Documentation: gitrevisions is in section 7Jonathan Nieder
Fix references to gitrevisions(1) in the manual pages and HTML documentation. In practice, this will not matter much unless someone tries to use a hard copy of the git reference manual. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-07-05Documentation: link to gitrevisions rather than git-rev-parseMichael J Gruber
Currently, whenever we need documentation for revisions and ranges, we link to the git-rev-parse man page, i.e. a plumbing man page, which has this along with the documentation of all rev-parse modes. Link to the new gitrevisions man page instead in all cases except - when the actual git-rev-parse command is referred to or - in very technical context (git-send-pack). Signed-off-by: Michael J Gruber <> Signed-off-by: Junio C Hamano <>
2010-01-10git-diff.txt: Link to git-difftoolDavid Aguilar
Signed-off-by: David Aguilar <> Signed-off-by: Junio C Hamano <>
2009-07-28Update the documentation of the raw diff output formatDavid Kågedal
This includes mentioning the initial hash output of diff-tree, and changes the header to "raw output format" which is more descriptive. Signed-off-by: David Kågedal <> Signed-off-by: Junio C Hamano <>
2008-11-11git-diff: Add --staged as a synonym for --cached.David Symonds
Signed-off-by: Junio C Hamano <>
2008-07-02Documentation: be consistent about "git-" versus "git "Jonathan Nieder
Since the git-* commands are not installed in $(bindir), using "git-command <parameters>" in examples in the documentation is not a good idea. On the other hand, it is nice to be able to refer to each command using one hyphenated word. (There is no escaping it, anyway: man page names cannot have spaces in them.) This patch retains the dash in naming an operation, command, program, process, or action. Complete command lines that can be entered at a shell (i.e., without options omitted) are made to use the dashless form. The changes consist only of replacing some spaces with hyphens and vice versa. After a "s/ /-/g", the unpatched and patched versions are identical. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2008-06-06documentation: move git(7) to git(1)Christian Couder
As the "git" man page describes the "git" command at the end-user level, it seems better to move it to man section 1. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
2008-01-07Documentation: rename gitlink macro to linkgitDan McGee
Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock Asciidoc configuration: @@ -149,7 +153,10 @@ # Inline macros. # Backslash prefix required for escape processing. # (?s) re flag for line spanning. -(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])= + +# Explicit so they can be nested. +(?su)[\\]?(?P<name>(http|https|ftp|file|mailto|callto|image|link)):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])= + # Anchor: [[[id]]]. Bibliographic anchor. (?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3 # Anchor: [[id,xreflabel]] This default regex now matches explicit values, and unfortunately in this case gitlink was being matched by just 'link', causing the wrong inline macro template to be applied. By renaming the macro, we can avoid being matched by the wrong regex. Signed-off-by: Dan McGee <> Signed-off-by: Junio C Hamano <>
2007-11-16Documentation: customize diff-options depending on particular commandSergei Organov
Customize diff-options depending on particular command as follows, mostly to make git-diff and git-format-patch manuals less confusing: * git-format-patch: - Mark --patch-with-stat as being the default. - Change -p description so that it matches what it actually does and so that it doesn't refer to absent "section on generating patches". * git-diff: mark -p as being the default. * git-diff-index/git-diff-files/git-diff-tree: mark --raw as being the default. Signed-off-by: Sergei Organov <> Signed-off-by: Junio C Hamano <>
2007-11-02Merge branch 'gp/maint-diffdoc'Junio C Hamano
* gp/maint-diffdoc: git-diff.txt: add section "output format" describing the diff formats
2007-11-02git-diff.txt: add section "output format" describing the diff formatsGerrit Pape
git-diff.txt includes diff-options.txt which for the -p option refers to a section "generating patches.." which is missing from the git-diff documentation. This patch adapts diff-format.txt to additionally mention the git-diff program, and includes diff-format.txt into git-diff.txt. Tino Keitel noticed this problem. Signed-off-by: Gerrit Pape <> Signed-off-by: Junio C Hamano <>
2007-10-16Fix some typos, punctuation, missing words, minor markup.Ralf Wildenhues
Signed-off-by: Lars Hjemli <> Signed-off-by: Shawn O. Pearce <>
2007-08-29Documentation/git-diff: A..B and A...B cannot take tree-ishesJunio C Hamano
As pointed out by Linus, these notations require the endpoints given by the end user to be commits. Clarify. Also, three-dots in AsciiDoc are turned into ellipses unless quoted with bq. Be careful. Signed-off-by: Junio C Hamano <>
2007-08-28Describe two-dot and three-dot notation for diff endpoints.Mike Hommey
Signed-off-by: Junio C Hamano <>
2007-08-02Try to be consistent with capitalization in the documentationSteve Hoelzer
Signed-off-by: Steve Hoelzer <> Signed-off-by: Junio C Hamano <>
2007-07-29Documentation/git-diff: remove -r from --name-status exampleJeff King
Calling 'git-diff --name-status' will recursively show any changes already, and it has for quite some time (at least as far back as v1.4.1). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2007-06-07War on whitespaceJunio C Hamano
This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <>
2007-03-06Merge branch 'master-for-junio' of git://; branch ↵Junio C Hamano
'maint' * 'master-for-junio' of git:// fast-import: Fail if a non-existant commit is used for merge fast-import: Avoid infinite loop after reset * maint: Fix diff-options references in git-diff and git-format-patch Add definition of <commit-ish> to the main git man page. Begin SubmittingPatches with a check list fast-import: Fail if a non-existant commit is used for merge fast-import: Avoid infinite loop after reset
2007-03-06Fix diff-options references in git-diff and git-format-patchBrian Gernhardt
Most of the git-diff-* documentation used [<common diff options>] instead of [--diff-options], so make that change in git-diff and git-format-patch. In addition, git-format-patch didn't include the meanings of the diff options. Signed-off-by: Brian Gernhardt <> Signed-off-by: Junio C Hamano <>
2007-02-23Teach git-diff-files the new option `--no-index`Johannes Schindelin
With this flag and given two paths, git-diff-files behaves as a GNU diff lookalike (plus the git goodies like --check, colour, etc.). This flag is also available in git-diff. It also works outside of a git repository. In addition, if git-diff{,-files} is called without revision or stage parameter, and with exactly two paths at least one of which is not tracked, the default is --no-index. So, you can now say git diff /etc/inittab /etc/fstab and it actually works! This also unifies the duplicated argument parsing between cmd_diff_files() and builtin_diff_files(). Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2007-01-18Refer users to git-rev-parse for revision specification syntax.Shawn O. Pearce
The revision specification syntax (sometimes referred to as SHA1-expressions) is accepted almost everywhere in Git by almost every tool. Unfortunately it is only documented in git-rev-parse.txt, and most users don't know to look there. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2006-12-20diff documentation: mostly talk about <commit>Junio C Hamano
This corrects minor remaining bits that still talked about <tree-ish>; the Porcelain users (as opposed to plumbers) are mostly interested in commits so use <commit> consistently and keep a sentence that mentions that <tree-ish> can be used in place of them.
2006-12-16Make git-diff documentation use [--] when it should.Brian Gernhardt
Two of the cases has "[--] [<path>...]" and two had "-- [<path>...]". Not terribly consistent and potentially confusing. Also add "[--]" to the synopsis so that it's obvious you can use it from the very beginning. Signed-off-by: Brian Gernhardt <> Signed-off-by: Junio C Hamano <>
2006-12-14Update git-diff documentationJunio C Hamano
Porcelain documentation should talk in terms of end-user workflow, not in terms of implementation details. Do not suggest update-index, but git-add instead. Explain differences among 0-, 1- and 2-tree cases not as differences of number of trees given to the command, but say why user would want to give these number of trees to the command in what situation. Signed-off-by: Junio C Hamano <>
2006-12-13Revert "git-diff: Introduce --index and deprecate --cached."Junio C Hamano
This reverts commit 4c81c213a479e4aae0653a56ad6e8db5c31f019c. Although --cached and --index are confusing wording, the use of word --cached for git-diff is consistent with git-apply. It means "work with index without looking at the working tree". We should probably come up with better wording for --cached, if somebody wants to deprecate it. But making --index and --cached synonyms for diff while leaving them mean different things for apply is no good.
2006-12-02git-diff: Introduce --index and deprecate --cached.Andreas Ericsson
'git diff --cached' still works, but its use is discouraged in the documentation. 'git diff --index' does the same thing and is consistent with how 'git apply --index' works. Signed-off-by: Andreas Ericsson <> Signed-off-by: Junio C Hamano <>
2006-07-09change ent to tree in git-diff documentationMatthias Lederhofer
Signed-off-by: Junio C Hamano <>
2006-06-04Documentation: Spelling fixesHorst H. von Brand
Signed-off-by: Horst H. von Brand <> Signed-off-by: Junio C Hamano <>
2006-04-28Fix up remaining man pages that use asciidoc "callouts".Sean Estabrooks
Unfortunately docbook does not allow a callout to be referenced from inside a callout list description. Rewrite one paragraph in git-reset man page to work around this limitation. Signed-off-by: Sean Estabrooks <>
2006-03-09Remove trailing dot after short descriptionFredrik Kuivinen
Signed-off-by: Fredrik Kuivinen <> Signed-off-by: Junio C Hamano <>
2005-12-29Documentation: spell.Junio C Hamano
Signed-off-by: Junio C Hamano <>