# [PATCH] [Outreachy] commit.c: remove leftover comment

2 messages from 2025-10-10 to 2025-10-11. Participants: Okhuomon Ajayi, Usman Akinyemi.
Thread: https://gitlist.dev/t/64297

## Okhuomon Ajayi, 2025-10-10 23:33

Subject: [PATCH] [Outreachy] commit.c: remove leftover comment
Message-ID: <20251010233303.783212-1-okhuomonajayi54@gmail.com>
URL: https://gitlist.dev/e/20251010233303.783212-1-okhuomonajayi54%40gmail.com

```
Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
 commit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/commit.c b/commit.c
index 16d91b2bfc..af20ca7c3d 100644
--- a/commit.c
+++ b/commit.c
@@ -475,10 +475,9 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
 	if (item->object.parsed)
 		return 0;
 	/*
-	 * Presumably this is leftover from an earlier failed parse;
-	 * clear it out in preparation for us re-parsing (we'll hit the
-	 * same error, but that's good, since it lets our caller know
-	 * the result cannot be trusted.
+	 * Reset the parent list before re-parsing to ensure a clear
+	 * commit state. This avoids carrying over data from a previous
+	 * incomplete or invalid parse.
 	 */
 	free_commit_list(item->parents);
 	item->parents = NULL;
-- 
2.43.0


```

## Usman Akinyemi, 2025-10-11 09:21

Subject: Re: [PATCH] [Outreachy] commit.c: remove leftover comment
Message-ID: <CAPSxiM-p_wVTe=a2fYSppcvbXxrOpqC5GotQ-5NYFh57+W8+bg@mail.gmail.com>
URL: https://gitlist.dev/e/CAPSxiM-p_wVTe%3Da2fYSppcvbXxrOpqC5GotQ-5NYFh57%2BW8%2Bbg%40mail.gmail.com
In-Reply-To: <20251010233303.783212-1-okhuomonajayi54@gmail.com>

```
On Sat, Oct 11, 2025 at 5:04 AM Okhuomon Ajayi
<okhuomonajayi54@gmail.com> wrote:
>
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
> ---
>  commit.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/commit.c b/commit.c
> index 16d91b2bfc..af20ca7c3d 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -475,10 +475,9 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
>         if (item->object.parsed)
>                 return 0;
>         /*
> -        * Presumably this is leftover from an earlier failed parse;
> -        * clear it out in preparation for us re-parsing (we'll hit the
> -        * same error, but that's good, since it lets our caller know
> -        * the result cannot be trusted.
> +        * Reset the parent list before re-parsing to ensure a clear
> +        * commit state. This avoids carrying over data from a previous
> +        * incomplete or invalid parse.
>          */
>         free_commit_list(item->parents);
>         item->parents = NULL;
> --
> 2.43.0
>
In one of your previous patches, Junio said and I quote:

"And the proposed commit log message should describe what the problem
is, why it matters, and how the updated code is better than the
current state of the code."

This is very important when sending a patch to the Git mailing list.
Your patches are not complete without it. You can check previous
patches to see how it is being done by other contributors.

>

```
