Repository navigation
sideband: skip unrecognized allowControlCharacters keywords - #2261
Open
thomasbachem wants to merge 1 commit into
Open
thomasbachem wants to merge 1 commit into
thomasbachem wants to merge 1 commit into
Conversation
Since 1289144 (sideband: add options to allow more control sequences to be passed through, 2026-03-05), the value of sideband.allowControlCharacters is a comma-separated list of keywords. When the parser meets a keyword it does not know, it warns but stays on that keyword, so the warning repeats forever. As the setting is read whenever a transport is set up, a typo like "colour", a list written as "color, cursor" with a space, or a keyword that only a newer version of Git knows is enough to make every fetch, push, clone and ls-remote hang this way. Move on to the next keyword after the warning, and name only the unrecognized keyword in it, not the rest of the list. Assisted-by: Claude Opus 5.5 Signed-off-by: Thomas Bachem <mail@thomasbachem.com>
Author
|
/preview |
|
Preview email sent as pull.2261.git.1792148387473.gitgitgadget@gmail.com |
Author
|
/submit |
|
Submitted as pull.2261.git.1792154374653.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
Tuomas Ahola wrote on the Git mailing list (how to reply to this email): "Thomas Bachem via GitGitGadget" <gitgitgadget@gmail.com> wrote:
> + warning(_("unrecognized value for '%s': '%.*s'"),
> + var, (int)(end - value), value);
> + value = end + !!*end;
> + }
Reading CodingGuidelines, it seems that `!!` is a construct we would
like to avoid:
- Some clever tricks, like using the !! operator with arithmetic
constructs, can be extremely confusing to others. Avoid them,
unless there is a compelling reason to use them.
--Tuomas |
|
User |
|
Thomas Bachem wrote on the Git mailing list (how to reply to this email): Tuomas Ahola <taahol@utu.fi> wrote:
>> + value = end + !!*end;
>
> Reading CodingGuidelines, it seems that `!!` is a construct we would
> like to avoid:
I wrote it this way to match skip_prefix_in_csv() a few lines above,
which steps past the comma the same way:
*out = value + !!*value;
so the two places in this parser read alike. Happy to spell it out as a
conditional in a v2 if that's preferred, though.
Thomas |
|
Junio C Hamano wrote on the Git mailing list (how to reply to this email): Tuomas Ahola <taahol@utu.fi> writes:
> "Thomas Bachem via GitGitGadget" <gitgitgadget@gmail.com> wrote:
>
>> + warning(_("unrecognized value for '%s': '%.*s'"),
>> + var, (int)(end - value), value);
>> + value = end + !!*end;
>> + }
>
> Reading CodingGuidelines, it seems that `!!` is a construct we would
> like to avoid:
>
> - Some clever tricks, like using the !! operator with arithmetic
> constructs, can be extremely confusing to others. Avoid them,
> unless there is a compelling reason to use them.
>
> --Tuomas
But here it is compelling. You want to normalize random byte into 0
or 1, depending on "is it 0 or non-zero?" criteria, and it certainly
is easier to read than (*end ? 1 : 0).
Quite honestly, I do not think !! qualifies as "clever trick that is
confusing" anymore. Perhaps putting the rule there is misguided.
Thanks.
|
|
Tuomas Ahola wrote on the Git mailing list (how to reply to this email): Junio C Hamano <gitster@pobox.com> wrote:
> Tuomas Ahola <taahol@utu.fi> writes:
>
> > "Thomas Bachem via GitGitGadget" <gitgitgadget@gmail.com> wrote:
> >
> >> + warning(_("unrecognized value for '%s': '%.*s'"),
> >> + var, (int)(end - value), value);
> >> + value = end + !!*end;
> >> + }
> >
> > Reading CodingGuidelines, it seems that `!!` is a construct we would
> > like to avoid:
> >
> > - Some clever tricks, like using the !! operator with arithmetic
> > constructs, can be extremely confusing to others. Avoid them,
> > unless there is a compelling reason to use them.
> >
> > --Tuomas
>
> But here it is compelling. You want to normalize random byte into 0
> or 1, depending on "is it 0 or non-zero?" criteria, and it certainly
> is easier to read than (*end ? 1 : 0).
>
Uh, of course. Sorry for my mental short-circuit.
> Quite honestly, I do not think !! qualifies as "clever trick that is
> confusing" anymore. Perhaps putting the rule there is misguided.
>
> Thanks.
Okay. I'll consider writing a patch to drop that from CodingGuidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cc: Johannes Schindelin Johannes.Schindelin@gmx.de
Cc: Junio C Hamano gitster@pobox.com
cc: Tuomas Ahola taahol@utu.fi