Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 2020 22:21:07 -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:  <5354B066-58AF-4F81-A665-F727F4C264F6@yahoo.com>
In-Reply-To: <018DC607-28A9-4937-B5C5-10C5C1B06C43@yahoo.com>
References:  <018DC607-28A9-4937-B5C5-10C5C1B06C43@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> 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 :
. . .

I've done more exploring and so am more willing to be
explicit about commands now that I've tried some of this.

>> 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

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 . . .

https://github.com/bsdimp/freebsd-git-docs/blob/main/faq.md has as its =
first question:

"How do I track -current and -stable with only one copy of the repo?" So =
based
on that text . . .

The notations for the git branches for what you list are (in order):

stable/12
releng/12.1
releng/12.2
main

The later material will lead to there being 4 FreeBSD source trees (with =
my
arbitrary example paths that you might not want to use):

/usr/fbsd/freebsd-current/
/usr/fbsd/freebsd-stable-12/
/usr/fbsd/freebsd-releng-12.1/
/usr/fbsd/freebsd-releng-12.2/

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.

The initial setup (I picked an example URL):

# 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

Then, as an example of updating freebsd-current (the overall sequence =
follows
the FAQ but I'll note a variation later):

# cd /usr/fbsd/freebsd-current
# git checkout main
# git pull --ff-only

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.

# 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

I'll note that elsewhere it is recommended to do (once
for each login using git for FreeBSD source activity):

# git config --global pull.ff only

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.)


The variation that I mentioned follows . . .

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.

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.


# cd /usr/fbsd/freebsd-current
# git fetch freebsd
# git checkout main
# git merge --ff-only freebsd/main

vs.

# cd /usr/fbsd/freebsd-current
# git fetch freebsd
# cd /usr/fbsd/freebsd-stable-12
# git checkout stable/12
# git merge --ff-only freebsd/stable/12

vs.

# cd /usr/fbsd/freebsd-current
# git fetch freebsd
# cd /usr/fbsd/freebsd-releng-12.1
# git checkout releng/12.1
# git merge --ff-only freebsd/releng/12.1

vs.

# cd /usr/fbsd/freebsd-current
# git fetch freebsd
# cd /usr/fbsd/freebsd-releng-12.2
# git checkout releng/12.2
# git merge --ff-only freebsd/releng/12.2


Note: After a fetch, one or more of the
cd-checkout-merge sorts of sequences could
be done without re-fetching.

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.

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.

Not tied to that, you may want to look at:

https://github.com/bsdimp/freebsd-git-docs/blob/main/SUMMARY.md

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?5354B066-58AF-4F81-A665-F727F4C264F6>