Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2023 23:31:31 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Philip Paeps <philip@freebsd.org>
Cc:        Gregory Shapiro <gshapiro@freebsd.org>, freebsd-git@freebsd.org
Subject:   Re: Vendor import push failed: src refspec ... does not match any
Message-ID:  <CANCZdfoQbhtnYS3BxizTuEdGo7s1t235VA2iGybr5gH==6UdvQ@mail.gmail.com>
In-Reply-To: <CC4F3EFB-5CFC-4565-951F-7C2C20224531@freebsd.org>
References:  <20230109023126.kjjynari5b6jpqxo@thornystick.local> <CC4F3EFB-5CFC-4565-951F-7C2C20224531@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000003f80eb05f1ceeb30
Content-Type: text/plain; charset="UTF-8"

On Sun, Jan 8, 2023 at 11:17 PM Philip Paeps <philip@freebsd.org> wrote:

> On 2023-01-09 10:31:26 (+0800), Gregory Shapiro wrote:
>
> > I'm doing my first vendor import since the move to git.  Following the
> > instructions in section 5.4 of committers-guide/#git-primer, I hit a
> > roadblock trying to push the new version to the vendor branch.  My
> > actions are below, including the failure to push at the end.  What
> > should have I have done differently?
> >
> >
> >> cd src/freebsd/main
> >> git remote -v
> > freebsd https://git.freebsd.org/src.git (fetch)
> > freebsd git@gitrepo.freebsd.org:src.git (push)
> >> git pull
> > Already up to date.
> >> git status
> > On branch main
> > Your branch is up to date with 'freebsd/main'.
> >
> > nothing to commit, working tree clean
> >> git worktree add ../vendor/sendmail freebsd/vendor/sendmail
>

