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

No edit option when "git add --patch" a new file

From
YYYuchen Ying <ych@google.com>
Date
Sep 8, 2020, 16:16 UTC
Message-ID
<CAF6j4hcSEhNvS-DYgNLNn3TdH1vkhgHZRC0fqWer_XM0PQxgYA@mail.gmail.com>
Hi list,

I was attempting to "add --patch" a newly created file but the "edit" option is not provided.

Steps to reproduce this problem:

$ echo "test\ntest" > test $ git add -N test $ git add -p test

Expected: e is an option
Got:
$ git add -p
diff --git a/terraform/test b/terraform/test
index 0000000..992533b
--- /dev/null
+++ b/terraform/test
new file mode 100644
@@ -0,0 +1,2 @@
+asdf
+asdf
(1/1) Stage addition [y,n,q,a,d,?]? e
Sorry, cannot edit this hunk
Next: Phillip Wood
Message 1 of 2 in “No edit option when "git add --patch" a new file”
  1. Yuchen YingSep 8, 2020
  2. Phillip WoodSep 9, 2020

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.