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

Re: [PATCH v3] apply: --intent-to-add should imply --index

From
Junio C Hamano <gitster@pobox.com>
Date
May 1, 2025, 16:31 UTC
Message-ID
<xmqqmsbwxpfn.fsf@gitster.g>
In-Reply-To
<8a61dc13-0b7e-437d-b060-c17bff483c7a@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 7 quoted lines
>> Johannes Altmanninger submitted patch v3 titled "apply: --intent-to-add
>> should imply --index" to fix this issue.
>>
>> Is this fix merged? If so, which Git version includes this fix.
>
> I can’t find any commits by Johannes Altmanninger that addresses this.
> I also can’t find any commits that start with `apply: --intent-to-add`.
The documentation says this:
    --intent-to-add::
            When applying the patch only to the working tree, mark new
            files to be added to the index later (see `--intent-to-add`
            option in linkgit:git-add[1]). This option is ignored unless
            running in a Git repository and `--index` is not specified.
            Note that `--index` could be implied by other options such
            as `--cached` or `--3way`.

It is clear that whoever wrote it understands that for this option to be effective, the patch needs to affect the index, and one way to do so is for the user to pass `--index`. But at the same time, that is not the only option that makes the command touch the index (e.g., `--cached` does, too), and it would make it behave incorrectly if a patch automatically pretends that `--index` was given when this option was given.

I can't find the patch either, but given the above documentation, is it even still relevant?

Thanks.
Previous: Kristoffer HaugsbakkNext: Ryan Hodges
Message 3 of 14 in “RE: [PATCH v3] apply: --intent-to-add should imply --index”
  1. Jason ChoMay 1, 2025
  2. Kristoffer HaugsbakkMay 1, 2025
  3. Junio C HamanoMay 1, 2025
  4. Ryan HodgesMay 2, 2025
  5. Raymond E. PascoMay 3, 2025
  6. Raymond E. PascoMay 3, 2025
  7. 0/5 apply: fix apply --intent-to-addRaymond E. Pasco, May 11, 2025
  8. 1/5 apply: error on --intent-to-add outside gitdirRaymond E. Pasco, May 11, 2025
  9. 2/5 apply: read in the index in --intent-to-add modeRaymond E. Pasco, May 11, 2025
  10. Raymond E. PascoMay 12, 2025
  11. Jason ChoMay 13, 2025
  12. 3/5 apply: only write intents to add for new filesRaymond E. Pasco, May 11, 2025
  13. 4/5 t4140: test apply --intent-to-add interactionsRaymond E. Pasco, May 11, 2025
  14. 5/5 apply docs: clarify wording for --intent-to-addRaymond E. Pasco, May 11, 2025

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.