You needed to add '-b vendor/sendmail' here for it to create a branch in
your local name space (not in the freebsd/* upstream namespace).


> > Preparing worktree (detached HEAD 0694dcb04b81)
> > HEAD is now at 0694dcb04b81 Bring in fix from upstream that allows
> > libsm to compile against FreeBSD 13
> >> cd ../vendor/sendmail
> >> rsync --archive --delete --exclude=.git ~/Work/fb/sendmail-8.17.1/ ./
> >> git add -A
> >>
> > ...
> > (checked git status, git diff, all looked good at first, though after
> >  the error, I see that git status reports, "Not currently on any
> >  branch.")
>

Yea, the -b was missing above, I think.


> > ...
> >> git commit -m "Vendor import of sendmail 8.17.1"
> > [detached HEAD e2db8b1cc34e] Vendor import of sendmail 8.17.1
> >  188 files changed, 13741 insertions(+), 8635 deletions(-)
> >  create mode 100644 cf/feature/check_other.m4
> >  create mode 100644 cf/feature/sts.m4
> >  mode change 100644 => 100755 contrib/doublebounce.pl
> >  mode change 100644 => 100755 contrib/link_hash.sh
> >  mode change 100644 => 100755 contrib/re-mqueue.pl
> >  create mode 100644 devtools/OS/Darwin.19.x
> >  create mode 100644 devtools/OS/Darwin.20.x
> >  create mode 100644 include/sm/ixlen.h
> >  create mode 100644 libsm/ilenx.c
> >  create mode 100644 libsm/lowercase.c
> >  create mode 100644 libsm/strcaseeq.c
> >  create mode 100644 libsm/t-ixlen.c
> >  create mode 100755 libsm/t-ixlen.sh
> >  create mode 100644 libsm/t-str2prt.c
> >  create mode 100644 libsm/t-streq.c
> >  create mode 100755 libsm/t-streq.sh
> >  create mode 100644 libsm/utf8_valid.c
> >  create mode 100644 libsm/uxtext_unquote.c
> >  create mode 100644 libsm/xleni.c
> >  create mode 100755 libsmutil/t-lockfile-0.sh
> >  create mode 100644 libsmutil/t-lockfile.c
> >  create mode 100755 libsmutil/t-maplock-0.sh
> >> git tag -a -m "Tag sendmail 8.17.1" vendor/sendmail/8.17.1
> >> git push --dry-run --follow-tags freebsd vendor/sendmail
>
> error: src refspec vendor/sendmail does not match any
> > error: failed to push some refs to 'gitrepo.freebsd.org:src.git'
>

Yes. You've not created a vendor/sendmail branch yet, so there's no 'ref'
to push. This message really is git saying 'I'm not sure I know what
vendor/sendmail is', since it uses that to know what to push upstream. This
is where having the upstream set correctly just might matter.

If you look in your config file, you should see something like:



> >
> > Note that the output to git commit above starts with "[detached HEAD
> > ...]" which, along with the git status issue described above, looks
> > suspicious.
>
> You should create a branch in your worktree.  This will probably do what
> you want:
>
> git checkout -b vendor/sendmail
>

It's better done with the above -b command so that the 'upstream' is set
right (though this might not be one of the times that matters).


> I believe this will put the HEAD of that branch on the commit you made,
> but this is untested.
>

I think it will, but it won't have the upstream as freebsd/vendor/sendfile
which would be a problem if anybody else ever committed to that vendor
branch (or he did on a different machine).

[branch "vendor/sendmail"]
        remote = freebsd
        merge = refs/heads/vendor/sendmail

in the .git/config file from the repo (I hacked that together off a machine
I think has the right entries)

git reset e2db8b1cc34e
>
> If that doesn't work, simply do the rsync; git add; git commit again.
> It's not worth fighting with git over. :)
>

Yea, git makes it stupidly easy to throw away work that's somehow done
incorrectly the first time...

--0000000000003f80eb05f1ceeb30
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sun, Jan 8, 2023 at 11:17 PM Phili=
p Paeps &lt;<a href=3D"mailto:philip@freebsd.org">philip@freebsd.org</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2023=
-01-09 10:31:26 (+0800), Gregory Shapiro wrote:<br>
<br>
&gt; I&#39;m doing my first vendor import since the move to git.=C2=A0 Foll=
owing the<br>
&gt; instructions in section 5.4 of committers-guide/#git-primer, I hit a<b=
r>
&gt; roadblock trying to push the new version to the vendor branch.=C2=A0 M=
y<br>
&gt; actions are below, including the failure to push at the end.=C2=A0 Wha=
t<br>
&gt; should have I have done differently?<br>
&gt;<br>
&gt;<br>
&gt;&gt; cd src/freebsd/main<br>
&gt;&gt; git remote -v<br>
&gt; freebsd <a href=3D"https://git.freebsd.org/src.git" rel=3D"noreferrer"=
 target=3D"_blank">https://git.freebsd.org/src.git</a>; (fetch)<br>
&gt; freebsd git@gitrepo.freebsd.org:src.git (push)<br>
&gt;&gt; git pull<br>
&gt; Already up to date.<br>
&gt;&gt; git status<br>
&gt; On branch main<br>
&gt; Your branch is up to date with &#39;freebsd/main&#39;.<br>
&gt;<br>
&gt; nothing to commit, working tree clean<br>
&gt;&gt; git worktree add ../vendor/sendmail freebsd/vendor/sendmail<br></b=
lockquote><div><br></div><div>You needed to add &#39;-b vendor/sendmail&#39=
; here for it to create a branch in your local name space (not in the freeb=
sd/* upstream namespace).<br></div><div>=C2=A0</div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
&gt; Preparing worktree (detached HEAD 0694dcb04b81)<br>
&gt; HEAD is now at 0694dcb04b81 Bring in fix from upstream that allows <br=
>
&gt; libsm to compile against FreeBSD 13<br>
&gt;&gt; cd ../vendor/sendmail<br>
&gt;&gt; rsync --archive --delete --exclude=3D.git ~/Work/fb/sendmail-8.17.=
1/ ./<br>
&gt;&gt; git add -A<br>
&gt;&gt;<br>
&gt; ...<br>
&gt; (checked git status, git diff, all looked good at first, though after<=
br>
&gt;=C2=A0 the error, I see that git status reports, &quot;Not currently on=
 any<br>
&gt;=C2=A0 branch.&quot;)<br></blockquote><div><br></div><div>Yea, the -b w=
as missing above, I think.<br></div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">
&gt; ...<br>
&gt;&gt; git commit -m &quot;Vendor import of sendmail 8.17.1&quot;<br>
&gt; [detached HEAD e2db8b1cc34e] Vendor import of sendmail 8.17.1<br>
&gt;=C2=A0 188 files changed, 13741 insertions(+), 8635 deletions(-)<br>
&gt;=C2=A0 create mode 100644 cf/feature/check_other.m4<br>
&gt;=C2=A0 create mode 100644 cf/feature/sts.m4<br>
&gt;=C2=A0 mode change 100644 =3D&gt; 100755 contrib/<a href=3D"http://doub=
lebounce.pl" rel=3D"noreferrer" target=3D"_blank">doublebounce.pl</a><br>
&gt;=C2=A0 mode change 100644 =3D&gt; 100755 contrib/link_hash.sh<br>
&gt;=C2=A0 mode change 100644 =3D&gt; 100755 contrib/<a href=3D"http://re-m=
queue.pl" rel=3D"noreferrer" target=3D"_blank">re-mqueue.pl</a><br>
&gt;=C2=A0 create mode 100644 devtools/OS/Darwin.19.x<br>
&gt;=C2=A0 create mode 100644 devtools/OS/Darwin.20.x<br>
&gt;=C2=A0 create mode 100644 include/sm/ixlen.h<br>
&gt;=C2=A0 create mode 100644 libsm/ilenx.c<br>
&gt;=C2=A0 create mode 100644 libsm/lowercase.c<br>
&gt;=C2=A0 create mode 100644 libsm/strcaseeq.c<br>
&gt;=C2=A0 create mode 100644 libsm/t-ixlen.c<br>
&gt;=C2=A0 create mode 100755 libsm/t-ixlen.sh<br>
&gt;=C2=A0 create mode 100644 libsm/t-str2prt.c<br>
&gt;=C2=A0 create mode 100644 libsm/t-streq.c<br>
&gt;=C2=A0 create mode 100755 libsm/t-streq.sh<br>
&gt;=C2=A0 create mode 100644 libsm/utf8_valid.c<br>
&gt;=C2=A0 create mode 100644 libsm/uxtext_unquote.c<br>
&gt;=C2=A0 create mode 100644 libsm/xleni.c<br>
&gt;=C2=A0 create mode 100755 libsmutil/t-lockfile-0.sh<br>
&gt;=C2=A0 create mode 100644 libsmutil/t-lockfile.c<br>
&gt;=C2=A0 create mode 100755 libsmutil/t-maplock-0.sh<br>
&gt;&gt; git tag -a -m &quot;Tag sendmail 8.17.1&quot; vendor/sendmail/8.17=
.1<br>
&gt;&gt; git push --dry-run --follow-tags freebsd vendor/sendmail<br></bloc=
kquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; error: src refspec vendor/sendmail does not match any<br>
&gt; error: failed to push some refs to &#39;gitrepo.freebsd.org:src.git&#3=
9;<br></blockquote><div><br></div><div>Yes. You&#39;ve not created a vendor=
/sendmail branch yet, so there&#39;s no &#39;ref&#39; to push. This message=
 really is git saying &#39;I&#39;m not sure I know what vendor/sendmail is&=
#39;, since it uses that to know what to push upstream. This is where havin=
g the upstream set correctly just might matter.</div><div><br></div><div>If=
 you look in your config file, you should see something like:</div><div><br=
></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;<br>
&gt; Note that the output to git commit above starts with &quot;[detached H=
EAD<br>
&gt; ...]&quot; which, along with the git status issue described above, loo=
ks<br>
&gt; suspicious.<br>
<br>
You should create a branch in your worktree.=C2=A0 This will probably do wh=
at <br>
you want:<br>
<br>
git checkout -b vendor/sendmail<br></blockquote><div><br></div><div>It&#39;=
s better done with the above -b command so that the &#39;upstream&#39; is s=
et right (though this might not be one of the times that matters).<br></div=
><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I believe this will put the HEAD of that branch on the commit you made, <br=
>
but this is untested.<br></blockquote><div><br></div><div>I think it will, =
but it won&#39;t have the upstream as freebsd/vendor/sendfile which would b=
e a problem if anybody else ever committed to that vendor branch (or he did=
 on a different machine).</div><div><br></div><div>[branch &quot;vendor/sen=
dmail&quot;]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 remote =3D freebsd<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 merge =3D refs/heads/vendor/sendmail</div><div><br></d=
iv><div>in the .git/config file from the repo (I hacked that together off a=
 machine I think has the right entries)<br></div><div><br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex">
git reset e2db8b1cc34e<br>
<br>
If that doesn&#39;t work, simply do the rsync; git add; git commit again.=
=C2=A0 <br>
It&#39;s not worth fighting with git over. :)<br></blockquote><div><br></di=
v><div>Yea, git makes it stupidly easy to throw away work that&#39;s someho=
w done incorrectly the first time...=C2=A0 <br></div></div></div>

--0000000000003f80eb05f1ceeb30--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoQbhtnYS3BxizTuEdGo7s1t235VA2iGybr5gH==6UdvQ>