Re: [PATCH 05/14] diff: add a comment about combine_diff_path.parent.path
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jan 13, 2025, 15:40 UTC
- Message-ID
- <Z4Uz56BZG19rOnRA@pks.im>
- In-Reply-To
- <20250109084248.GE2748836@coredump.intra.peff.net>
On Thu, Jan 09, 2025 at 03:42:48AM -0500, Jeff King wrote:
Show 27 quoted lines
> We only fill in the per-parent "path" field when it differs from what's
> in combine_diff_path.path (and even then only when the option is
> appropriate). Let's document that.
>
> Suggested-by: Wink Saville <wink@saville.com>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> diff.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/diff.h b/diff.h
> index f5f6ea00fb..60e7db4ad6 100644
> --- a/diff.h
> +++ b/diff.h
> @@ -480,6 +480,12 @@ struct combine_diff_path {
> char status;
> unsigned int mode;
> struct object_id oid;
> + /*
> + * This per-parent path is filled only when doing a combined
> + * diff with revs.combined_all_paths set, and only if the path
> + * differs from the post-image (e.g., a rename or copy).
> + * Otherwise it is left NULL.
> + */
> char *path;
> } parent[FLEX_ARRAY];
> };I feel like this change would've neatly fit into the preceding commit, but don't mind it much either way.
Patrick