Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2022 22:31:35 +0200
From:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freeBSD Current <freebsd-current@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: discussion on future removal of empty $FreeBSD$ tags
Message-ID:  <8fc7dc93-4fcb-832c-d950-05c85dcde893@plan-b.pwste.edu.pl>
In-Reply-To: <CANCZdfrEJSNbfMyRUPiH3ufq1yG8p6PZFvWCgB-CcgqB%2BGnYbg@mail.gmail.com>
References:  <4ba8458e-db94-6f74-a8e0-ba71692ea72a@plan-b.pwste.edu.pl> <CANCZdfrEJSNbfMyRUPiH3ufq1yG8p6PZFvWCgB-CcgqB%2BGnYbg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------AmnHHBLpn03nhE2I6GGre0ZE
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

W dniu 2.05.2022 o 22:09, Warner Losh pisze:
> The current plans are to keep $FreeBSD$ in main until stable/12 is out 
> of support. no new files will have it added, unless they are to be 
> merged to stable/12 and are installed / managed by mergemaster.
>
> We'll do a coordinated sweep of the tree removing them after stable/12 
> drops out of support and we'll do similar commits to stable/13 to 
> reduce as much as possible any merge conflicts after that point.
>
> stable/13 and newer they are, of course, just noise. mergemaster 
> doesn't require them to be non-empty, but will skip modified files if 
> they match. Though it's been a while since I've used mergemaster... It 
> has no maintainer and only receives emergency fixes when something 
> breaks (and it usually takes a while for the right people to notice).
>
> Warner

Thank you for the reply and for revealing your official plans regarding 
$FreeBSD$ tags.

Marek Zarychta

>
> On Mon, May 2, 2022 at 12:25 PM Marek Zarychta 
> <zarychtam@plan-b.pwste.edu.pl> wrote:
>
>     Dear subscribers,
>
>     after one of the recent commits[1] surprisingly we got rid of
>     $FreeBSD$ from among others, two configuration files:
>     /etc/ssh/ssh_config and /etc/ssh/sshd_config. I was told these IDs
>     are going to be deprecated in the whole source tree when 12.x
>     branch reaches EoL, what is surprising news, at least for me.
>     While indeed empty $FreeBSD$ tags after the transition to git
>     became useless, leaving them in config files, still might be
>     handy. Please let me explain why.
>
>     After the transition to git, a lot of people complained about
>     breakage in mergemaster(8). Finally, they were told that this tool
>     is outdated, cannot do 3-way merge, has no maintainer, etc. so
>     it's going to be deprecated soon. Then appropriate notice was
>     added, the handbook got updated, so seemingly everyone was fine
>     with this depreciation. I am not going to bring any serious
>     arguments against etcupdate(8), but when providing support on IRC,
>     a few cases of foot shooting with this tool had been reported to
>     me and the last one happened this year IIRC. Moreover some people,
>     including me, just like and are used to old sdiff(1)-way work of
>     mergemaster(8).  So soon after the transition to git to overcome
>     this deficiency I wrote for myself a git primer helping with quick
>     creation of local repository including $FreeBSD$ recreation for
>     mergemaster(8) relying on empty $FreeBSD$ tags. I will attach this
>     primer[2] for users here, maybe someone (noncommitter) will
>     benefit from this (if it will not get burned with fire here earlier).
>
>     Please don't get me wrong, I am not fighting with etcupdate(8)
>     which works almost flawlessly in unison with freebsd-update(8),
>     but people who follow STABLE/CURRENT really do appreciate the
>     existence of mergemaster(8) and still use it behind the scenes,
>     including probably members of core@ team. I am only asking for
>     leaving these empty $FreeBSD$ IDs in config files. This will of
>     course add some burden to committers' work but might be beneficial
>     in the future. I am neither committer, nor contributor, but the
>     voice from the userbase.
>
>     Best regards,
>
>     Marek Zarychta
>
>     [1] https://cgit.freebsd.org/src/commit/?id=835ee05f
>
>     [2]
>
>     ########################################################
>     #
>     # FreeBSD Git src with worktrees and clean/smudge filters
>     # for mergemaster(8)
>     #
>     ########################################################
>     # Preparation of the tree
>
>     zfs create zroot/usr/src_head
>     zfs create zroot/usr/src_13
>
>     ########################################################
>     # Making src of stable/13 mountable in /usr/src
>       
>     echo "/usr/src_13 	/usr/src 		nullfs rw,late 0 0" >> /etc/fstab
>     mount -al
>
>     ########################################################
>     # Cloning the repository
>
>     cd /usr/src_head
>     git clonehttps://git.freebsd.org/src.git/  ./
>
>     ########################################################
>     # Adding filters
>     # Filters require lang/ruby and lang/perl installed
>
>     git config filter.freebsdid.smudge expand_freebsd
>     git config filter.freebsdid.clean 'perl -pe "s/\\\$FreeBSD[^\\\$]*\\\$/\\\$FreeBSD\\\$/"'
>
>     ########################################################
>     # Limiting filters scope
>     # In /usr/src_head create file .git/info/attributes with
>     # following contents (at least):
>
>     ------------cut------------
>     cat > .git/info/attributes << EOF
>     etc/* 	                filter=freebsdid
>     etc/*/*                 filter=freebsdid
>     libexec/rc/*            filter=freebsdid
>     libexec/rc/rc.d/*       filter=freebsdid
>     *.conf                  filter=freebsdid
>     dot.??*                 filter=freebsdid
>     lib/libc/gen/shells     filter=freebsdid
>     lib/libc/net/hosts      filter=freebsdid
>     lib/libpam/pam.d/*      filter=freebsdid
>     lib/libwrap/hosts.allow filter=freebsdid
>     usr.sbin/services_mkdb/services filter=freebsdid
>     usr.sbin/bsnmpd/bsnmpd/snmpd.config filter=freebsdid
>     usr.sbin/periodic/etc/* filter=freebsdid
>     usr.sbin/cron/cron/crontab filter=freebsdid
>     crypto/openssh/ssh*_config filter=freebsdid
>     EOF
>     ------------cut------------
>
>     ########################################################
>     # Smudge filter setup
>     # Create file /usr/local/bin/expand_freebsd with following
>     # contents and make it executable.
>
>     ------------cut------------
>     #!/usr/bin/env ruby
>     data = STDIN.read
>     last_info = `git log --pretty=format:"%h %ae %ad" -1`
>     puts data.gsub('$FreeBSD$', '$FreeBSD: ' + last_info.to_s + '$')
>     ------------cut------------
>
>     chmod a+x /usr/local/bin/expand_freebsd
>
>     ########################################################
>     # Adding worktrees
>     # Add worktree for stable/13, filters will be applied
>
>     git worktree add /usr/src_13 stable/13
>
>     # To have IDs in main (HEAD)
>     # do checkout of filtered files again
>
>     cd /usr/src_head
>     rm etc/master.passwd etc/group
>     rm libexec/rc/rc.d/*
>     git checkout -f -- .
>
>     ########################################################
>     # To find more files with $FreeBSD tags which might
>     # be added to .git/info/attributes file issue command:
>
>     find . -type f -a -not -name '*~' | xargs grep -l '$FreeBSD'
>
>     -- 
>     Marek Zarychta
>
--------------AmnHHBLpn03nhE2I6GGre0ZE
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">W dniu 2.05.2022 o 22:09, Warner Losh
      pisze:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANCZdfrEJSNbfMyRUPiH3ufq1yG8p6PZFvWCgB-CcgqB+GnYbg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">The current plans are to keep $FreeBSD$ in main
        until stable/12 is out of support. no new files will have it
        added, unless they are to be merged to stable/12 and are
        installed / managed by mergemaster.
        <div><br>
        </div>
        <div>We'll do a coordinated sweep of the tree removing them
          after stable/12 drops out of support and we'll do similar
          commits to stable/13 to reduce as much as possible any merge
          conflicts after that point.</div>
        <div><br>
        </div>
        <div>stable/13 and newer they are, of course, just noise.
          mergemaster doesn't require them to be non-empty, but will
          skip modified files if they match. Though it's been a while
          since I've used mergemaster... It has no maintainer and only
          receives emergency fixes when something breaks (and it usually
          takes a while for the right people to notice).</div>
        <div><br>
        </div>
        <div>Warner</div>
      </div>
    </blockquote>
    <p>Thank you for the reply and for revealing your official plans
      regarding $FreeBSD$ tags.<br>
    </p>
    <p>Marek Zarychta<br>
    </p>
    <blockquote type="cite"
cite="mid:CANCZdfrEJSNbfMyRUPiH3ufq1yG8p6PZFvWCgB-CcgqB+GnYbg@mail.gmail.com"><br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, May 2, 2022 at 12:25
          PM Marek Zarychta &lt;<a
            href="mailto:zarychtam@plan-b.pwste.edu.pl"
            moz-do-not-send="true" class="moz-txt-link-freetext">zarychtam@plan-b.pwste.edu.pl</a>&gt;
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Dear subscribers,</p>
            <p>after one of the recent commits[1] surprisingly we got
              rid of $FreeBSD$ from among others, two configuration
              files: /etc/ssh/ssh_config and /etc/ssh/sshd_config. I was
              told these IDs are going to be deprecated in the whole
              source tree when 12.x branch reaches EoL, what is
              surprising news, at least for me. While indeed empty
              $FreeBSD$ tags after the transition to git became useless,
              leaving them in config files, still might be handy. Please
              let me explain why.</p>
            <p>After the transition to git, a lot of people complained
              about breakage in mergemaster(8). Finally, they were told
              that this tool is outdated, cannot do 3-way merge, has no
              maintainer, etc. so it's going to be deprecated soon. Then
              appropriate notice was added, the handbook got updated, so
              seemingly everyone was fine with this depreciation. I am
              not going to bring any serious arguments against
              etcupdate(8), but when providing support on IRC, a few
              cases of foot shooting with this tool had been reported to
              me and the last one happened this year IIRC. Moreover some
              people, including me, just like and are used to old
              sdiff(1)-way work of mergemaster(8).  So soon after the
              transition to git to overcome this deficiency I wrote for
              myself a git primer helping with quick creation of local
              repository including $FreeBSD$ recreation for
              mergemaster(8) relying on empty $FreeBSD$ tags. I will
              attach this primer[2] for users here, maybe someone
              (noncommitter) will benefit from this (if it will not get
              burned with fire here earlier). <br>
            </p>
            <p>Please don't get me wrong, I am not fighting with
              etcupdate(8) which works almost flawlessly in unison with
              freebsd-update(8), but people who follow STABLE/CURRENT
              really do appreciate the existence of mergemaster(8) and
              still use it behind the scenes, including probably members
              of core@ team. I am only asking for leaving these empty
              $FreeBSD$ IDs in config files. This will of course add
              some burden to committers' work but might be beneficial in
              the future. I am neither committer, nor contributor, but
              the voice from the userbase.<br>
            </p>
            <p>Best regards,</p>
            <p>Marek Zarychta<br>
            </p>
            <p>[1] <a
                href="https://cgit.freebsd.org/src/commit/?id=835ee05f"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://cgit.freebsd.org/src/commit/?id=835ee05f</a></p>;
            <p>[2]</p>
            <pre>########################################################
#
# FreeBSD Git src with worktrees and clean/smudge filters 
# for mergemaster(8)
#
########################################################
# Preparation of the tree

zfs create zroot/usr/src_head
zfs create zroot/usr/src_13

########################################################
# Making src of stable/13 mountable in /usr/src
 
echo "/usr/src_13 	/usr/src 		nullfs rw,late 0 0" &gt;&gt; /etc/fstab
mount -al

########################################################
# Cloning the repository

cd /usr/src_head
git clone <a href="https://git.freebsd.org/src.git/" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://git.freebsd.org/src.git/</a>; ./

########################################################
# Adding filters
# Filters require lang/ruby and lang/perl installed

git config filter.freebsdid.smudge expand_freebsd
git config filter.freebsdid.clean 'perl -pe "s/\\\$FreeBSD[^\\\$]*\\\$/\\\$FreeBSD\\\$/"'

########################################################
# Limiting filters scope
# In /usr/src_head create file .git/info/attributes with 
# following contents (at least):

------------cut------------
cat &gt; .git/info/attributes &lt;&lt; EOF
etc/* 	                filter=freebsdid
etc/*/*                 filter=freebsdid
libexec/rc/*            filter=freebsdid
libexec/rc/rc.d/*       filter=freebsdid
*.conf                  filter=freebsdid
dot.??*                 filter=freebsdid
lib/libc/gen/shells     filter=freebsdid
lib/libc/net/hosts      filter=freebsdid
lib/libpam/pam.d/*      filter=freebsdid
lib/libwrap/hosts.allow filter=freebsdid
usr.sbin/services_mkdb/services filter=freebsdid
usr.sbin/bsnmpd/bsnmpd/snmpd.config filter=freebsdid
usr.sbin/periodic/etc/* filter=freebsdid
usr.sbin/cron/cron/crontab filter=freebsdid
crypto/openssh/ssh*_config filter=freebsdid
EOF
------------cut------------

########################################################
# Smudge filter setup
# Create file /usr/local/bin/expand_freebsd with following 
# contents and make it executable.

------------cut------------
#!/usr/bin/env ruby
data = STDIN.read
last_info = `git log --pretty=format:"%h %ae %ad" -1`
puts data.gsub('$FreeBSD$', '$FreeBSD: ' + last_info.to_s + '$')
------------cut------------

chmod a+x /usr/local/bin/expand_freebsd 

########################################################
# Adding worktrees
# Add worktree for stable/13, filters will be applied

git worktree add /usr/src_13 stable/13

# To have IDs in main (HEAD) 
# do checkout of filtered files again

cd /usr/src_head
rm etc/master.passwd etc/group 
rm libexec/rc/rc.d/*
git checkout -f -- .

########################################################
# To find more files with $FreeBSD tags which might
# be added to .git/info/attributes file issue command: 

find . -type f -a -not -name '*~' | xargs grep -l '$FreeBSD' </pre>
            <p> </p>
            <pre cols="72">-- 
Marek Zarychta</pre>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>

--------------AmnHHBLpn03nhE2I6GGre0ZE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8fc7dc93-4fcb-832c-d950-05c85dcde893>