Can't clone from repo

Sorry for this basic question but I can’t clone the buildtools as is written here:

git clone “ssh://peterosdev@git.haiku-os.org/buildtools” && curl -Lo “buildtools/.git/hooks/commit-msg” https://git.haiku-os.org/tools/hooks/commit-msg
CLoning to ‘buildtools’ …
peterosdev@git.haiku-os.org: Permission denied (publickey).
fatal: Could not read from remote repository.

I first tried $USER which uses my local system’s username but that didn’t work. Now I use the username as named on the Gerrit prefeences page.

What’s wrong?

Try with git://git.haiku-os.org/buildtools

Have a look here. I had what may be a similar problem.

1 Like

@RogFanther Using git: instead of SSH is not the way the documentation demands. I guess SSH somehow becomes important if I ever try a pull request.

@bcbarnes Thanks, that seems like exactly my problem. I will investigate that further.

Ssh only makes sense if you need to push. To pull the repositories is ok with git or http access.

I find a certain aspect of GIT very confusing: the phrase “pull request”. It seems that pull is grabbing from repo, while push is re-submit changed code to the repo. But then a contribution should be named “push request”, or?

I want to be able to resubmit code, so I guess I need SSH. I haven’t written any Haiku contribution yet, but I would like to do so some day in the future. I’m planning on having a look at the automatic UEFI bootloader installer (or more precisely the current absense of such).

Can I clone without SSH and later submit with SSH?

You “pull” updated changes from other repos/branches. You “push” your changes to repos/branches.

Then you request the maintaners do a “pull” of your changes onto their repos/branches. Thus… PR = Pull request.

Other places prefer to use MR / Merge request instead, as what you want in the end is your code to be merged. But your code might get in by other means than “git merge” so… ¯\_(ツ)_/¯

Yes. You can clone in “anonymous” mode ( git clone https://review.haiku-os.org/haiku), and later on change the “git remotes”.

The Get the Haiku Source Code / Pushing Patches to Haiku 101 guide even says how:

To submit a patch, you can change the remote URL of the Haiku repository to Gerrit using this command:

git remote set-url origin ssh://$USER@git.haiku-os.org/haiku

My first clone (with --depth=1 just to speed things up) was an anonymous one, and later on I was able to push some changesets withouth much hiccups (after setting up the correct git remotes, of course).

1 Like

A “pull request” is originally when you ask (request) someone else to pull your changes into their repository or branch (to which you are not allowed to push directly).

Note that this is not a “git” name but a Github one. Gitlab says “merge request” and Gerrit (which we use) says “change request”.

Not strictly, it is also possible to generate an HTTP password from Gerrit web interface and use that. But then you have to enter the password each time you push something, while with ssh you can store the key in a file.

2 Likes

It is possible to have the HTTPS password stored, with:

git config credential.helper store
1 Like