Date: Fri, 25 Dec 2020 22:46:57 -0800 From: Mark Millard <marklmi@yahoo.com> To: o.hartmann@walstatt.org Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r368820 - head Message-ID: <CD7185C6-B333-4654-9587-E95BAC93CDB3@yahoo.com> In-Reply-To: <5354B066-58AF-4F81-A665-F727F4C264F6@yahoo.com> References: <018DC607-28A9-4937-B5C5-10C5C1B06C43@yahoo.com> <5354B066-58AF-4F81-A665-F727F4C264F6@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-Dec-25, at 22:21, Mark Millard <marklmi at yahoo.com> wrote: >> On 2020-Dec-24, at 21:17, Mark Millard <marklmi@yahoo.com> wrote: >>=20 >> Hartmann, O. o.hartmann at walstatt.org wrote on >> Thu Dec 24 21:34:56 UTC 2020 : > . . . Looks like I was over specific about where I did "git fetch" from and so made some sequences overcomplicated. So I adjust that this time. > I've done more exploring and so am more willing to be > explicit about commands now that I've tried some of this. >=20 >>> I can not find (easily) any hints >>> for those who were familiar with subversion and checking out = /usr/src either for >>> 12-STABLE, 12.1-RELENG, 12.2-RELENG, CURRENT. >>=20 >=20 > Presuming having each available at the same time in separate directory = trees, > but only one repository, and sticking to the HEAD commit for each at = the time > the local repository is updated from the remote one. Also presuming no = locally > updated sources so there is nothing to clean up or put to the side . . = . >=20 > https://github.com/bsdimp/freebsd-git-docs/blob/main/faq.md has as its = first question: >=20 > "How do I track -current and -stable with only one copy of the repo?" = So based > on that text . . . >=20 > The notations for the git branches for what you list are (in order): >=20 > stable/12 > releng/12.1 > releng/12.2 > main >=20 > The later material will lead to there being 4 FreeBSD source trees = (with my > arbitrary example paths that you might not want to use): >=20 > /usr/fbsd/freebsd-current/ > /usr/fbsd/freebsd-stable-12/ > /usr/fbsd/freebsd-releng-12.1/ > /usr/fbsd/freebsd-releng-12.2/ >=20 > When following the general structure that uses worktrees that is = documented, you > can have at most one worktree for a branch. (Adding branches that you = maintain > to be related to those allows for more.) I'll indicate one worktree = for each but > main. main gets no worktree: it already has a sufficient context. >=20 > The initial setup (I picked an example URL): >=20 > # mkdir -p /usr/fbsd > # cd /usr/fbsd > # git clone -o freebsd --config = remote.freebsd.fetch=3D'+refs/notes/*:refs/notes/*' \ > ssh://anongit@git.freebsd.org/src.git freebsd-current > # cd freebsd-current > # git checkout main > # git worktree add ../freebsd-stable-12 stable/12 > # git worktree add ../freebsd-releng-12.1 releng/12.1 > # git worktree add ../freebsd-releng-12.2 releng/12.2 >=20 > Then, as an example of updating freebsd-current (the overall sequence = follows > the FAQ but I'll note a variation later): >=20 > # cd /usr/fbsd/freebsd-current > # git checkout main > # git pull --ff-only >=20 > Note: For the below, the above needs to have been > done first: the pull involves the fetch of the > remote material, including for the use in the > below. >=20 > # cd ../freebsd-stable-12 > # git merge --ff_only freebsd/stable/12 > # cd ../freebsd-releng-12.1 > # git merge --ff_only freebsd/releng/12.1 > # cd ../freebsd-releng-12.2 > # git merge --ff_only freebsd/stable/12 >=20 > I'll note that elsewhere it is recommended to do (once > for each login using git for FreeBSD source activity): >=20 > # git config --global pull.ff only >=20 > because those --ff-only uses are important to keeping > history as FreeBSD intends it (linear) and --ff-only > can be a default. (This will not cover the below > variation.) >=20 >=20 > The variation that I mentioned follows . . . >=20 > You might not like needing to update freebsd-current in > order to update, say, freebsd-stable-12 above. Avoiding > the pull and using the analogous two commands in the > proper order gives the following that only update the > individual part of the fetch that was of interest. >=20 > I show binding to branches to directories explicitly > (checkout) but such would not be needed unless the > binding for the directory tree had been changed. Note > that the below is not using pull and so the config > above does not cause --ff-only defaults to be involved: > Be reliably explicit. >=20 >=20 > # cd /usr/fbsd/freebsd-current > # git fetch freebsd > # git checkout main > # git merge --ff-only freebsd/main >=20 > vs. >=20 Improved: # cd /usr/fbsd/freebsd-stable-12 # git fetch freebsd # git checkout stable/12 # git merge --ff-only freebsd/stable/12 > vs. >=20 Improved: # cd /usr/fbsd/freebsd-releng-12.1 # git fetch freebsd # git checkout releng/12.1 # git merge --ff-only freebsd/releng/12.1 > vs. >=20 Improved: # cd /usr/fbsd/freebsd-releng-12.2 # git fetch freebsd # git checkout releng/12.2 # git merge --ff-only freebsd/releng/12.2 >=20 > Note: After a fetch, one or more of the > cd-checkout-merge sorts of sequences could > be done without re-fetching. >=20 > Part of what a "merge --ff-only" does is to > move what the active branch refers to, in > the cases above, to a (potentially) new place > in newly fetched material. >=20 > I hope that the above helps. It does not deal with > picking out a specific commit out of the repository > for a specific source directory tree. I do not know > if you do such and it makes controlling the context > more complicated to describe. >=20 > Not tied to that, you may want to look at: >=20 > https://github.com/bsdimp/freebsd-git-docs/blob/main/SUMMARY.md >=20 > that organizes the existing material and may make > it easier to pick out things to read. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CD7185C6-B333-4654-9587-E95BAC93CDB3>