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

git add intent-to-add then git add patch no longer allows edit

From
TSThomas Sullivan <tom@msbit.com.au>
Date
Aug 21, 2020, 04:27 UTC
Message-ID
<CAB+jsAW_+NTJjDLG9uMrf4cc5rcwHLD5kTLk7QgvFCgryb22Gw@mail.gmail.com>
What did you do before the bug happened? (Steps to reproduce your issue)
    rm -rf .git
    cat << EOF > file
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
    EOF
    git init .
    git add --intent-to-add file
    git add --patch file
What did you expect to happen? (Expected behavior)
To be able to edit the single hunk (`e` option)
What happened instead? (Actual behavior)

The `e` option isn't available (and providing it anyway errors with `Sorry, cannot edit this hunk`)

Anything else you want to add:
Output of version 2.28.0:
    diff --git a/file b/file
    index 0000000..85e73d4
    --- /dev/null
    +++ b/file
    new file mode 100644
    @@ -0,0 +1 @@
    +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
    (1/1) Stage addition [y,n,q,a,d,?]?
Output of version 2.27.0:
    diff --git a/file b/file
    index e69de29..85e73d4 100644
    --- a/file
    +++ b/file
    @@ -0,0 +1 @@
    +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
    (1/1) Stage this hunk [y,n,q,a,d,e,?]?

Bisecting between the two tags reports this commit as the one introducing the change:

    [feea6946a5b746ff4ebf8ccdf959e303203a6011] diff-files: treat
"i-t-a" files as "not-in-index"

[System Info] git version: git version 2.28.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 18 21:21:34 PDT 2020; root:xnu-4570.71.82.5~1/RELEASE_X86_64 x86_64 compiler info: clang: 10.0.0 (clang-1000.10.44.4) libc info: no libc information available $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks]
Regards,
Tom Sullivan

Head Developer Most Significant Bit Software

e: tom@msbit.com.au p: +61 407 890 821

Next: Raymond E. Pasco
Message 1 of 16 in “git add intent-to-add then git add patch no longer allows edit”
  1. Thomas SullivanAug 21, 2020
  2. Raymond E. PascoAug 21, 2020
  3. Junio C HamanoAug 21, 2020
  4. Phillip WoodAug 23, 2020
  5. Raymond E. PascoAug 24, 2020
  6. Phillip WoodAug 24, 2020
  7. Raymond E. PascoAug 24, 2020
  8. Phillip WoodSep 4, 2020
  9. Johannes SchindelinSep 4, 2020
  10. Junio C HamanoSep 6, 2020
  11. Phillip WoodSep 7, 2020
  12. Junio C HamanoSep 8, 2020
  13. Johannes SchindelinSep 8, 2020
  14. Junio C HamanoSep 8, 2020
  15. Phillip WoodSep 9, 2020
  16. Raymond E. PascoSep 5, 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.