From nobody Wed Oct 13 06:18:32 2021 X-Original-To: freebsd-current@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 6213D17F4A22 for ; Wed, 13 Oct 2021 06:18:42 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp5.goneo.de (smtp5.goneo.de [85.220.129.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTj5t1Z38z3G12 for ; Wed, 13 Oct 2021 06:18:42 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from hub1.goneo.de (hub1.goneo.de [IPv6:2001:1640:5::8:52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp5.goneo.de (Postfix) with ESMTPS id 694621067555; Wed, 13 Oct 2021 08:18:35 +0200 (CEST) Received: from hub1.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPS id CABBE10A75DF; Wed, 13 Oct 2021 08:18:33 +0200 (CEST) Received: from freyja (p5de887d0.dip0.t-ipconnect.de [93.232.135.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPSA id 8414D10A75DE; Wed, 13 Oct 2021 08:18:33 +0200 (CEST) Date: Wed, 13 Oct 2021 08:18:32 +0200 From: FreeBSD User To: Warner Losh Cc: FreeBSD CURRENT Subject: Re: git: "overlay" of own remote-branch on official freebsd-ports repo Message-ID: <20211013081832.299a1b06@freyja> In-Reply-To: References: <20211012173148.1d2f138c@hermann.fritz.box> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-UID: ac2750 X-Rspamd-UID: d19752 X-Rspamd-Queue-Id: 4HTj5t1Z38z3G12 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 12 Oct 2021 10:01:00 -0600 Warner Losh wrote: > On Tue, Oct 12, 2021 at 9:32 AM FreeBSD User wrote: > > > I do not know whether I'm right in this list, but since the subject is > > mutual so common > > in development and GIT, I have the strong feeling I'm right here. > > > > Im quite new to git, so apologizes for any inconvenience reading my > > question. > > > > Using poudriere on 14-CURRENT to create a selection of packages also > > includes updating > > the ports tree on a regular basis. I maintain some "special" ports not > > official part of > > the FreeBSD ports tree and some other ports are part of those I'm supposed > > to maintain. I > > keep personally track of the changes in a git repo of my own. > > > > Now I'd like to "overlay" the official portas repo by that of mine to > > include changes. > > With SVN, there was no problem to have local changes not overwritten by > > regular updates > > of the ports tree as long as the specific port in question wasn't updated > > by the official > > site. In git, this behaviour seems to have changed, any changes I made so > > far are gone > > after poudriere is adviced to update the tree. > > > > I'd like to ask how FreeBSD developers and maintainers do the trick. If > > there is an > > official cookbook fpr maintainers (I haven't found it yet ...), please be > > so kind and > > refer to it. Any advice is welcome. > > > > tl;dr: branches are cheap and well supported in git. You just make a branch > for your > local changes, and update that however you see fit. > > For ports I have like that, I've just created a branch in git. I rebase the > branch forward > each time I update. For me, though, the branch is mostly uncommitted in > upstream > changes that may not be ready for some reason... There's two ways to do > this. > You can just merge, which is OK if you aren't upstreaming the changes, or > you can > rebase if the changes or a subset of the changes likely will end up in > FreeBSD. > > Others might recommend stash, but I find it too unwieldy for more than a > couple > of things. > > So the workflow would be: > > git clone -o freebsd freebsd-ports > cd freebsd-ports > git checkout -b hartmann-specials > > > Now, you can use poudriere-ports with the -B hartmann-specials and your > local repo as the source of truth. > > to update > > cd freebsd-ports > git checkout main > git pull --rebase # or --ff-only, I use > --rebase because I push and it's habit > git rebase -i main hartmann-specials > > Note: if you need to have multiple trees with this branch you are modifying, > then a git pull --rebase will let you cope with the forced-pushes this > method > would require. You can also do it with git merge on hartmann-specials if you > don't need to keep the changes separate or you have a lot of downstreams > that would get cranky, which doesn't sound like the case here. > > Warner As I wrote, I'm quite new to git and always surprised. Thanks for the help and the neat tip. I'll try. Kind regards and thanks, Oliver