The git script does the following: - initializes a git repo - checks if the remote named origin exists - if it exists, it call git remote set-url to set the correct url for the origin remote The problem is, it uses the command 'git remote | grep '^origin$'' to check if origin exists. This command always prints the word origin, even if the origin remote doesn't actually exist in the repo. It's unfortunate, but that's how git works. On a brand new git repo, origin does not exist, but this part of the script believes it does exist, so it calls git remote set-url which then fails because origin doesn't exist. In my project I noticed two packages, flashbench and mmc_utils that use the git download method and it fails for both of them. The packages still succeed because they fallback to a different download method. I can imagine that's one reason why this has not been noticed. You will also not see this error if the git repo already exists with an actual origin remote that has been configured. The proper way to check if origin exists is to do this: if ! git config remote.origin.url | /dev/null; then... I have a patch for this and I will work on sending it to the mailing list.
I checked latest master in the buildroot git repo and it appears this bug is still present there too.
Hello, Thanks for the report. I'll be quoting what Edgar explained on the mailing list [0]: --- I cannot reproduce this. My copy of git does not print “origin” if there is no remote named such: $ git --version git version 2.25.1 $ git init foo Initialized empty Git repository in /home/edgar/foo/.git/ $ cd foo/ $ git remote | grep '^origin$' $ # <- empty output I also tried with both a quite old and a fairly recent version of git (2.11.0 from Debian Stretch and 2.35.1 from Debian Testing) with the same result. --- I also tried the same as Edgar, and I too can't reproduce. Can you provide more information, please? [0] https://lore.kernel.org/buildroot/acae6f60-f71c-76fe-b9fe-0779d758c1c0@grenoble.cnrs.fr/T/#t Regards, Yann E. MORIN.
Hello, We did not get feedback, or more explanations about your issue, and there are two people that reported that the case you described did in fact work as expected. So we're clodsing this issue report. Feel free to reopen with more information if you still have the issue. Regards, Yann E. MORIN.
Newer versions of `git` will expose this issue: ```bash $ git --version git version 2.37.2 $ git init Initialized empty Git repository in .../.git/ $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true $ git remote -v origin ```
Thank you for your report. The issue tracker for the Buildroot project has been moved to the Gitlab.com issue tracker: https://gitlab.com/buildroot.org/buildroot/-/issues We are taking this opportunity to close old issues in this old tracker. If you believe your issue is still relevant, please open one in the new issue tracker. Thank you!