From nobody Fri Sep 08 02:51:34 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 4RhgcM5nPQz4sHRd for ; Fri, 8 Sep 2023 02:51:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 4RhgcM2FdKz4SNJ for ; Fri, 8 Sep 2023 02:51:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-52c9f1bd05dso2165582a12.3 for ; Thu, 07 Sep 2023 19:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1694141506; x=1694746306; 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=UiGA/wM9pYdM8w50PMm+XmOMQUN8IfdUvnSUXDdHUCI=; b=avFu/MQD0f0lyaCxkYAOqlCjWURUdPLMUFBVJU7zIsQNZsjXQCruPgWH3ZkgSx4vUw FFCQq0V/i1JFHBHzw4U7lHmn4smvm2iJ/fbrVlHDN7/rR5AjAbYi0OOzGm8I7yP2uXQz nQx57oogtTFdafTSMlApji6nsdTCd671ALWzkW9YTFXgCLtu0SyC15+PVzrVuFEC2Rxh /N8veLLvYISRm7w0Pn7VoVszPZ80ZGIZDNM/s9APBm0deC46KFFLDvu+VIyV05dPGiN5 mAx4YEZMBi0qviJC9FFVKdi/xs+k/VjQw36bLT8aLi5Xb5cOGaDpgCLmt/uZTzx28TQx c1Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694141506; x=1694746306; 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=UiGA/wM9pYdM8w50PMm+XmOMQUN8IfdUvnSUXDdHUCI=; b=lHG6Z5QUv8hGp3cNR2+bzbDhZ9ipORyVYvLK1VcY5p3CUucsK4NdQQNdci+WoJaAyu QDt//ejN04vVS4kxJnNH2JPiEPzPU0TJJZ96nZPajLigYOzifPGpVbWHPnx42ZhcA0qG bboADBennwmrmRNlAmvBqvodwkgpPGIjcc2kbcFf0aF6WyqA0P3QAfcCjynm7bl+6ciT I9iP5yNu0VzIFoJO6sXm/h5bEhvMQcCx/EWlbtPfyeGUEKCZr9/5wPGm1dbvbUAwrFkL TKTR3pTH4gcVCiZGiq7/XPl5me3zVWktiZJNJr5mYsbejgwGAlo7vcYvmWUk8foBunJF kUzQ== X-Gm-Message-State: AOJu0YzThLShN9ETYdDvS74XtibNelIQStEROdBqAcZ/3nq89tIIadbG 5cn3owlcy+NlrlAwHtVRUMJbIKULa3N+T9W85juMNQ== X-Google-Smtp-Source: AGHT+IFq5Ktx4NUK3iJzl1TgeUjKTw+1yIx1PC0480or985aYI6GsUzMo555UZtQ20sg/ph5vMje045OptCZG7r6sZ4= X-Received: by 2002:aa7:d90b:0:b0:52a:841:bc56 with SMTP id a11-20020aa7d90b000000b0052a0841bc56mr780063edr.1.1694141505617; Thu, 07 Sep 2023 19:51:45 -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: <543e12ed-bc12-ee0e-4ddf-4423fe704d78@gmail.com> From: Warner Losh Date: Thu, 7 Sep 2023 20:51:34 -0600 Message-ID: Subject: Re: Working with forks To: Graham Perrin Cc: Alan Somers , freebsd-git Content-Type: multipart/alternative; boundary="000000000000a45d8c0604d00ec1" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4RhgcM2FdKz4SNJ --000000000000a45d8c0604d00ec1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.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/D3721= 0 > =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 latter will definitely work. The git branch command never does what I want so I never use it (except for variants like -d or --sort). Warner > --000000000000a45d8c0604d00ec1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Sep 7, 2023, 8:39 PM Graham Perrin <grahamperrin@gmail.com> wrote:
On 07/09/2023 20:03, Alan Somers wrot= e:
> 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.
=



--000000000000a45d8c0604d00ec1--