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

Re: [PATCH 1/2] FIX: use utf8_strnwidth for line_prefix in diff.c

From
Christian Couder <christian.couder@gmail.com>
Date
Jan 24, 2024, 20:01 UTC
Message-ID
<CAP8UFD2oxpefhGtH61wZvcHEvd24jtu_ZBVsnNZMjD2aM_NDcg@mail.gmail.com>
In-Reply-To
<ac9338533c9096c090d1463c1b29505bde019731.1706105064.git.gitgitgadget@gmail.com>

On Wed, Jan 24, 2024 at 3:04 PM Md Isfarul Haque via GitGitGadget <gitgitgadget@gmail.com> wrote:

>
> From: Md Isfarul Haque <isfarul.876@gmail.com>
>
> This patch adresses diff.c:2721 and proposes the fix using a new function.

Please give more details here about what is currently at diff.c:2721 and what the patch is fixing, as lines at diff.c:2721 could move to a different location if some changes are made to diff.c before your patches get merged or after they get merged.

Also if the patch is addressing an issue in a code comment I would expect the corresponding code comment to be removed by the patch.

About the subject, maybe "diff: use utf8_strnwidth() for line_prefix" is already better.

Show 15 quoted lines
> Signed-off-by: Md Isfarul Haque <isfarul.876@gmail.com>
> ---
>  diff.c | 18 ++++++++++++++++--
>  diff.h |  1 +
>  2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index a89a6a6128a..e3223b8ce5b 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -2300,6 +2300,20 @@ const char *diff_line_prefix(struct diff_options *opt)
>         return msgbuf->buf;
>  }
>
> +const struct strbuf *diff_line_prefix_buf(struct diff_options *opt)
This function seems to be used only in diff.c, so it could be static.
Previous: Md Isfarul Haque via GitGitGadgetNext: Md Isfarul Haque
Message 3 of 9 in “FIX: use utf8_strnwidth for line_prefix in diff.c”
  1. 0/2 [GSoC][RFC/Patch] FIX: use utf8_strnwidth for line_prefix in diff.cMd Isfarul Haque via GitGitGadget, Jan 24, 2024
  2. 1/2 FIX: use utf8_strnwidth for line_prefix in diff.cMd Isfarul Haque via GitGitGadget, Jan 24, 2024
  3. Christian CouderJan 24, 2024
  4. Md Isfarul HaqueJan 25, 2024
  5. Junio C HamanoJan 24, 2024
  6. Md Isfarul HaqueJan 25, 2024
  7. 2/2 FIX memory leak in one branchMd Isfarul Haque via GitGitGadget, Jan 24, 2024
  8. Junio C HamanoJan 24, 2024
  9. Junio C HamanoJan 24, 2024

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.