From nobody Fri Sep 8 04:30:24 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 4RhjpR4qJbz4sM8R for ; Fri, 8 Sep 2023 04:30:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 4RhjpQ5Cb6z3QnQ for ; Fri, 8 Sep 2023 04:30:38 +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=WQJw3zud; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::530) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-52a23227567so2250196a12.0 for ; Thu, 07 Sep 2023 21:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1694147436; x=1694752236; 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=uOQpZz6LDn7vTP8NSnWDFwms9VlhZDNIiZva/eoInHQ=; b=WQJw3zudlrfrZx9PYO2isnu7VJa6OEFsQlCgdEm6UnIp6qSM82vSmqguUvOBvhKvd7 WRXUB5LOGWmWvQXv/ynyKRfFkLWNVouYlWt8slOptF8g19nOlOaf4MJZzWOIcIB3uvk4 lIu/fEksdIYO4cU+MukDWFUlboUONefY/KaI3Y5835nqh2VTBZGoLTmLgmotsBRnihQG 4g3NGqh7QsilRAyoCG+Bkv4me8wmeukfZlv7dQlu1zgq7TBBrt1fToAiiKugRrSpgOiK WOJp/J7pm4gLagTS8ayxk83rkdC2nLrdqvoE857XYNr/cZI0JD+VjYxtagAmLwYrJZpm IrQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694147436; x=1694752236; 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=uOQpZz6LDn7vTP8NSnWDFwms9VlhZDNIiZva/eoInHQ=; b=OuX/cIMk6y4dJGTq/mtLwd7dxDHMAVxAzaxLFs+33nQStDCMw0t7CtIZ8RUTiFK6Sr Rv0ptnC0NbdKMH7eIYleC3qiLX2qgfht5MtSFYWJ057HG7xLU1xRKW5vDZeeDq+F9qei d81U8+Y922txLyleCYBNhavXPiqFMdHjCWZYLndYWdfhmPywyEKBPOm6xBPOyLQdqY8i VAVPf3E+2SyL2rt/GJaEorOs9kBH+PeuTDH3Hwl6maf8DDFSzDnrzLc8Nc/6giIZI0TY uGpiWdfRV4D1+oJ+kCJMveny1t8JRu9u8i1K1an4umL6TrFj6KUr06lutFGdYtC408sQ xSiQ== X-Gm-Message-State: AOJu0YzRxIOQmaw60cqS5wwaJfPN62bU2Tpg/uwK20+fIuv2ug7G6oK6 4hMzfMIfDovvOF93oXqkEs0/hrNleRMgy0au4ZmMPA== X-Google-Smtp-Source: AGHT+IHpjVIxuKB27tJ0cwe3iqBxWruNsxdlGFZgKIyJqNu6hcKu8q5wb02eA3YkT4d0nY+2P/nhFjAKh7CyjPr3wFE= X-Received: by 2002:a05:6402:7c4:b0:521:ae63:ee63 with SMTP id u4-20020a05640207c400b00521ae63ee63mr834080edy.16.1694147435873; Thu, 07 Sep 2023 21:30:35 -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:30:24 -0600 Message-ID: Subject: Re: Working with forks To: Graham Perrin Cc: Alan Somers , freebsd-git Content-Type: multipart/alternative; boundary="0000000000001cdbfb0604d17052" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; 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::530:from]; TO_DN_ALL(0.00)[]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::530:server fail]; RCPT_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; 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: 4RhjpQ5Cb6z3QnQ --0000000000001cdbfb0604d17052 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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) allow= 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 will >> > 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.gi= t >> > 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/D372= 10 >> =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. The latt= er > will definitely work. The git branch command never does what I want 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 Warner --0000000000001cdbfb0604d17052 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Sep 7, 2023 at 8:51=E2=80=AFP= M Warner Losh <imp@bsdimp.com> = wrote:


On Thu, Sep 7, 2023, 8:39 PM Graham Perrin <grahamperrin@gmail.com>= 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 from bruno created as= well, to track the remote, but this
=C2=A0specific one is ancien= t history at this point).
or sometimes
% git worktree a= dd ../qemu-bruno bruno/gerbils

Warner
<= /div> --0000000000001cdbfb0604d17052--