* [PATCH 2/4] apply: apply works outside a repository
@ 2009-11-22 19:43 Björn Gustavsson
0 siblings, 0 replies; 3+ messages in thread
From: Björn Gustavsson @ 2009-11-22 19:43 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
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>
---
Documentation/git-apply.txt | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 0156ca9..0c55ca9 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -3,7 +3,7 @@ git-apply(1)
NAME
----
-git-apply - Apply a patch on a git index file and/or a working tree
+git-apply - Apply a patch to files and/or to the index
SYNOPSIS
@@ -20,8 +20,11 @@ SYNOPSIS
DESCRIPTION
-----------
-Reads supplied 'diff' output and applies it on a git index file
-and a work tree.
+Reads the supplied diff output (i.e. "a patch") and applies it to files.
+With the `--index` option the patch is also applied to the index, and
+with the `--cache` option the patch is only applied to the index.
+Without these options, the command applies the patch only to files,
+and does not require them to be in a git repository.
OPTIONS
-------
--
1.6.5.3.298.g39add
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/4] apply: apply works outside a repository
@ 2009-11-22 16:19 Björn Gustavsson
2009-11-22 17:28 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Björn Gustavsson @ 2009-11-22 16:19 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
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.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
Documentation/git-apply.txt | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 4f791ee..6857a68 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -23,6 +23,10 @@ DESCRIPTION
Reads supplied 'diff' output and applies it on a git index file
and a work tree.
+'git-apply' can also be used outside a git repository as long
+as no options that require a git repository are given
+(e.g. `--index` or `--cached`).
+
OPTIONS
-------
<patch>...::
--
1.6.5.3.298.g39add
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/4] apply: apply works outside a repository
2009-11-22 16:19 Björn Gustavsson
@ 2009-11-22 17:28 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2009-11-22 17:28 UTC (permalink / raw)
To: Björn Gustavsson; +Cc: git
Björn Gustavsson <bgustavsson@gmail.com> writes:
> 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.
Thanks. I think the headline should also be reworded. It currently
reads:
Apply a patch on a git index file and/or a working tree
but historically and still in real life practices, when you use apply (as
opposed to am), you apply primarily to the files and optionally to the
index, so this should read something like:
Apply a patch to files and/or to the index
We could say "to files in the work tree", but that would give a wrong
impression that the files we talk about must be in a directory that is
part of the work tree of some repository, so it probably is better without
it.
The same comment applies to the beginning of the DESCRIPTION section. I
actually think your added text should reword the current two-liner there,
instead of being added at the bottom. Here is my attempt.
Reads supplied diff output (iow "a patch"), and applies it to files.
With --index (--cache) options, the patch is also (only) applied to
the index respectively. Without these options, the command applies
the patch only to files, and does not require them to be in a git
repository.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-22 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 19:43 [PATCH 2/4] apply: apply works outside a repository Björn Gustavsson
-- strict thread matches above, loose matches on Subject: below --
2009-11-22 16:19 Björn Gustavsson
2009-11-22 17:28 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.