Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cloobTech
Copy link

Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list ([email protected]) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

For a single-commit pull request, please leave the pull request description
empty
: your commit message itself should describe your changes.

Please read the "guidelines for contributing" linked above!

In get_ssh_finger_print(), the output of the `ssh-keygen` command is
put into `fingerprint_stdout` strbuf.
The string in `fingerprint_stdout` is then split into up to 3 strbufs
using strbuf_split_max(). However they are not modified after the split
thereby not making use of the strbuf API as the fingerprint token is
merely returned as a char * and not a strbuf. Hence they do not need to be
strbufs.

Simplify the process of retrieving and returning the desired token by
using strchr() to isolate the token and xmemdupz() to return a copy of the
token. This removes the roundabout way of splitting the string into strbufs, just
to return the token.

Reported-by: Junio Hamano <[email protected]>
Helped-by: Christian Couder <[email protected]>
Helped-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Olamide Caleb Bello <[email protected]>
In get_default_ssh_signing_key(), the default ssh signing key is
retrieved in `key_stdout` buf, which is then split using
strbuf_split_max() into up to two strbufs at a new line and the first
strbuf is returned as a `char *`and not a strbuf.
This makes the function lack the use of strbuf API as no edits are
performed on the split tokens.

Simplify the process of retrieving and returning the desired line by
using strchr() to isolate the line and xmemdupz() to return a copy of the
line.
This removes the roundabout way of splitting the string into strbufs, just
to return the line.

Reported-by: Junio Hamano <[email protected]>
Helped-by: Christian Couder <[email protected]>
Helped-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Olamide Caleb Bello <[email protected]>
@gitgitgadget-git
Copy link

There are issues in commit e23a735:
gpg-interface: do not use misdesigned strbuf_split*()
Lines in the body of the commit messages should be wrapped between 60 and 76 characters.
Indented lines, and lines without whitespace, are exempt

In get_ssh_finger_print(), the output of the `ssh-keygen` command is
put into `fingerprint_stdout` strbuf.
The string in `fingerprint_stdout` is then split into up to 3 strbufs
using strbuf_split_max(). However they are not modified after the split
thereby not making use of the strbuf API as the fingerprint token is
merely returned as a char * and not a strbuf. Hence they do not need to be
strbufs.

Simplify the process of retrieving and returning the desired token by
using strchr() to isolate the token and xmemdupz() to return a copy of the
token. This removes the roundabout way of splitting the string into
strbufs just to return the token.

Reported-by: Junio Hamano <[email protected]>
Helped-by: Christian Couder <[email protected]>
Helped-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Olamide Caleb Bello <[email protected]>
In get_default_ssh_signing_key(), the default ssh signing key is
retrieved in `key_stdout` buf, which is then split using
strbuf_split_max() into up to two strbufs at a new line and the first
strbuf is returned as a `char *`and not a strbuf.
This makes the function lack the use of strbuf API as no edits are
performed on the split tokens.

Simplify the process of retrieving and returning the desired line by
using strchr() to isolate the line and xmemdupz() to return a copy of the
line.
This removes the roundabout way of splitting the string into strbufs, just
to return the line.

Reported-by: Junio Hamano <[email protected]>
Helped-by: Christian Couder <[email protected]>
Helped-by: Kristoffer Haugsbakk <[email protected]>
Signed-off-by: Olamide Caleb Bello <[email protected]>
@gitgitgadget-git
Copy link

There is a merge commit in this Pull Request:

d141528d13c4cd983623e8cacec0ee092f5b20a6

Please rebase the branch and force-push.

@cloobTech cloobTech closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant