From nobody Fri Sep 08 04:37:15 2023 X-Original-To: freebsd-git@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RhjyL5qQVz4sRHl for ; Fri, 8 Sep 2023 04:37:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RhjyJ3VHFz3VWW for ; Fri, 8 Sep 2023 04:37:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b="eyBSe/hF"; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::535) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52bcd4db4cbso2155159a12.1 for ; Thu, 07 Sep 2023 21:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1694147847; x=1694752647; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BRTQs4ogliyic0GVl543prEQWRHxUcI04RZfKaMIotQ=; b=eyBSe/hFcfoz/NEwZkEEJQkcZpWu7C/FLIY0eCc4IHHvPKcumN9NxEAbOz+ID+q9VP KBz1moH22kxzBgtRqBDDF2uDJFafHDy0RaVx/is+s3cWtnUdKqV61h2oCzSXRpTgPyAD yKuXLUbtuS+NOJlpc0ONs4R/FO21rd9WAkqfpkPhe7Toq9KRhh7LclWh+wXADcJxFAwC 3Pw5SrgG5R+12ZVri09VU6TykiPDLLp3QB8KysPDwT/1Ib9M9jy1iPQRgXdD7ETMtOKK UCG4Szfh+8kIg8AbA3dRSuwJBFvVamS2dvjJ/r1TIs6ogqM5PbAkR5iLnH2SSacdNqou UFDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694147847; x=1694752647; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BRTQs4ogliyic0GVl543prEQWRHxUcI04RZfKaMIotQ=; b=ZhcaV/73JvouLcaDdUWaCJsaA2GCHkLygbiRv/+3VmAsr+H/WHBTYfhRwZtTc47Tab Lpwpx0yk/ho8fxaHADcJlbJwPZ7s4tdPI8T2iBbUD5WtcxFfzxZ1auO20S/HlICN3CjR ltFxlzzbKDaHM9epNkJpCBtGzHidcur1cORjyg1p8vD077diZY4fmJ51YKLuGxiWOC/v NY5sleTBw8c9XXCjyeIVJ9B2yVPVmr5c8osmKbyTbnUINPKC1c9c+cwiLxa8d9lfF70g hg7LDHq2+2rt2PD57wdHiWXme4jtHMnCrFmyVx92MoiiAmuVWiAJn1YaoTd/erkFP8jd 6+8Q== X-Gm-Message-State: AOJu0YyBkQBMHA/KYc9APXLbRPAFgX2A7w3ni5qKWrC58SLR9wl0oa+C ROSWkdRb0pJs5BzDJ9WsmzYOT1i294OSmXGwUw9l3segw2V+5kYt+Ic= X-Google-Smtp-Source: AGHT+IF+mOFJ1YDAQxYiDAZi2/srKDBVP6h6Z4Q79uFhUJrKSBWBcNbMOiKW8kyN2ELOkg2lz/8iCFQRaDEhQ+DUXzY= X-Received: by 2002:a05:6402:14c1:b0:52c:9ce1:f117 with SMTP id f1-20020a05640214c100b0052c9ce1f117mr699427edx.40.1694147846797; Thu, 07 Sep 2023 21:37:26 -0700 (PDT) List-Id: Discussion of git use in the FreeBSD project List-Archive: https://lists.freebsd.org/archives/freebsd-git List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-git@freebsd.org MIME-Version: 1.0 References: <7e6a3a98-80a8-c787-fda5-65e924dbad34@gmail.com> <543e12ed-bc12-ee0e-4ddf-4423fe704d78@gmail.com> In-Reply-To: From: Warner Losh Date: Thu, 7 Sep 2023 22:37:15 -0600 Message-ID: Subject: Re: Working with forks To: Graham Perrin Cc: Alan Somers , freebsd-git Content-Type: multipart/alternative; boundary="0000000000009b11cc0604d188fb" X-Spamd-Bar: - X-Spamd-Result: default: False [-1.92 / 15.00]; URI_COUNT_ODD(1.00)[21]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.992]; NEURAL_HAM_LONG(-0.93)[-0.927]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-git@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_SPF_NA(0.00)[no SPF record]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::535:from]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::535:server fail]; PREVIOUSLY_DELIVERED(0.00)[freebsd-git@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-Rspamd-Queue-Id: 4RhjyJ3VHFz3VWW --0000000000009b11cc0604d188fb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 7, 2023 at 10:30=E2=80=AFPM Warner Losh wrote: > > > On Thu, Sep 7, 2023 at 8:51=E2=80=AFPM Warner Losh wrote= : > >> >> >> On Thu, Sep 7, 2023, 8:39 PM Graham Perrin >> wrote: >> >>> On 07/09/2023 20:03, Alan Somers wrote: >>> > On Thu, Sep 7, 2023 at 11:49=E2=80=AFAM Graham Perrin >>> wrote: >>> >> With a clone of e.g. https://github.com/freebsd/freebsd-src.git (in >>> the FreeBSD project) as a starting point: when the times come to work, >>> locally, with other people's forks, does Git (at the command line) allo= w an >>> easy way to temporarily use the same local directory? >>> > I do this all the time, if I understand the question correctly. You >>> > just need to add a separate git remote for each fork. For example, >>> > this sequence of commands will clone the FreeBSD source. Then it wil= l >>> > fetch grahamperrin's fork. Then it will checkout a copy of >>> > grahamperrin's feature branch. Finally, it will rebase that feature >>> > branch onto a branch from the original FreeBSD repo. >>> > >>> > git clone git@github.com/freebsd/freebsd-src.git >>> > cd freebsd-src >>> > git remote add grahamperrin >>> git@github.com/grahamperrin/freebsd-src.git >>> > git fetch grahamperrin >>> > git branch grahamperrin/featureX featureX >>> > git checkout featureX >>> > git rebase origin/stable/13 >>> >>> Thanks. >>> >>> Below (an abbreviated list of branches), what am I doing wrong? >>> >>> % git -C /usr/src config --get remote.origin.url >>> https://github.com/grahamperrin/freebsd-src.git >>> % git -C /usr/src remote add jlduran >>> https://github.com/jlduran/freebsd-src.git >>> % git -C /usr/src fetch jlduran >>> From https://github.com/jlduran/freebsd-src >>> * [new branch] D37210 -> >>> jlduran/D37210 >>> =E2=80=A6 >>> * [new branch] nanobsd-embedded-use-makefs -> >>> jlduran/nanobsd-embedded-use-makefs >>> =E2=80=A6 >>> * [new branch] wip-fix-comment-blah -> >>> jlduran/wip-fix-comment-blah >>> % git -C /usr/src branch jlduran/nanobsd-embedded-use-makefs >>> nanobsd-embedded-use-makefs >>> fatal: not a valid object name: 'nanobsd-embedded-use-makefs' >>> % >>> >>> If it's relevant: my /usr/src originated from my fork. >>> >> >> >> I never use -C... but 'git checkout nanobsd-embedded-use-makefs' may >> work. Or 'git checkout -t jlduran/nanobsd-embedded-use-makefs' if not. T= he >> latter will definitely work. The git branch command never does what I wa= nt >> so I never use it (except for variants like -d or --sort). >> > > My typical work flow looks more like: > > % git remote add bruno httpsg:ithub.com/seanbruno/qemu-bsd-user.git > % git fetch bruno > % git checkout -t bruno/gerbils > (to get the gerbils branch from bruno created as well, to track the > remote, but this > specific one is ancient history at this point). > or sometimes > % git worktree add ../qemu-bruno bruno/gerbils > Or in this case I just did: % git remote add jlduran ssh://git@github.com/jlduran/freebsd-src.git % git fetch jlduran % git checkout nanobsd-embedded-use-makefs and it created the tracking branch against jlduran/nanobsd-embedded-use-makefs for me. Other guides and people suggest adding the -t and using the upstream name to do it. I'm not sure what to recommend, but I know the above works. I also never have a /usr/src on any of my systems. Too many work trees for larger work in progress or review-in-progress projects. When I do have /usr/src, it's always exactly what's on the machine (or I'm building the new version). It got too confusing for me in the 90s having this in /usr/src (though to be fair, it was the era of CVS which made easy things hard, and hard things impossible). Warner --0000000000009b11cc0604d188fb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Sep 7, 2023 at 10:30=E2=80=AF= PM Warner Losh <imp@bsdimp.com>= wrote:


