Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 14841] New: support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
@ 2022-06-10 23:57 bugzilla
  2022-06-10 23:59 ` [Buildroot] [Bug 14841] " bugzilla
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla @ 2022-06-10 23:57 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=14841

            Bug ID: 14841
           Summary: support/download/git fails with "fatal: No such remote
                    'origin'" due to incorrect check for origin remote
           Product: buildroot
           Version: 2020.02.10
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned@buildroot.uclibc.org
          Reporter: bmurdock@gmail.com
                CC: buildroot@uclibc.org
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-15 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 23:57 [Buildroot] [Bug 14841] New: support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote bugzilla
2022-06-10 23:59 ` [Buildroot] [Bug 14841] " bugzilla
2022-06-13  8:15 ` [Buildroot] [Bug 14841] New: " Edgar Bonet
2022-06-14 19:55 ` [Buildroot] [Bug 14841] " bugzilla
2022-07-30 19:55 ` bugzilla
2022-10-24 20:09 ` bugzilla
2022-10-24 20:10 ` bugzilla
2024-06-15 15:03 ` bugzilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox