Thread View: linux.kernel.git
18 messages
18 total messages
Started by kerylefondji7
Mon, 19 Oct 2026 08:44
[PATCH] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Mon, 19 Oct 2026 08:44
Date: Mon, 19 Oct 2026 08:44
28 lines
8458 bytes
8458 bytes
From: Keryle Fondji <kerylefondji7@gmail.com>
The error message used "chars" even when pathlen was 1.
Replace _() with Q_() to handle both singular and plural forms
correctly depending on the value of pathlen.
Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
---
archive-zip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/archive-zip.c b/archive-zip.c
index 6f73ca6d58..e4f8ef5a36 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -328,7 +328,7 @@ static int write_zip_entry(struct archiver_args *args,
}
if (pathlen > 0xffff) {
- return error(_("path too long (%d chars, SHA1: %s): %s"),
+ return error(Q_("path too long (%d char, SHA1: %s): %s", "path too long (%d chars, SHA1: %s): %s", pathlen),
(int)pathlen, oid_to_hex(oid), path);
}
--
2.53.0
Re: [PATCH] archive-zip: refactor 'path too long' error message to use Q_()
Author: Phillip Wood
Date: Mon, 19 Oct 2026 13:58
Date: Mon, 19 Oct 2026 13:58
51 lines
9778 bytes
9778 bytes
Hi Keryle
On 19/10/2026 09:44, kerylefondji7@gmail.com wrote:
> From: Keryle Fondji <kerylefondji7@gmail.com>
>
> The error message used "chars" even when pathlen was 1.
Looking at the code below, pathlen has to be longer than 0xffff to
trigger this message. However there can be more than one form of the
plural string though. The gettext manual has the following example of
the Polish translation of "file" for different numbers of files [1]
1 plik
2,3,4 pliki
5-21 plików
22-24 pliki
25-31 plików
so using Q_() is correct, but we should explain that it is to
accommodate different plural forms, rather than because pathlen can be 1.
Thanks
Phillip
[1]
https://www.gnu.org/software/gettext/manual/gettext.html#Additional-functions-for-plural-forms
>
> Replace _() with Q_() to handle both singular and plural forms
> correctly depending on the value of pathlen.
>
> Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
> ---
> archive-zip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/archive-zip.c b/archive-zip.c
> index 6f73ca6d58..e4f8ef5a36 100644
> --- a/archive-zip.c
> +++ b/archive-zip.c
> @@ -328,7 +328,7 @@ static int write_zip_entry(struct archiver_args *args,
> }
>
> if (pathlen > 0xffff) {
> - return error(_("path too long (%d chars, SHA1: %s): %s"),
> + return error(Q_("path too long (%d char, SHA1: %s): %s", "path too long (%d chars, SHA1: %s): %s", pathlen),
> (int)pathlen, oid_to_hex(oid), path);
> }
>
Re: [PATCH] archive-zip: refactor 'path too long' error message to use Q_()
Author: Junio C Hamano
Date: Mon, 19 Oct 2026 21:12
Date: Mon, 19 Oct 2026 21:12
53 lines
14341 bytes
14341 bytes
Phillip Wood <phillip.wood123@gmail.com> writes:
> Hi Keryle
>
> On 19/10/2026 09:44, kerylefondji7@gmail.com wrote:
>> From: Keryle Fondji <kerylefondji7@gmail.com>
>>
>> The error message used "chars" even when pathlen was 1.
>
> Looking at the code below, pathlen has to be longer than 0xffff to
> trigger this message. However there can be more than one form of the
> plural string though. The gettext manual has the following example of
> the Polish translation of "file" for different numbers of files [1]
>
> 1 plik
> 2,3,4 pliki
> 5-21 plików
> 22-24 pliki
> 25-31 plików
>
> so using Q_() is correct, but we should explain that it is to
> accommodate different plural forms, rather than because pathlen can be 1.
Good.
>> Replace _() with Q_() to handle both singular and plural forms
>> correctly depending on the value of pathlen.
This is written better.
>> Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
>> ---
>> archive-zip.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/archive-zip.c b/archive-zip.c
>> index 6f73ca6d58..e4f8ef5a36 100644
>> --- a/archive-zip.c
>> +++ b/archive-zip.c
>> @@ -328,7 +328,7 @@ static int write_zip_entry(struct archiver_args *args,
>> }
>>
>> if (pathlen > 0xffff) {
>> - return error(_("path too long (%d chars, SHA1: %s): %s"),
>> + return error(Q_("path too long (%d char, SHA1: %s): %s", "path too long (%d chars, SHA1: %s): %s", pathlen),
>> (int)pathlen, oid_to_hex(oid), path);
This is overly long and must be line-wrapped.
>> }
>>
[PATCH v3 0/1] archive-zip: refactor 'path too long' error message
Author: kerylefondji7
Date: Tue, 20 Oct 2026 10:22
Date: Tue, 20 Oct 2026 10:22
14 lines
10717 bytes
10717 bytes
From: Keryle Fondji <kerylefondji7@gmail.com> This v3 addresses the review feedback by wrapping the overly long line in archive-zip.c, while keeping the proper use of Q_() for plural forms. Keryle Fondji (1): archive-zip: refactor 'path too long' error message to use Q_() archive-zip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.53.0
[PATCH v3 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Tue, 20 Oct 2026 10:22
Date: Tue, 20 Oct 2026 10:22
32 lines
11455 bytes
11455 bytes
From: Keryle Fondji <kerylefondji7@gmail.com>
Replace _() with Q_() in the 'path too long' error message. Although
pathlen is always greater than 0xffff when this error is hit, Q_() is
required to support correct translation for languages that require
different plural forms depending on the count.
Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
---
archive-zip.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/archive-zip.c b/archive-zip.c
index 6f73ca6d58..9df49ae160 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
}
if (pathlen > 0xffff) {
- return error(_("path too long (%d chars, SHA1: %s): %s"),
- (int)pathlen, oid_to_hex(oid), path);
+ return error(Q_("path too long (%d char, SHA1: %s): %s",
+ "path too long (%d chars, SHA1: %s): %s",
+ pathlen),
+ (int)pathlen, oid_to_hex(oid), path);
}
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
--
2.53.0
Re: [PATCH v3 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: Phillip Wood
Date: Tue, 20 Oct 2026 15:05
Date: Tue, 20 Oct 2026 15:05
37 lines
12162 bytes
12162 bytes
Hi Keryle
On 20/10/2026 11:22, kerylefondji7@gmail.com wrote:
> From: Keryle Fondji <kerylefondji7@gmail.com>
>
> @@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
> }
>
> if (pathlen > 0xffff) {
> - return error(_("path too long (%d chars, SHA1: %s): %s"),
> - (int)pathlen, oid_to_hex(oid), path);
> + return error(Q_("path too long (%d char, SHA1: %s): %s",
> + "path too long (%d chars, SHA1: %s): %s",
> + pathlen),
> + (int)pathlen, oid_to_hex(oid), path);
The indentation seems to have got messed up here, the level is wrong and
it seems to contain spaces as well - if I apply the patch I see
Applying: archive-zip: refactor 'path too long' error message to use Q_()
.git/rebase-apply/patch:17: indent with spaces.
pathlen),
warning: 1 line applied after fixing whitespace errors.
The code should be wrapped so that lines are not much longer than 80
characters and should be indented with tabs (possibly followed by a few
spaces so that the arguments are aligned).
Thanks
Phillip
> }
>
> if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
[PATCH v4 0/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Tue, 20 Oct 2026 18:39
Date: Tue, 20 Oct 2026 18:39
18 lines
10862 bytes
10862 bytes
From: Keryle Fondji <kerylefondji7@gmail.com> In v4: - Fix code indentation by using tabs instead of spaces. - Align Q_() arguments with spaces under the open parenthesis. - Ensure line lengths remain strictly under 80 characters. Thanks to reviewers for the feedback! Keryle Fondji (1): archive-zip: refactor 'path too long' error message to use Q_() archive-zip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.53.0
[PATCH v4 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Tue, 20 Oct 2026 18:39
Date: Tue, 20 Oct 2026 18:39
32 lines
11514 bytes
11514 bytes
From: Keryle Fondji <kerylefondji7@gmail.com>
Replace _() with Q_() in the 'path too long' error message. Although
pathlen is always greater than 0xffff when this error is hit, Q_() is
required to support correct translation for languages that require
different plural forms depending on the count.
Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
---
archive-zip.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/archive-zip.c b/archive-zip.c
index 6f73ca6d58..5ab3ba786f 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
}
if (pathlen > 0xffff) {
- return error(_("path too long (%d chars, SHA1: %s): %s"),
- (int)pathlen, oid_to_hex(oid), path);
+ return error(Q_("path too long (%d char, SHA1: %s): %s",
+ "path too long (%d chars, SHA1: %s): %s",
+ pathlen),
+ (int)pathlen, oid_to_hex(oid), path);
}
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
--
2.53.0
Re: [PATCH v4] archive-zip: refactor 'path too long' error
Author: kerylefondji7
Date: Thu, 22 Oct 2026 10:28
Date: Thu, 22 Oct 2026 10:28
12 lines
10650 bytes
10650 bytes
Hi everyone, Just following up on this v4 patch to check if any further changes are needed. If the patch looks good as is, please let me know if it would be okay for me to start working on another microproject in the meantime. Thanks, Keryle
Re: [PATCH v4 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: Phillip Wood
Date: Thu, 22 Oct 2026 14:29
Date: Thu, 22 Oct 2026 14:29
34 lines
11965 bytes
11965 bytes
Hi Keryle
On 20/10/2026 19:39, kerylefondji7@gmail.com wrote:
>
> diff --git a/archive-zip.c b/archive-zip.c
> index 6f73ca6d58..5ab3ba786f 100644
> --- a/archive-zip.c
> +++ b/archive-zip.c
> @@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
> }
>
> if (pathlen > 0xffff) {
> - return error(_("path too long (%d chars, SHA1: %s): %s"),
> - (int)pathlen, oid_to_hex(oid), path);
> + return error(Q_("path too long (%d char, SHA1: %s): %s",
> + "path too long (%d chars, SHA1: %s): %s",
> + pathlen),
> + (int)pathlen, oid_to_hex(oid), path);
The indentation is still messed up. If you look at the deleted lines you can see that
we've lost a level of indentation inside the "if" block and the function arguments no
longer line up. It should look like
if (pathlen > 0xffff) {
return error(Q_("path too long (%d char, SHA1: %s): %s",
"path too long (%d chars, SHA1: %s): %s",
pathlen),
(int)pathlen, oid_to_hex(oid), path);
}
Thanks
Phillip
Re: [PATCH v4 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: Junio C Hamano
Date: Thu, 22 Oct 2026 17:41
Date: Thu, 22 Oct 2026 17:41
45 lines
14309 bytes
14309 bytes
Phillip Wood <phillip.wood123@gmail.com> writes:
> Hi Keryle
>
> On 20/10/2026 19:39, kerylefondji7@gmail.com wrote:
>>
>> diff --git a/archive-zip.c b/archive-zip.c
>> index 6f73ca6d58..5ab3ba786f 100644
>> --- a/archive-zip.c
>> +++ b/archive-zip.c
>> @@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
>> }
>>
>> if (pathlen > 0xffff) {
>> - return error(_("path too long (%d chars, SHA1: %s): %s"),
>> - (int)pathlen, oid_to_hex(oid), path);
>> + return error(Q_("path too long (%d char, SHA1: %s): %s",
>> + "path too long (%d chars, SHA1: %s): %s",
>> + pathlen),
>> + (int)pathlen, oid_to_hex(oid), path);
>
> The indentation is still messed up. If you look at the deleted lines you can see that
> we've lost a level of indentation inside the "if" block and the function arguments no
> longer line up. It should look like
>
> if (pathlen > 0xffff) {
> return error(Q_("path too long (%d char, SHA1: %s): %s",
> "path too long (%d chars, SHA1: %s): %s",
> pathlen),
> (int)pathlen, oid_to_hex(oid), path);
> }
>
> Thanks
Thanks. Just in case Keryle is reading the message in a terminal or
webmail app with variable width fonts, the easiest way to see what
is wrong in the posted patch is to visit
https://lore.kernel.org/git/57e076d3-cfea-475d-b68d-a9f36746db35@gmail.com/
which should show the patch in fixed-width font and even uses real
tab chars properly (so you can click-hold on the left end of a line
and move your mouse right to highlight the indentation to tell the
difference between a run of spaces and a tab).
[PATCH v5 0/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Fri, 23 Oct 2026 12:03
Date: Fri, 23 Oct 2026 12:03
21 lines
11339 bytes
11339 bytes
From: Keryle Fondji <kerylefondji7@gmail.com> This v5 corrects the line alignment and indentation issues reported by Phillip Wood and Junio C Hamano: - Pure tabs are used for structural indentation on all primary lines. - Tabs combined with spaces are used for alignment on the continuation line ((int)pathlen...) to align arguments under the opening parenthesis. In previous attempts, mixing tabs and spaces incorrectly caused formatting errors, but this structure now matches the expected Git style. Keryle Fondji (1): archive-zip: refactor 'path too long' error message to use Q_() archive-zip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.53.0
[PATCH v5 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Fri, 23 Oct 2026 12:03
Date: Fri, 23 Oct 2026 12:03
34 lines
11817 bytes
11817 bytes
From: Keryle Fondji <kerylefondji7@gmail.com>
Replace _() with Q_() in the 'path too long' error message. Although
pathlen is always greater than 0xffff when this error is hit, Q_() is
required to support correct translation for languages that require
different plural forms depending on the count.
Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
---
archive-zip.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/archive-zip.c b/archive-zip.c
index 5ab3ba786f..160efd878f 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -328,10 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
}
if (pathlen > 0xffff) {
- return error(Q_("path too long (%d char, SHA1: %s): %s",
- "path too long (%d chars, SHA1: %s): %s",
- pathlen),
- (int)pathlen, oid_to_hex(oid), path);
+ return error(Q_("path too long (%d char, SHA1: %s): %s",
+ "path too long (%d chars, SHA1: %s): %s",
+ pathlen),
+ (int)pathlen, oid_to_hex(oid), path);
}
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
--
2.53.0
Re: [PATCH v5 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: Phillip Wood
Date: Fri, 23 Oct 2026 15:09
Date: Fri, 23 Oct 2026 15:09
32 lines
12218 bytes
12218 bytes
Hi Keryle
On 23/10/2026 13:03, kerylefondji7@gmail.com wrote:
>
> diff --git a/archive-zip.c b/archive-zip.c
> index 5ab3ba786f..160efd878f 100644
> --- a/archive-zip.c
> +++ b/archive-zip.c
> @@ -328,10 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
> }
>
> if (pathlen > 0xffff) {
> - return error(Q_("path too long (%d char, SHA1: %s): %s",
> - "path too long (%d chars, SHA1: %s): %s",
> - pathlen),
> - (int)pathlen, oid_to_hex(oid), path);
> + return error(Q_("path too long (%d char, SHA1: %s): %s",
> + "path too long (%d chars, SHA1: %s): %s",
> + pathlen),
> + (int)pathlen, oid_to_hex(oid), path);
The indentation looks good, but this does not apply to master. When you
get feedback about a patch, you should send an amended patch that
applies to master, not a fix that applies on top of the patch you
previously sent. If a patch series contains more than one patch, you can
use "git rebase -i" to prepare the new version. If there is a single
patch like this series you can use "git commit --amend".
Thanks
Phillip
[PATCH v6 0/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Fri, 23 Oct 2026 21:38
Date: Fri, 23 Oct 2026 21:38
29 lines
11666 bytes
11666 bytes
From: Keryle Fondji <kerylefondji7@gmail.com> This v6 addresses the feedback from Phillip Wood regarding commit structure and patch applicability. In previous attempts (like v5), the diff showed 4 deletions and 4 insertions because it was compared against prior iteration attempts. Since this v6 is flattened into a single clean commit applied directly on top of master, the diff naturally shows 2 deletions (-) (removing the original master lines) and 4 insertions (+) (adding the complete Q_() structure with correct tab/space alignments). Summary of changes in v6: - Rebased as a single commit directly on top of master. - Maintained the exact indentation approved in v5. - Cleaned up unrelated modifications from the working directory. Thanks again to Phillip Wood and Junio C Hamano for their guidance Keryle Fondji (1): archive-zip: refactor 'path too long' error message to use Q_() archive-zip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.53.0
[PATCH v6 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Fri, 23 Oct 2026 21:38
Date: Fri, 23 Oct 2026 21:38
26 lines
11420 bytes
11420 bytes
From: Keryle Fondji <kerylefondji7@gmail.com>
---
archive-zip.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/archive-zip.c b/archive-zip.c
index 6f73ca6d58..160efd878f 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -328,8 +328,10 @@ static int write_zip_entry(struct archiver_args *args,
}
if (pathlen > 0xffff) {
- return error(_("path too long (%d chars, SHA1: %s): %s"),
- (int)pathlen, oid_to_hex(oid), path);
+ return error(Q_("path too long (%d char, SHA1: %s): %s",
+ "path too long (%d chars, SHA1: %s): %s",
+ pathlen),
+ (int)pathlen, oid_to_hex(oid), path);
}
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
--
2.53.0
Re: [PATCH v6 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: kerylefondji7
Date: Mon, 26 Oct 2026 17:24
Date: Mon, 26 Oct 2026 17:24
11 lines
10974 bytes
10974 bytes
Hi everyone, Just a gentle follow-up on this v6 patch. I have rebased the commit directly on top of master as suggested by Phillip, ensuring a clean single-commit structure and proper indentation. Please let me know if this version looks good to you or if any further adjustments are needed. Thank you for your time and guidance! Best regards, Keryle
Re: [PATCH v6 1/1] archive-zip: refactor 'path too long' error message to use Q_()
Author: Junio C Hamano
Date: Mon, 26 Oct 2026 17:33
Date: Mon, 26 Oct 2026 17:33
24 lines
13374 bytes
13374 bytes
kerylefondji7@gmail.com writes: > Hi everyone, > > Just a gentle follow-up on this v6 patch. I have rebased the commit directly on top of master as suggested by Phillip, ensuring a clean single-commit structure and proper indentation. > > Please let me know if this version looks good to you or if any further adjustments are needed. > > Thank you for your time and guidance! > > Best regards, > Keryle It is not so friendly to send a reply to v4's review when the one you want people to take a look at is v6, though. According to Documentation/SubmittingPatches https://lore.kernel.org/git/20261023213813.3318-2-kerylefondji7@gmail.com/ is not ready. No commit log message to explain and justify the changes, and it is not signed-off. The shape of the submission looked nicer in v5 iteration in this regard.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads