All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Raymond E. Pasco" <ray@ameretat.dev>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/5] apply: only write intents to add for new files
Date: Mon, 30 Jun 2025 11:53:16 -0700	[thread overview]
Message-ID: <xmqq7c0t12oz.fsf@gitster.g> (raw)
In-Reply-To: <20250628225819.1294068-5-ray@ameretat.dev> (Raymond E. Pasco's message of "Sat, 28 Jun 2025 18:52:05 -0400")

"Raymond E. Pasco" <ray@ameretat.dev> writes:

> In the "update only the worktree" mode, the index should not be touched
> except to record intents to add when --intent-to-add is on. Because
> having --intent-to-add on sets update_index, to indicate that we are
> touching the index, we can't rely only on that flag to decide whether to
> write an index entry.

Does that let us inspect state->ita_only alone and conclude that
state->update_index is set, though?  IOW ...

>  	if (patch->conflicted_threeway)
>  		return add_conflicted_stages_file(state, patch);
> -	else if (state->update_index)
> +	else if (state->check_index || (state->ita_only && patch->is_new > 0))

... I would have expected the new code to check not just ita_only but
check ita_only only when update_index is in effect.


>  		return add_index_file(state, path, mode, buf, size);
>  	return 0;
>  }

  reply	other threads:[~2025-06-30 18:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-28 22:52 [PATCH 0/5] fix apply --intent-to-add Raymond E. Pasco
2025-06-28 22:52 ` [PATCH 1/5] apply: error on --intent-to-add outside gitdir Raymond E. Pasco
2025-06-30 18:34   ` Junio C Hamano
2025-07-01  5:26     ` Raymond E. Pasco
2025-06-28 22:52 ` [PATCH 2/5] apply: read in the index in --intent-to-add mode Raymond E. Pasco
2025-06-30 18:47   ` Junio C Hamano
2025-07-01  5:32     ` Raymond E. Pasco
2025-06-28 22:52 ` [PATCH 3/5] apply: only write intents to add for new files Raymond E. Pasco
2025-06-30 18:53   ` Junio C Hamano [this message]
2025-07-01  5:44     ` Raymond E. Pasco
2025-06-28 22:52 ` [PATCH 4/5] t4140: test apply --intent-to-add interactions Raymond E. Pasco
2025-06-28 22:52 ` [PATCH 5/5] apply docs: clarify wording for --intent-to-add Raymond E. Pasco
2025-06-29  3:10 ` [PATCH 0/5] fix apply --intent-to-add Lidong Yan
2025-06-30  0:56   ` Raymond E. Pasco
2025-07-02 21:26 ` [PATCH v2 0/4] " Raymond E. Pasco
2025-07-02 21:26   ` [PATCH v2 1/4] apply: read in the index in --intent-to-add mode Raymond E. Pasco
2025-07-02 21:26   ` [PATCH v2 2/4] apply: only write intents to add for new files Raymond E. Pasco
2025-07-02 21:26   ` [PATCH v2 3/4] t4140: test apply --intent-to-add interactions Raymond E. Pasco
2025-07-02 21:26   ` [PATCH v2 4/4] apply docs: clarify wording for --intent-to-add Raymond E. Pasco
2025-07-07 12:12   ` [PATCH v3 0/4] fix apply --intent-to-add Raymond E. Pasco
2025-07-07 12:12     ` [PATCH v3 1/4] apply: read in the index in --intent-to-add mode Raymond E. Pasco
2025-07-07 12:12     ` [PATCH v3 2/4] apply: only write intents to add for new files Raymond E. Pasco
2025-07-07 12:12     ` [PATCH v3 3/4] t4140: test apply --intent-to-add interactions Raymond E. Pasco
2025-07-07 12:12     ` [PATCH v3 4/4] apply docs: clarify wording for --intent-to-add Raymond E. Pasco
2025-07-07 17:51     ` [PATCH v3 0/4] fix apply --intent-to-add Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2025-05-03  3:51 [PATCH v3] apply: --intent-to-add should imply --index Raymond E. Pasco
2025-05-11  0:36 ` [PATCH 0/5] apply: fix apply --intent-to-add Raymond E. Pasco
2025-05-11  0:36   ` [PATCH 3/5] apply: only write intents to add for new files Raymond E. Pasco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7c0t12oz.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ray@ameretat.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.