Re: OpenZFS imports, status update

From: Mark Millard via freebsd-git <freebsd-git_at_freebsd.org>
Date: Tue, 8 Jun 2021 15:09:54 -0700
Li-Wen Hsu <lwhsu_at_freebsd.org> wrote (in part) on
Date: Tue, 8 Jun 2021 06:29:51 +0800 :

> The people have local branch tracking the original vendor/openzfs will
> encounter issues like this whey doing `git pull`:
> 
>     error: cannot lock ref
> 'refs/remotes/freebsd/vendor/openzfs/legacy':
> 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create
> 'refs/remotes/freebsd/vendor/openzfs/legacy'
> 
> The solution is update the upstream of the tracking branch:
> 
>     (change "freebsd" to "origin" if you use default remote name)
>     git update-ref -d refs/remotes/freebsd/vendor/openzfs
>     git branch -u freebsd/vendor/openzfs/legacy vendor/openzfs/legacy

I guess I misunderstood the meaning of the wording.
I've never explicitly created a branch of or checked out
anything from vendor/ or below. So I was not expecting
anything. I do use main and stable/13 and releng/13.0
explicitly in worktrees, no local commits involved for
the context that this is from.

Looks like some implicit initial configuration defaults
mean "local branch tracking" of vendor/openzfs was
implicitly/automatically in use in a way that fits
the actual intent of the wording:

# git fetch
remote: Enumerating objects: 21551, done.
remote: Counting objects: 100% (21551/21551), done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 75711 (delta 21460), reused 21399 (delta 21399), pack-reused 54160
Receiving objects: 100% (75711/75711), 46.02 MiB | 4.74 MiB/s, done.
Resolving deltas: 100% (59104/59104), completed with 2449 local objects.
From https://git.FreeBSD.org/src
   e5f5b6a75c0a..f20893853e8e  main                           -> freebsd/main
   a4deddc0de32..53de482ad419  releng/11.4                    -> freebsd/releng/11.4
   f5ddeabc08e7..6e927d10c587  releng/12.2                    -> freebsd/releng/12.2
   8023e729a521..b74cdf1eceae  releng/13.0                    -> freebsd/releng/13.0
   dbb3df26a8a3..90e161ec6d11  stable/11                      -> freebsd/stable/11
   f146c0338c6c..0a41a2899eb2  stable/12                      -> freebsd/stable/12
   ddd0a8bffe35..04c4bd7f7b52  stable/13                      -> freebsd/stable/13
   1e02e5b0ba86..395770967c36  vendor/acpica                  -> freebsd/vendor/acpica
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/legacy': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/legacy'
 ! [new branch]                vendor/openzfs/legacy          -> freebsd/vendor/openzfs/legacy  (unable to update local ref)
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/master': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/master'
 ! [new branch]                vendor/openzfs/master          -> freebsd/vendor/openzfs/master  (unable to update local ref)
error: cannot lock ref 'refs/remotes/freebsd/vendor/openzfs/zfs-2.1-release': 'refs/remotes/freebsd/vendor/openzfs' exists; cannot create 'refs/remotes/freebsd/vendor/openzfs/zfs-2.1-release'
 ! [new branch]                vendor/openzfs/zfs-2.1-release -> freebsd/vendor/openzfs/zfs-2.1-release  (unable to update local ref)
   efec8223892b..40c7ff83e74e  vendor/wpa                     -> freebsd/vendor/wpa
 * [new tag]                   vendor/acpica/20210604         -> vendor/acpica/20210604

So, for now, I then did:

# git update-ref -d refs/remotes/freebsd/vendor/openzfs
# git fetch
From https://git.FreeBSD.org/src
 * [new branch]                vendor/openzfs/legacy          -> freebsd/vendor/openzfs/legacy
 * [new branch]                vendor/openzfs/master          -> freebsd/vendor/openzfs/master
 * [new branch]                vendor/openzfs/zfs-2.1-release -> freebsd/vendor/openzfs/zfs-2.1-release

This order was apparently a mistake in some way because
after it I then tried the other of the pair of commands
and got:

# git branch -u freebsd/vendor/openzfs/legacy vendor/openzfs/legacy
fatal: branch 'vendor/openzfs/legacy' does not exist

Yet what I see is:

# git remote show freebsd
* remote freebsd
  Fetch URL: https://git.FreeBSD.org/src.git
  Push  URL: https://git.FreeBSD.org/src.git
  HEAD branch: main
  Remote branches:
    main                             tracked
    refs/notes/commits               tracked
. . .
    releng/13.0                      tracked
. . .
    stable/13                        tracked
. . .
    vendor/openzfs/legacy            tracked
    vendor/openzfs/master            tracked
    vendor/openzfs/zfs-2.1-release   tracked
. . .
  Local branches configured for 'git pull':
    main        merges with remote main
    releng/13.0 merges with remote releng/13.0
    stable/13   merges with remote stable/13

So I'm not sure if I have anything that is messed up
or not. Nothing looks odd to me, other than the one
command's output.


Overall it seems that most people not doing something
special with an initial git configuration for FreeBSD
so have to deal with the issue at hand explicitly in
some way.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
Received on Tue Jun 08 2021 - 22:09:54 UTC

Original text of this message