aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-apply.txt
Commit message (Collapse)AuthorAge
* git-apply.txt: mention the behavior inside a subdirNguyễn Thái Ngọc Duy2016-03-24
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-apply.txt: remove a spaceNguyễn Thái Ngọc Duy2016-03-24
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* *config.txt: stick to camelCase naming conventionNguyễn Thái Ngọc Duy2015-03-13
| | | | | | | | | | | | | | | | | | | | This should improve readability. Compare "thislongname" and "thisLongName". The following keys are left in unchanged. We can decide what to do with them later. - am.keepcr - core.autocrlf .safecrlf .trustctime - diff.dirstat .noprefix - gitcvs.usecrlfattr - gui.blamehistoryctx .trustmtime - pull.twohead - receive.autogc - sendemail.signedoffbycc .smtpsslcertpath .suppresscc Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* apply: reject input that touches outside the working areaJunio C Hamano2015-02-10
| | | | | | | | | | | | | | | | | | | | By default, a patch that affects outside the working area (either a Git controlled working tree, or the current working directory when "git apply" is used as a replacement of GNU patch) is rejected as a mistake (or a mischief). Git itself does not create such a patch, unless the user bends over backwards and specifies a non-standard prefix to "git diff" and friends. When `git apply` is used as a "better GNU patch", the user can pass the `--unsafe-paths` option to override this safety check. This option has no effect when `--index` or `--cached` is in use. The new test was stolen from Jeff King with slight enhancements. Note that a few new tests for touching outside the working area by following a symbolic link are still expected to fail at this step, but will be fixed in later steps. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: the name of the system is 'Git', not 'git'Thomas Ackermann2013-02-01
| | | | | Signed-off-by: Thomas Ackermann <th.acker@arcor.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* apply: document --3way optionJunio C Hamano2012-07-09
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: drop author/documentation sections from most pagesJeff King2011-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Documentation: fix a typo in git-apply.txtMichał Kiedrowicz2011-03-04
| | | | | | | git-apply accepts the --cached option, not --cache. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use parentheses and `...' where appropriateŠtěpán Němec2010-10-08
| | | | | | | | | Remove some stray usage of other bracket types and asterisks for the same purpose. Signed-off-by: Štěpán Němec <stepnem@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use angles for placeholders consistentlyŠtěpán Němec2010-10-08
| | | | | | Signed-off-by: Štěpán Němec <stepnem@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: cite git-am from git-applyBrad King2010-08-09
| | | | | | | | | Users reading git-apply documentation may also be interested in git-am, especially after receiving an email created with git-format-patch. The documentation for git-am already references git-apply. Add the reverse. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: spell 'git cmd' without dash throughoutThomas Rast2010-01-10
| | | | | | | | | | | | | | | The documentation was quite inconsistent when spelling 'git cmd' if it only refers to the program, not to some specific invocation syntax: both 'git-cmd' and 'git cmd' spellings exist. The current trend goes towards dashless forms, and there is precedent in 647ac70 (git-svn.txt: stop using dash-form of commands., 2009-07-07) to actively eliminate the dashed variants. Replace 'git-cmd' with 'git cmd' throughout, except where git-shell, git-cvsserver, git-upload-pack, git-receive-pack, and git-upload-archive are concerned, because those really live in the $PATH.
* apply: Use the term "working tree" consistentlyBjörn Gustavsson2009-11-22
| | | | | | | | | | The documentation for 'git apply' uses both the terms "work tree" and "working tree". Since the glossary uses the term "working tree", change all occurrences of "work tree" to "working tree". Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* apply: Format all options using back-quotesBjörn Gustavsson2009-11-22
| | | | | Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* apply: apply works outside a repositoryBjörn Gustavsson2009-11-22
| | | | | | | | | | | | | | | | The documentation for 'git apply' talks about applying a patch/diff to the index and to the working tree, which seems to imply that it will not work outside a git repository. Actually 'git patch' works outside a repository (which can be useful especially for applying binary or rename patches that the standard "patch" utility cannot handle), so the documentation should mention it. Thanks to Junio for suggesting better wording. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Clarify and correct -zBjörn Gustavsson2009-11-22
| | | | | | | | | | | | | | | | | | | | | The description for -z is too vague and general for the apply, diff*, and log commands. Change the description of -z for 'git log' to note that commits will be separated by NULs. Change the description of -z for 'git diff*' and 'git apply' to note that it applies to the --numstat option, and for 'git diff*' also for --raw option. Also correct the description of the "munging" of pathanmes that takes place in the absence of -z for the 'git diff*' and 'git apply' commands, namely that apart from the characters mentioned, double quotes will also be escaped and that the pathname will be enclosed in double quotes if any characters are escaped. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git apply: option to ignore whitespace differencesGiuseppe Bilotta2009-08-05
| | | | | | | | | | | | Introduce --ignore-whitespace option and corresponding config bool to ignore whitespace differences while applying patches, akin to the 'patch' program. 'git am', 'git rebase' and the bash git completion are made aware of this option. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-apply(1): Clarify that one can select where to apply the patchBjörn Steinbrink2009-05-31
| | | | | | | | The patch can be applied to the work tree, the index or both, but the short description made it look like it's always applied to both. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: minor grammatical fixes.David J. Mellor2009-03-02
| | | | | | | | | The final hunk in this patch corrects what appears to be a typo: of --> or Signed-off-by: David J. Mellor <dmellor@whistlingcat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2009-02-28
|\ | | | | | | | | | | * maint: Documentation: minor grammatical fixes. added missing backtick in git-apply.txt
| * Merge branch 'maint-1.6.0' into maintJunio C Hamano2009-02-28
| |\ | | | | | | | | | | | | * maint-1.6.0: added missing backtick in git-apply.txt
| | * added missing backtick in git-apply.txtDanijel Tasov2009-02-28
| | | | | | | | | | | | | | | Signed-off-by: Danijel Tasov <dt@korn.shell.la> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | parse-opt: migrate builtin-apply.Miklos Vajna2008-12-30
|/ / | | | | | | | | | | | | | | The only incompatible change is that the user how have to use '--' before a patch file if it is named "--build-fake-ancestor=something". Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-apply:--include=pathspecJunio C Hamano2008-09-06
|/ | | | | | | | | | | | | | | | | | | | | This allows --include=pathspec, similar to --exclude=pathspec. The rule when one or both of these are used is that the include/exclude patterns are examined in the order they are given on the command line, and the first match determines if a patch to each path is used or not. Hence: $ git apply --include='specific.h' --exclude='*.h' <diff would apply the patch to specific.h header file, but all other patches in the input file to other header files are ignored. A patch to a path that does not match any include/exclude pattern is used by default if there is no include pattern on the command line, and ignored if there is any include pattern. This originally came from Joe Perches, but both the design of the semantics and the implementation have been redone complately. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'js/apply-root'Junio C Hamano2008-07-09
|\ | | | | | | | | | | | | * js/apply-root: git-apply --directory: make --root more similar to GNU diff apply --root: thinkofix. Teach "git apply" to prepend a prefix with "--root=<root>"
| * git-apply --directory: make --root more similar to GNU diffJunio C Hamano2008-07-06
| | | | | | | | | | | | | | | | | | Applying a patch in the directory that is different from what the patch records is done with --directory option in GNU diff. The --root option we introduced previously does the same, and we can call it the same way to give users more familiar feel. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Teach "git apply" to prepend a prefix with "--root=<root>"Johannes Schindelin2008-07-01
| | | | | | | | | | | | | | | | | | | | | | With "git apply --root=<root>", all file names in the patch are prepended with <root>. If a "-p" value was given, the paths are stripped _before_ prepending <root>. Wished for by HPA. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | manpages: italicize nongit command names (if they are in teletype font)Jonathan Nieder2008-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Some manual pages use teletype font to set command names. We change them to use italics, instead. This creates a visual distinction between names of commands and command lines that can be typed at the command line. It is also more consistent with other man pages outside Git. In this patch, the commands named are non-git commands like bash. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | manpages: italicize git command names (which were in teletype font)Jonathan Nieder2008-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The names of git commands are not meant to be entered at the commandline; they are just names. So we render them in italics, as is usual for command names in manpages. Using doit () { perl -e 'for (<>) { s/\`(git-[^\`.]*)\`/'\''\1'\''/g; print }' } for i in git*.txt config.txt diff*.txt blame*.txt fetch*.txt i18n.txt \ merge*.txt pretty*.txt pull*.txt rev*.txt urls*.txt do doit <"$i" >"$i+" && mv "$i+" "$i" done git diff . Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | manpages: italicize command namesJonathan Nieder2008-07-05
| | | | | | | | | | | | | | | | This includes nongit commands like RCS 'merge'. This patch only italicizes names of commands if they had no formatting before. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation formatting and cleanupJonathan Nieder2008-07-01
| | | | | | | | | | | | | | | | | | | | | | | | Following what appears to be the predominant style, format names of commands and commandlines both as `teletype text`. While we're at it, add articles ("a" and "the") in some places, italicize the name of the command in the manual page synopsis line, and add a comma or two where it seems appropriate. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: be consistent about "git-" versus "git "Jonathan Nieder2008-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Allow git-apply to recount the lines in a hunk (AKA recountdiff)Johannes Schindelin2008-06-28
|/ | | | | | | | | | | | | | Sometimes, the easiest way to fix up a patch is to edit it directly, even adding or deleting lines. Now, many people are not as divine as certain benevolent dictators as to update the hunk headers correctly at the first try. So teach the tool to do it for us. [jc: with tests] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Docs: Use "-l::\n--long\n" format in OPTIONS sectionsStephan Beyer2008-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | The OPTIONS section of a documentation file contains a list of the options a git command accepts. Currently there are several variants to describe the case that different options (almost) do the same in the OPTIONS section. Some are: -f, --foo:: -f|--foo:: -f | --foo:: But AsciiDoc has the special form: -f:: --foo:: This patch applies this form to the documentation of the whole git suite, and removes useless em-dash prevention, so \--foo becomes --foo. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* documentation: move git(7) to git(1)Christian Couder2008-06-06
| | | | | | | | 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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: rename gitlink macro to linkgitDan McGee2008-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Documentation: minor grammar fix for "git apply"Wincent Colaiuta2007-12-12
| | | | | Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* core.whitespace: documentation updates.Junio C Hamano2007-11-24
| | | | | | | | | | | This adds description of core.whitespace to the manual page of git-config, and updates the stale description of whitespace handling in the manual page of git-apply. Also demote "strip" to a synonym status for "fix" as the value of --whitespace option given to git-apply. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* apply: get rid of --index-info in favor of --build-fake-ancestorJohannes Schindelin2007-09-18
| | | | | | | | | | | | | | | | | | | | git-am used "git apply -z --index-info" to find the original versions of the files touched by the diff, to be able to do an inexpensive three-way merge. This operation makes only sense in a repository, since the index information in the diff refers to blobs, which have to be present in the current repository. Therefore, teach "git apply" a mode to write out the result as an index file to begin with, obviating the need for scripts to do it themselves. The sole user for --index-info is "git am" is converted to use --build-fake-ancestor in this patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-apply: apply submodule changesSven Verdoolaege2007-08-15
| | | | | | | | | | | | | Apply "Subproject commit HEX" changes produced by git-diff. As usual in the current git, only the superproject itself is actually modified (possibly creating empty directories for new submodules). Any checked-out submodule is left untouched and is not required to be up-to-date. With clean-ups from Junio C Hamano. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* War on whitespaceJunio C Hamano2007-06-07
| | | | | | | | | 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>
* Update git-apply documentationAndrew Ruder2007-04-16
| | | | | | | | | Document -v (short form of --verbose). Redo usage to not wrap on 80 column terminal with typical settings. Signed-off-by: Andrew Ruder <andy@aeruder.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Documentation: sync git.txt command list and manual page titleJunio C Hamano2007-01-18
| | | | | | | Also reorders a handful entries to make each list sorted alphabetically. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Document --numstat in git-apply and git-diffJunio C Hamano2006-12-26
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-apply: Documentation typo fixPetr Baudis2006-11-18
| | | | | | | inacurate -> inaccurate, sorry if it was a pun. ;-) Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-apply(1): document --unidiff-zeroJonas Fonseca2006-09-17
| | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make apply --binary a no-op.Junio C Hamano2006-09-07
| | | | | | | | | Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so. This makes the flag a no-op by always allowing binary patch application. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/apply'Junio C Hamano2006-08-27
|\ | | | | | | | | | | | | | | | | | | | | | | * jc/apply: git-apply --reject: finishing touches. apply --reject: count hunks starting from 1, not 0 git-apply --verbose git-apply --reject: send rejects to .rej files. git-apply --reject apply --reverse: tie it all together. diff.c: make binary patch reversible. builtin-apply --reverse: two bugfixes.
| * git-apply --reject: finishing touches.Junio C Hamano2006-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a failed "git am" attempt: git apply --reject --verbose .dotest/patch applies hunks that are applicable and leaves *.rej files the rejected hunks, and it reports what it is doing. With --index, files with a rejected hunk do not get their index entries updated at all, so "git diff" will show the hunks that successfully got applied. Without --verbose to remind the user that the patch updated some other paths cleanly, it is very easy to lose track of the status of the working tree, so --reject implies --verbose. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-apply --rejectJunio C Hamano2006-08-17
| | | | | | | | | | | | | | | | | | With the new flag "--reject", hunks that do not apply are sent to the standard output, and the usable hunks are applied. The command itself exits with non-zero status when this happens, so that the user or wrapper can take notice and sort the remaining mess out. Signed-off-by: Junio C Hamano <junkio@cox.net>