buildroot.busybox.net archive mirror
 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
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ 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] 7+ messages in thread

* [Buildroot] [Bug 14841] support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
  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 ` bugzilla
  2022-06-13  8:15 ` [Buildroot] [Bug 14841] New: " Edgar Bonet
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla @ 2022-06-10 23:59 UTC (permalink / raw)
  To: buildroot

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

--- Comment #1 from bmurdock@gmail.com ---
I checked latest master in the buildroot git repo and it appears this bug is
still present there too.

-- 
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] 7+ messages in thread

* Re: [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 [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 ` Edgar Bonet
  2022-06-14 19:55 ` [Buildroot] [Bug 14841] " bugzilla
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Edgar Bonet @ 2022-06-13  8:15 UTC (permalink / raw)
  To: buildroot

Hello!

On 2022-06-11, bmurdock@gmail.com reported:
> [support/download/git] 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.

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.

Regards,

Edgar.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [Bug 14841] support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
  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 ` bugzilla
  2022-07-30 19:55 ` bugzilla
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla @ 2022-06-14 19:55 UTC (permalink / raw)
  To: buildroot

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

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yann.morin.1998@free.fr

--- Comment #2 from Yann E. MORIN <yann.morin.1998@free.fr> ---
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.

-- 
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] 7+ messages in thread

* [Buildroot] [Bug 14841] support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
  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
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla @ 2022-07-30 19:55 UTC (permalink / raw)
  To: buildroot

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

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED

--- Comment #3 from Yann E. MORIN <yann.morin.1998@free.fr> ---
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.

-- 
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] 7+ messages in thread

* [Buildroot] [Bug 14841] support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
  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
                   ` (3 preceding siblings ...)
  2022-07-30 19:55 ` bugzilla
@ 2022-10-24 20:09 ` bugzilla
  2022-10-24 20:10 ` bugzilla
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla @ 2022-10-24 20:09 UTC (permalink / raw)
  To: buildroot

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

--- Comment #4 from Emil Medve <EmilianMedve@HoTMaiL.com> ---
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
```

-- 
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] 7+ messages in thread

* [Buildroot] [Bug 14841] support/download/git fails with "fatal: No such remote 'origin'" due to incorrect check for origin remote
  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
                   ` (4 preceding siblings ...)
  2022-10-24 20:09 ` bugzilla
@ 2022-10-24 20:10 ` bugzilla
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla @ 2022-10-24 20:10 UTC (permalink / raw)
  To: buildroot

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

Emil Medve <EmilianMedve@HoTMaiL.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

-- 
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] 7+ messages in thread

end of thread, other threads:[~2022-10-24 20:10 UTC | newest]

Thread overview: 7+ 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).