From nobody Sat Apr 09 03:44:34 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E8B781A97C07; Sat, 9 Apr 2022 03:44:47 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kb1G74TCzz3Qhn; Sat, 9 Apr 2022 03:44:47 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649475887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HccpfTPByUs1r/d4/HLDOSSDmQwfELQvqYaDT9Iv0h4=; b=DgSaBuMWWBA+ClhqbENhnqJ/1jgLsvMNOscT3U7E+x7k3VG4AyxlU27MvfEXxKe8tv5S3b vgzyNl/rkOk3wHwdK6VzEQmSJkb0TRMjEjSQS+iQefAxHu92xtSQ5lFRojrLSmgEc7xOJc nmBGZyo7jWN2Fc9Tbd7MRXfeGMvTl5ARyIIqS5jwq8KfOnndkzEE49igmO+vpky5nV4W8q DL19+LUgCZGxZ/Q6jX8pVtkj9r2u6T7eK1Dy8DF+1dks1VJjqGUendu2quOB1+fwxnsQHB ewzfCJyN5DuXYD6UyYFT4fSjRC1LH/veXYFmzht6VXtkQR9jxqOnlTbbjnbDDQ== Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5FAC7271F; Sat, 9 Apr 2022 03:44:47 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f179.google.com with SMTP id b43so13710145ljr.10; Fri, 08 Apr 2022 20:44:47 -0700 (PDT) X-Gm-Message-State: AOAM531lZgrUJQwLnN8nCyOtq+0q/nFccxrzbUojXR7eq1NQ/oF/XETO Vow68q0hLwkwbiimAWzkPL0IZBzJJ0Ygsx9y9Rg= X-Google-Smtp-Source: ABdhPJzyPcKOYpvFh9ArJmbICY95A33Gktc3Upb5Zu5sNLf3KNGuZeUVG4D2ZGafAMjfxUzEIR40mqfAHi9X867/zmU= X-Received: by 2002:a2e:7c16:0:b0:246:377b:f802 with SMTP id x22-20020a2e7c16000000b00246377bf802mr13466303ljc.155.1649475885638; Fri, 08 Apr 2022 20:44:45 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Kyle Evans Date: Fri, 8 Apr 2022 22:44:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] patch's default backup behavior To: Warner Losh Cc: "freebsd-arch@freebsd.org" , FreeBSD Hackers , ports-list freebsd Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649475887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HccpfTPByUs1r/d4/HLDOSSDmQwfELQvqYaDT9Iv0h4=; b=Kg/mpDa9tbUD1YPmM6owe7FdJaCyQXBZ5qtSZxCk2Ud/IjHPS8zTshWqh8dVVrAmruq3x7 ckr1DUTI8AVh0pZC1F/NCqqagpVlK79tmfa++lPFOIZl/V8zSRabr6TspnvSMz96Hq4HCw nZm6egqeOIm3a9ZPMKMyYsSkoE28rMhCh7KH3v//7r1TikB3u9rKDTpRTrFbM2HeoCQXAa 0eE4+VbzRcCao8X6G2Uw+AICiPdM8cyh9l1JZAHeprkc1SXZiWmwGC9c6TMWaAS8eZmd+m wF8L7jytTxd5KsYUI+foW22fvmOwr2zKcSro7AoxyCuiseQSCIyGDrOqVdwq0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649475887; a=rsa-sha256; cv=none; b=KhwikacqGO/22AH//0hMpXIccETK3XXZvNI385rwHlmME7pSMit0Emx67y8hDt0ZCV1MXg mGhP0+jjO+8HGQ7ZmFUFkueJwH2b7gpG618zY5iBI2pcr3LYDIvTi3WQ2MB2IQXqRUL2JG rN/1LX9DnviP+nEczYGwPU75PxT9CxsUA7ETQzvZNe8a1oODqmK+wZ1e2SAEw/lvKlaguQ GNT6lcR0v5sqczZWRUFI+qZZK7aJK2GQxPbIhZTiTC/rzFobGWs/mxNor6Jr+NrzF1ucVW fV8L34QlkzQaCro0b5uZSBlBulvQXRh5JkjOqhqJdAZxeD+CQKzStsKP36zcSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Fri, Apr 8, 2022 at 10:41 PM Warner Losh wrote: > > > > On Fri, Apr 8, 2022, 9:26 PM Kyle Evans wrote: >> >> Hello! >> >> FreeBSD's patch follows historical patch(1) behavior w.r.t. backups, >> where a backup is created for every file patched. >> >> I'd like to test the waters on switching this to the GNU behavior, >> which feels a whole lot more reasonable. Notably, they'll only create >> backup files if a mismatch was detected (presumably this means either >> a hunk needed fuzz or a hunk outright failed). This yields far fewer >> backup files in the ideal scenario (context entirely matches), while >> still leaving backup files when it's sensible (base file changed and >> we might want to regenerate the patch). >> >> Thoughts / comments / concerns? Cross-posted this to a couple of >> different lists to try and hit the largest number of stakeholders in >> patch(1) behavior. > > > Could one select the old behavior? Or would it just be a change? A new -V value? > Yeah, the current behavior is actually represented by the `-b` flag. With the new behavior, we'd specifically implement `--backup-if-mismatch` (a nop from the beginning), `--no-backup-if-mismatch` (turn off backups, equivalent to `-V none` but "lighter" in that it won't override -b/-V) and we'd leave existing flags otherwise alone. > I like the Idea. > > Warner > >> Thanks, >> >> Kyle Evans >>