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

Re: [PATCH 2/5] apply: read in the index in --intent-to-add mode

From
Raymond E. Pasco <ray@ameretat.dev>
Date
May 12, 2025, 02:13 UTC
Message-ID
<gz4sl3e3nqmkamkfmoktlqaefxteamj6v3fcs7dbavgys7ubng@utz2i5ahl77f>
In-Reply-To
<20250511003955.242889-3-ray@ameretat.dev>
On 25/05/10 08:36PM, Raymond E. Pasco wrote:
Show 17 quoted lines
> diff --git a/apply.c b/apply.c
> index 5e39cadde4..3bde54a04a 100644
> --- a/apply.c
> +++ b/apply.c
> @@ -4837,7 +4837,7 @@ static int apply_patch(struct apply_state *state,
>  					       LOCK_DIE_ON_ERROR);
>  	}
>  
> -	if (state->check_index && read_apply_cache(state) < 0) {
> +	if (state->update_index && read_apply_cache(state) < 0) {
>  		error(_("unable to read index file"));
>  		res = -128;
>  		goto end;
> -- 
> 2.49.0.1106.gc0efa3ba58
> 
> 

For some reason, this causes checkout -p to break in a way which which I don't understand. Directly using (state->check_index || state->ita_only) doesn't break it, but because it doesn't seem logically possible to me for this to change any behavior besides behavior when ita_only is on (the update_index flag is in fact set just a few lines above!), I want to investigate a bit further to find out what I'm confused about.

Either way, reroll coming, though I'd still appreciate review on the series in general.

Previous: Raymond E. PascoNext: Jason Cho
Message 10 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.