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!

@dscho
Copy link
Member

dscho commented Oct 22, 2025

@cloobTech if you force-push to the PR branch, you can avoid opening 5 PRs for the price of 1.

@cloobTech
Copy link
Author

@cloobTech if you force-push to the PR branch, you can avoid opening 5 PRs for the price of 1.

Thank you @dscho. Pardon me please.

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]>
@cloobTech
Copy link
Author

cloobTech commented Oct 23, 2025

@dscho , I was able to get it this time.
Thank you and sorry for the garbage things I did earlier

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.

2 participants