Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14173

Re: Bash patches format

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Emanuel Haupt <ehaupt@FreeBSD.org>
Newsgroups gnu.bash.bug
Subject Re: Bash patches format
Date Wed, 30 May 2018 10:30:10 +0200
Lines 126
Approved bug-bash@gnu.org
Message-ID <mailman.797.1527683206.1292.bug-bash@gnu.org> (permalink)
References <CADv8-ohtoJJWDUuo9goOXhNORuVJSci+oi1VEygM5JSijcfZ2w@mail.gmail.com> <20180530070456.p36falhq66wfgxqk@proprietary-killer>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA512"; boundary="Signature=_Wed__30_May_2018_10_30_10_+0200_2S/Wd3zE7zPDGXJr"
X-Trace usenet.stanford.edu 1527683207 24119 208.118.235.17 (30 May 2018 12:26:47 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Clark Wang <dearvoid@gmail.com>, Chet Ramey <chet.ramey@case.edu>, bug-bash@gnu.org, ncopa@alpinelinux.org, ldv@altlinux.org, glebfm@altlinux.org, jeffbai@aosc.xyz, bpiotrowski@archlinux.org, doko@debian.org, core-ports@crux.nu, ehaupt@freebsd.org, base-system@gentoo.org, jan.steffens@gmail.com, demm@kaosx.us, ubuntu-devel-discuss@lists.ubuntu.com, raimue@macports.org, zap@homelink.ru, milang@tal.org, oberon@manjaro.org, simons@cryp.to, naddy@openbsd.org, nobodydead@gmail.com, tpgxyz@gmail.com, naoir@gmx.net, pkgsrc-users@netbsd.org, andrew.lukoshko@rosalab.ru, alex2048@mail.ru, trisquel-devel@listas.trisquel.info, openwrt-devel@lists.openwrt.org
To "Marty E. Plummer" <hanetzer@startmail.com>
Envelope-to bug-bash@gnu.org
X-Authentication-Warning milkyway.critical.ch: Host 163.169.79.83.dynamic.wline.res.cust.swisscom.ch [83.79.169.163] claimed to be localhost
In-Reply-To <20180530070456.p36falhq66wfgxqk@proprietary-killer>
X-Mailer Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd11.1)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a01:4f8:c17:de4::1:1
X-Mailman-Approved-At Wed, 30 May 2018 08:26:45 -0400
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14173

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

"Marty E. Plummer" <hanetzer@startmail.com> wrote:
> On Wed, May 30, 2018 at 10:42:27AM +0800, Clark Wang wrote:
> > On Wed, May 30, 2018 at 8:25 AM, Marty E. Plummer
> > <hanetzer@startmail.com> wrote:
> > 
> > > > If people are willing to do the conversion between patch
> > > > formats for
> > > their
> > > > own purposes, more power to them. I don't see any compelling
> > > > reason to change the format I use.
> > > >
> > > Could I at least convince you to start doing -p1, if not unified?
> > >
> > 
> > I think the cost is too high. All bash package maintainers on
> > different *nix systems will have to change accordingly.
> > 
> > -clark
> Well how about this; we ask the downstreams. List taken from repology,
> hopefully these are still all active and accurate. So, to reiterate
> the original premise of this thread for the newly added, I suggest the
> following:
> 
> 1. Change the official upstream bash patch format to be -p1
> applicable, as a number of major linux distros either convert the
> patches in their own source repo to -p1 (debian and its children,
> fedora and its children), or have to take an explicit deviation from
> their default patch application method (gentoo) in order to apply -p0
> patches.
> 
> Optional:
> 2. Change the format of the patch from a context diff to a unified
> diff, for the following reasons:
>     a. unified diffs are generally smaller than an equivalent context
>     diff, while encoding the same information.
>     *** a/lib/readline/history.c    2015-12-28 13:50:31.000000000
> -0500
>     --- b/lib/readline/history.c    2016-09-30 14:28:40.000000000
> -0400 ***************
>     *** 308,312 ****
>     	{
>     	  if (history_stifled && history_max_entries > 0)
>     !           history_size = history_max_entries + 2;
>     	  else
>     	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
>     --- 310,316 ----
>     	{
>     	  if (history_stifled && history_max_entries > 0)
>     !           history_size = (history_max_entries >
> MAX_HISTORY_INITIAL_SIZE) !                               ?
> MAX_HISTORY_INITIAL_SIZE !                               :
> history_max_entries + 2; else
>     	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
> 
>     --- a/lib/readline/history.c    2015-12-28 13:50:31.000000000
> -0500 +++ b/lib/readline/history.c    2016-09-30 14:28:40.000000000
> -0400 @@ -308,5 +310,7 @@
>     	{
>     	  if (history_stifled && history_max_entries > 0)
>     -           history_size = history_max_entries + 2;
>     +           history_size = (history_max_entries >
> MAX_HISTORY_INITIAL_SIZE)
>     +                               ? MAX_HISTORY_INITIAL_SIZE
>     +                               : history_max_entries + 2;
>     	  else
>     	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
> 
>     b. <opinion> unified diffs are easier to size up at a glance than
>     context diffs.
> 
>     c. <conjecture based on personal observation> unified diffs are
> the standard for a host of foss projects, especially those using git
> as a vcs solution as it produces context diffs by default and you
> have to purposely change it to do otherwise.
> 
> Maintainers, I'd really like to hear your thoughts on this matter. If
> the diffs are produced as -p1 unified diffs, then downstreams who do
> convert from -p0 context won't have to, and distros who work around it
> won't either.

FreeBSD ports/package maintainer here.

The FreeBSD ports framework uses -p0 by default:

# make -VPATCH_STRIP -C /usr/ports/shells/bash
-p0

As long as all patches come with the same patch strip level I could
simply change the PATCH_STRIP variable.

Our porters handbook advertises unified diffs:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/slow-patch.html

Personally I find unified diffs easier to read. From a FreeBSD
viewpoint I don't see a need to switch from -p0 to -p1.

Then again I have no strong feelings one way or the other.

Emanuel

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Bash patches format Emanuel Haupt <ehaupt@FreeBSD.org> - 2018-05-30 10:30 +0200

csiph-web