On Thu, Sep 7, 2023 at 8:51=E2=80=AFPM Warner= Losh <imp@bsdimp.co= m> wrote:


On Thu, Sep 7, 2023, 8:39 PM Graham Perrin <grahamperrin@gmail.co= m> wrote:
On 07/09/2023 20:03, Alan Somers wrote:
> On Thu, Sep 7, 2023 at 11:49=E2=80=AFAM Graham Perrin <grahampe= rrin@gmail.com> wrote:
>> With a clone of e.g. https://github.co= m/freebsd/freebsd-src.git (in the FreeBSD project) as a starting point:= when the times come to work, locally, with other people's forks, does = Git (at the command line) allow an easy way to temporarily use the same loc= al directory?
> I do this all the time, if I understand the question correctly.=C2=A0 = You
> just need to add a separate git remote for each fork.=C2=A0 For exampl= e,
> this sequence of commands will clone the FreeBSD source.=C2=A0 Then it= will
> fetch grahamperrin's fork.=C2=A0 Then it will checkout a copy of > grahamperrin's feature branch.=C2=A0 Finally, it will rebase that = feature
> branch onto a branch from the original FreeBSD repo.
>
> git clone git@github.com/freebsd/freebs= d-src.git
> cd freebsd-src
> git remote add grahamperrin git@gi= thub.com/grahamperrin/freebsd-src.git
> git fetch grahamperrin
> git branch grahamperrin/featureX featureX
> git checkout featureX
> git rebase origin/stable/13

Thanks.

Below (an abbreviated list of branches), what am I doing wrong?

% git -C /usr/src config --get remote.origin.url
https://github.com/grahamperrin/freebsd-sr= c.git
% git -C /usr/src remote add jlduran
https://github.com/jlduran/freebsd-src.git<= br> % git -C /usr/src fetch jlduran
=C2=A0From https://github.com/jlduran/freebsd-src
=C2=A0=C2=A0* [new branch] D37210=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 -> jlduran/D37210
=E2=80=A6
=C2=A0=C2=A0* [new branch] nanobsd-embedded-use-makefs=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ->
jlduran/nanobsd-embedded-use-makefs
=E2=80=A6
=C2=A0=C2=A0* [new branch] wip-fix-comment-blah=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ->
jlduran/wip-fix-comment-blah
% git -C /usr/src branch jlduran/nanobsd-embedded-use-makefs
nanobsd-embedded-use-makefs
fatal: not a valid object name: 'nanobsd-embedded-use-makefs'
%

If it's relevant: my /usr/src originated from my fork.
=




% git fetch bruno
% git checkout -t bruno/gerbils
(to get the gerbils branch fro= m bruno created as well, to track the remote, but this
=C2=A0spec= ific one is ancient history at this point).
or sometimes
% git worktree add ../qemu-bruno bruno/gerbils

Or in this case I just did:

%=C2=A0git remote add jlduran ssh://git@github.com/jlduran/freebsd-src.git
%= git fetch jlduran
% git checkout nanobsd-embedded-use-makefs

and it created the tracking branch against jlduran/na= nobsd-embedded-use-makefs=C2=A0for me.
Other guides and people su= ggest adding the -t=C2=A0 and using the upstream name to do it.
I= 'm not sure what to recommend, but I know the above works.
I also never have a /usr/src on any of my systems. Too many wo= rk trees for larger
work in progress or review-in-progress projec= ts. When I do have /usr/src, it's always
exactly what's o= n the machine (or I'm building the new version). It got too confusing
for me in the 90s having this in /usr/src (though to be fair, it w= as the era of CVS which
made easy things hard, and hard things im= possible).

Warner
--0000000000009b11cc0604d188fb--