summaryrefslogtreecommitdiff
path: root/Documentation/diff-options.txt
AgeCommit message (Collapse)Author
2008-02-13diff --relative: help working in a bare repositoryJunio C Hamano
This allows the --relative option to say which subdirectory to pretend to be in, so that in a bare repository, you can say: $ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/ Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13diff --relative: output paths as relative to the current subdirectoryJunio C Hamano
This adds --relative option to the diff family. When you start from a subdirectory: $ git diff --relative shows only the diff that is inside your current subdirectory, and without $prefix part. People who usually live in subdirectories may like it. There are a few things I should also mention about the change: - This works not just with diff but also works with the log family of commands, but the history pruning is not affected. In other words, if you go to a subdirectory, you can say: $ git log --relative -p but it will show the log message even for commits that do not touch the current directory. You can limit it by giving pathspec yourself: $ git log --relative -p . This originally was not a conscious design choice, but we have a way to affect diff pathspec and pruning pathspec independently. IOW "git log --full-diff -p ." tells it to prune history to commits that affect the current subdirectory but show the changes with full context. I think it makes more sense to leave pruning independent from --relative than the obvious alternative of always pruning with the current subdirectory, which would break the symmetry. - Because this works also with the log family, you could format-patch a single change, limiting the effect to your subdirectory, like so: $ cd gitk-git $ git format-patch -1 --relative 911f1eb But because that is a special purpose usage, this option will never become the default, with or without repository or user preference configuration. The risk of producing a partial patch and sending it out by mistake is too great if we did so. - This is inherently incompatible with --no-index, which is a bolted-on hack that does not have much to do with git itself. I didn't bother checking and erroring out on the combined use of the options, but probably I should. Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-20Teach diff machinery to display other prefixes than "a/" and "b/"Johannes Schindelin
With the new options "--src-prefix=<prefix>", "--dst-prefix=<prefix>" and "--no-prefix", you can now control the path prefixes of the diff machinery. These used to by hardwired to "a/" for the source prefix and "b/" for the destination prefix. Initial patch by Pascal Obry. Sane option names suggested by Linus. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-14"diff --check" should affect exit statusWincent Colaiuta
"git diff" has a --check option that can be used to check for whitespace problems but it only reported by printing warnings to the console. Now when the --check option is used we give a non-zero exit status, making "git diff --check" nicer to use in scripts and hooks. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-12Use "whitespace" consistentlyWincent Colaiuta
For consistency, change "white space" and "whitespaces" to "whitespace", fixing a couple of adjacent grammar problems in the docs. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-05Include diff options in the git-log manpageMiklos Vajna
[jc: with quite a few fixups] Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <osv@javad.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-02fixed link in documentation of diff-optionsSteffen Prohaska
Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-26Update description of -z option.Junio C Hamano
The NUL you see in "git log" (without diff) output are between records, not at the end of each record. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25Document --unified/-U optionRobin Rosenberg
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-04Add diff-option --ext-diffJohannes Schindelin
To prevent funky games with external diff engines, git-log and friends prevent external diff engines from being called. That makes sense in the context of git-format-patch or git-rebase. However, for "git log -p" it is not so nice to get the message that binary files cannot be compared, while "git diff" has no problems with them, if you provided an external diff driver. With this patch, "git log --ext-diff -p" will do what you expect, and the option "--no-ext-diff" can be used to override that setting. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12Teach diff to imply --find-copies-harder upon -C -CJohannes Schindelin
Earlier, a second "-C" on the command line had no effect. But "--find-copies-harder" is so long to type, let's make doubled -C enable that option. It is in line with how "git blame" handles such doubled options to mean "work harder". Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <gitster@pobox.com>
2007-03-25Document --quiet option to git-diffAlex Riesen
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14Allow git-diff exit with codes similar to diff(1)Alex Riesen
This introduces a new command-line option: --exit-code. The diff programs will return 1 for differences, return 0 for equality, and something else for errors. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-14Document --ignore-space-at-eol option.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-27Document --check option to git diff.Bill Lear
Signed-off-by: Bill Lear <rael@zopyra.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-26Document --numstat in git-apply and git-diffJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16make commit message a little more consistent and confortingNicolas Pitre
It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case. This patch also introduces a -q switch to supress this message as well as the summary of created/deleted files. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-05Document git-diff whitespace flags -b and -wJakub Narebski
Document git diff options -b / --ignore-space-change and -w / --ignore-all-space, introduced by Johannes Schindelin in commit 0d21efa5, "Teach diff about -b and -w flags". The description of options is taken from GNU diff man page and GNU Diffutils info documentation. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-14diff --numstatJunio C Hamano
[jc: with documentation from Jakub] Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-29diff --stat=width[,name-width]: allow custom diffstat output width.Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10Add the --color-words option to the diff options familyJohannes Schindelin
With this option, the changed words are shown inline. For example, if a file containing "This is foo" is changed to "This is bar", the diff will now show "This is " in plain text, "foo" in red, and "bar" in green. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-07Update diff-options and config documentation.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-07diff-options: Explain --text and -aStephan Feder
Signed-off-by: Stephan Feder <sf@b-i-t.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14Add "--summary" option to git diff.Sean
Remove the need to pipe git diff through git apply to get the extended headers summary. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16diff-options: add --patch-with-statJohannes Schindelin
With this option, git prepends a diffstat in front of the patch. Since I really, really do not know what a diffstat of a combined diff ("merge diff") should look like, the diffstat is not generated for these. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13diff-options: add --stat (take 2)Johannes Schindelin
Now, you can say "git diff --stat" (to get an idea how many changes are uncommitted), or "git log --stat". Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-11Document --patch-with-rawPetr Baudis
Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04Support for pickaxe matching regular expressionsPetr Baudis
git-diff-* --pickaxe-regex will change the -S pickaxe to match POSIX extended regular expressions instead of fixed strings. The regex.h library is a rather stupid interface and I like pcre too, but with any luck it will be everywhere we will want to run Git on, it being POSIX.2 and all. I'm not sure if we can expect platforms like AIX to conform to POSIX.2 or if win32 has regex.h. We might add a flag to Makefile if there is a portability trouble potential. Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-02-09Add --diff-filter= documentation paragraphJon Loeliger
Signed-off-by: Jon Loeliger <jdl@jdl.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-29Documentation: spell.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-20diff --abbrev: document --abbrev=<n> form.Junio C Hamano
It was implemented there but was not advertised. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-20diff: --abbrev optionJunio C Hamano
When I show transcripts to explain how something works, I often find myself hand-editing the diff-raw output to shorten various object names in the output. This adds --abbrev option to the diff family, which shortens diff-raw output and diff-tree commit id headers. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-17diff: --full-indexJunio C Hamano
A new option, --full-index, is introduced to diff family. This causes the full object name of pre- and post-images to appear on the index line of patch formatted output, to be used in conjunction with --allow-binary-replacement option of git-apply. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11Change 'cache' to 'index' in the docsLukas_Sandström
This patch makes the documentation refer to the index as index instead of cache, but some references still remain. (e.g. git-update-index.txt) Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-29Remove -r from common diff options documentation in one more placec.shoemaker@cox.net
Signed-off-by: Chris Shoemaker <c.shoemaker at cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-05Some typos and light editing of various manpagesChristian Meder
Typos, light editing and clarifications. Signed-off-by: Christian Meder <chris@absolutegiganten.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-25Diff: --name-status output format.Junio C Hamano
The new output format shows only the status letter and paths. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-25Diff: -l<num> to limit rename/copy detection.Junio C Hamano
When many paths are modified, rename detection takes a lot of time. The new option -l<num> can be used to disable rename detection when more than <num> paths are possibly created as renames. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-30Documentaion updates.Junio C Hamano
Mostly making the formatted html prettier. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 7adf1f15ebe074d4767df941817a6cf86d8e2533 commit)
2005-08-06[PATCH] Assorted documentation patchesJohannes Schindelin
[jc: Johannes spent time and effort to see how consistent our use of terminilogy is, and as a byproduct made these corrections not related to the terminology unification. I really appreciate it.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-13[PATCH] Clean up diff option descriptions.Junio C Hamano
I got tired of maintaining almost duplicated descriptions in diff-* brothers, both in usage string and documentation. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>