Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Björn Gustavsson" <bgustavsson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/4] apply: apply works outside a repository
Date: Sun, 22 Nov 2009 09:28:59 -0800	[thread overview]
Message-ID: <7v3a46ii3o.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 4B0964A1.2040302@gmail.com

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.

  reply	other threads:[~2009-11-22 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 16:19 [PATCH 2/4] apply: apply works outside a repository Björn Gustavsson
2009-11-22 17:28 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-11-22 19:43 Björn Gustavsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v3a46ii3o.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=bgustavsson@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox