From owner-svn-src-head@freebsd.org Tue Dec 5 16:29:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75633E6FC45; Tue, 5 Dec 2017 16:29:33 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C7C1C66; Tue, 5 Dec 2017 16:29:33 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-wr0-x243.google.com with SMTP id q9so936725wre.7; Tue, 05 Dec 2017 08:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0XZsZWFTd4dhIZ/cr/nff6iVquOV45bM9OPboAOJjcQ=; b=iZnPXNp9SUhrPaHaB9e56f8SmSFp5SW1NZTCBoUI/TFr2ipkxQ2x3fhWPwC8b+jhjf JMTYeTUb2ZoCQPie7Qdapx4OyLm6dC6Ddvzsrs3N4PuOg+NBKZIEa5WiUn8ZNDYBvw57 0rVKLJ1g5dQ64Cqwq5Lp1PoSofd87wfoAS1H8/CdUYZwiDnCZZGO0PYnlxrEJ+i3L7y+ kEjm9xS3aJQuVdJd5AcY1uSiE0BMgJuD9WkkyWfSvxGCYQFfqMfQ2gKGFKVA42u4FiUh QHQGsxicwEhTQoKNcTZhGSe9j7aWg6KQogp9uB3nvW9kqUR3/0shH5uB5lI/zvnHyLRn nwiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0XZsZWFTd4dhIZ/cr/nff6iVquOV45bM9OPboAOJjcQ=; b=Nk1MKOzOQXmI+1M4/ozLjOVmbeI62q0kYOdhUXgdg/nhftPlQwSM9Q5KaBdtc7lUxj JBlCnSrMqdND49tFHIXdqbu6x7iDm0VOHJIg0wOZeCob8MNpmBE/a3FkpXkxYeY29YNW btieIge+uxqdY3GibCdx0cjb0VMxuClUX1WcDHnUYiqxfMnjsQ+bTRJmYe8tiHfUc2e9 8K3blok0uKbya3ps0ZrTr2V0VBWMD59jGlFiOdyTjStzGYiTPYtpbQ9TcCd5QCwPB4jR u/lULaGQSmUSFZcd+YPXi7i2BZoUDB5OGJzdaGw+kfl5FNBaSiau6r4btMsQEfxx371g 6pHQ== X-Gm-Message-State: AJaThX5XpEqq8BEkBi8Img2aiRX875+vn+ymza4MRP4QvFdfWcKrEmR8 AlRUt0GlbFIWz/ITqPaBn0xPq5Pib7OS6aZYb78= X-Google-Smtp-Source: AGs4zMY9rEXYoF+cZdcEYLkOUNfBDw5k8mR6VVJ7vulLzzOB54nVmM1i9f/shiz44z53RSzoewCT6RdpxIzVeE5APao= X-Received: by 10.223.163.11 with SMTP id c11mr17677593wrb.214.1512491371299; Tue, 05 Dec 2017 08:29:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.196.9 with HTTP; Tue, 5 Dec 2017 08:29:30 -0800 (PST) In-Reply-To: <16BDAEF5-87B3-482F-B5AB-372E128D0514@shxd.cx> References: <201712051258.vB5CwjQN051356@pdx.rh.CN85.dnsmgr.net> <22918eec-4c98-01e4-4c63-e145fbc6eab9@selasky.org> <16BDAEF5-87B3-482F-B5AB-372E128D0514@shxd.cx> From: Matt Joras Date: Tue, 5 Dec 2017 08:29:30 -0800 Message-ID: Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee To: Devin Teske Cc: Hans Petter Selasky , rgrimes@freebsd.org, cem@freebsd.org, Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 16:29:33 -0000 On Tue, Dec 5, 2017 at 8:06 AM, Devin Teske wrote: > > > The problems I have are: > > 1. Should be in ports > > Not pre-installed on Linux, why should we have it in base? "Pre-installed on Linux" is meaningless. The closest analog to our base is arguably GNU coreutils. It is indeed not part of GNU coreutils but then again there are several things in our base that are not in coreutils, and vice versa. Why should we have anything in base? If people find it useful and it doens't have a high cost of maintainership then why not have it? > If in base, people will target it thinking it solves a need that can't > otherwise be solved and thus end up creating a script that is less portable > because it is encumbered with dependencies specific to our base. It's not even a homegrown idea though... As we've already covered this is a tool that exists in the broader OSS ecosystem. As long as it is compatible with the more common implementation I don't see the issue. Anything one writes using it is just "encumbered" with a dependency on sponge. > 2. Teaches bad practice > > sed ... somefile | sponge somefile > > Ignores if there is a sed error and indiscriminately zeroes somefile. Calling this unequivocally bad practice is silly. There are plenty uses of sponge that aren't bad practice. I have a git commit hook that utilizes sponge to do the same "auto-culling" that our svn patches do. I like the sponge version better than creating temporary files myself: sed '/^$/d' $(git config commit.message) | awk 'NR==FNR{a[$0];next} !($0 in a)' /dev/fd/0 "$1" | sponge "$1" > 3. Solution in search of a problem Again, stating this unequivocally is silly. I discovered sponge years ago when I was searching how best to handle something where I wanted to write output back to the same file in a shell pipeline. I was literally someone with a problem in search of a solution, and that solution was and still is sponge. Since then I have seen it recommended numerous times in passing. Matt