git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-apply does not work in a sub-directory of a Git repository

From
Mehul Jain <mehul.jain2029@gmail.com>
Date
Mar 23, 2016, 17:24 UTC
Message-ID
<CA+DCAeSE4CS8zg1tHP5kYOs-CbGk0uAzWX9Zh9Fk3O7mYwYTMQ@mail.gmail.com>
In-Reply-To
<xmqqbn65dxtl.fsf@gitster.mtv.corp.google.com>
On Wed, Mar 23, 2016 at 8:51 PM, Junio C Hamano <gitster@pobox.com> wrote:
> I think we do have --no-index (which is why I am largely ignoring
> the rest of your message as uninformed speculation for now).

--no-index command line flag is there for git-apply but unfortunately not documented.

Also *auto-completion* for "git apply --no-index" doesn't work.
That is
    git apply --no-i<tab><tab>
should be auto completed and give
   git apply --no-index.
Probably following change will remove this problem.
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index 45ec47f..860dae0 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -886,7 +886,7 @@ _git_apply ()
                ;;
        --*)
                __gitcomp "
-                       --stat --numstat --summary --check --index
+                       --stat --numstat --summary --check --index --no-index
                        --cached --index-info --reverse --reject --unidiff-zero
                        --apply --no-add --exclude=
                        --ignore-whitespace --ignore-space-change
Previous: Junio C Hamano
Message 18 of 18 in “git-apply does not work in a sub-directory of a Git repository”
  1. Mehul JainMar 22, 2016
  2. Stefan BellerMar 22, 2016
  3. Duy NguyenMar 23, 2016
  4. Junio C HamanoMar 23, 2016
  5. Junio C HamanoMar 23, 2016
  6. Duy NguyenMar 24, 2016
  7. Nguyễn Thái Ngọc DuyMar 24, 2016
  8. 1/4 git-apply.txt: remove a spaceNguyễn Thái Ngọc Duy, Mar 24, 2016
  9. 2/4 git-apply.txt: mention the behavior inside a subdirNguyễn Thái Ngọc Duy, Mar 24, 2016
  10. 3/4 apply: add --whole to apply git patch without prefix filteringNguyễn Thái Ngọc Duy, Mar 24, 2016
  11. 4/4 apply: report patch skipping in verbose modeNguyễn Thái Ngọc Duy, Mar 24, 2016
  12. Junio C HamanoMar 24, 2016
  13. Junio C HamanoMar 24, 2016
  14. Duy NguyenMar 30, 2016
  15. Junio C HamanoMar 30, 2016
  16. Duy NguyenMar 30, 2016
  17. Junio C HamanoMar 24, 2016
  18. Mehul JainMar 23, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.