From nobody Thu Jan 27 19:12:46 2022 X-Original-To: dev-commits-src-all@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 530A61975FBB for ; Thu, 27 Jan 2022 19:12:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4Jl9GM0TN8z4dkK for ; Thu, 27 Jan 2022 19:12:59 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643310779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nyiPiDZ5IX5/sIIxZ4Ib9TS67U7E6y7fU9BJaW22Pp4=; b=U0JkWJhOFSxlXPLq+HN1H3oWqM5SvajVJFXWST0uNC4HYbvvS0kRn0EQPyCmeYs9nRjmPU N8X4vXud2GYKRIunjmlNJmVsPiTeneOjmsdexM5xy43Lzh4KHFFgl5uCGL4/rMT9D8abDE YhuY2haxyAjkKK5iTft/ERShTpZb64a7UnB9vqvjTkEot5js2tCn7jl1D6EqkKuRi4wxIb 6bHRS10JiQDg2ECb8rV9OGX0u2uzy1YZXMhfTkAy0Mvu6UvF6yV/xbe0KhQGNnvS7sumN5 xlZ0t9RXBtsMo7xdetcu125FZAby/e85P277Agg/eRaMV/sd3f0/9nnJgnP71g== Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 D634C5018 for ; Thu, 27 Jan 2022 19:12:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f53.google.com with SMTP id g13so3741765qvw.4 for ; Thu, 27 Jan 2022 11:12:58 -0800 (PST) X-Gm-Message-State: AOAM533aPuA08Zd1T5AW8I/gqqOd6YdVSsvuJ76hdV1RHkEqY5/uWRTt 9SLHRSc5rgG8tJuircDvo9b5wi3xzN2DjxqcU78= X-Received: by 2002:ad4:5cc3:: with SMTP id iu3mt5084201qvb.79.1643310778291; Thu, 27 Jan 2022 11:12:58 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202201271802.20RI2frC035360@gitrepo.freebsd.org> In-Reply-To: <202201271802.20RI2frC035360@gitrepo.freebsd.org> From: Kyle Evans Date: Thu, 27 Jan 2022 13:12:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 848263aad129 - main - cp: fix some cases with infinite recursion Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643310779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nyiPiDZ5IX5/sIIxZ4Ib9TS67U7E6y7fU9BJaW22Pp4=; b=u4CJlklVvnpQWnUyZAtd2f638V1+Sv6p8zKdoXBoWvrFUkBKs6gsW9znZHenFEwVtDGM1+ LTFfJYY2B7sLClVABno/ji7DtVfYaX8TuLclHPLiUlk6ikBhKCGWC9iCKAKrVcRpfCzbF2 hkKrOSObREspNFO7yLVcF/FBUcm9qSmS9I3GBoMzOBRRO9sJo8zeu7tdfw30NbdcfxogpQ rlDtfgGTF5nClb3mPo2iaSjGqySEdN4K0Az4Avq+vbE/F+2KgvD95s1rmQE/Bsi63txY2/ hZkJO40wlI7cj+MU2GeIR2K9GE8eREKt8sibJIJNhXrMMocIUREDOWCRHEVGIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643310779; a=rsa-sha256; cv=none; b=DHezBlVhcskvoZ65P4fL0uH7ZV/a3tsiZu8c8BVjhBHeY5s5azWVyljHcHeGAK3WzcAhdh LCQqiKFJzNe6yGOnfbfgOS1VrWWEpsVlngSRaycgDaIlK/d6D07OYDAME3IideU8S30OWM md/fwMfS0rBUvhcz4Lv+oLQS7nF7SpZsqBtpg0OgdKEwD7WI9Q6wmU3zLMlNm003+mT4wh dBipmZnW2gAmI4n4YJdoKtwivfHv0OufakH9A4EAEYllA6vBHCxMAdYH8NR0YBVnSFDYbV 5V+CZvpOM60qymloLl2Bf2eH/mjW6r6ir0caLFUIckWqvxay5D87xOiOMyKcGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Thu, Jan 27, 2022 at 12:02 PM Kyle Evans wrote: > > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=848263aad129c8f9de75b58a5ab9a010611b75ac > > commit 848263aad129c8f9de75b58a5ab9a010611b75ac > Author: Kyle Evans > AuthorDate: 2022-01-27 18:02:17 +0000 > Commit: Kyle Evans > CommitDate: 2022-01-27 18:02:17 +0000 > > cp: fix some cases with infinite recursion > > As noted in the PR, cp -R has some surprising behavior. Typically, when > you `cp -R foo bar` where both foo and bar exist, foo is cleanly copied > to foo/bar. When you `cp -R foo foo` (where foo clearly exists), cp(1) > goes a little off the rails as it creates foo/foo, then discovers that > and creates foo/foo/foo, so on and so forth, until it eventually fails. > > POSIX doesn't seem to disallow this behavior, but it isn't very useful. > GNU cp(1) will detect the recursion and squash it, but emit a message in > the process that it has done so. > > This change seemingly follows the GNU behavior, but it currently doesn't > warn about the situation -- the author feels that the final product is > about what one might expect from doing this and thus, doesn't need a > warning. The author doesn't feel strongly about this. > > PR: 235438 > Reviewed by: bapt > Sponsored by: Klara, Inc. > Differential Revision: https://reviews.freebsd.org/D33944 > Thinking about this some more, I think it's still wrong but less wrong than it was before. Specifically, I think: - `cp -R foo foo` -> now does the right thing, we copy foo/* into foo/foo but we don't end up with a foo/foo/foo - `cp -R foo foo/subdir` -> is still wrong, if foo/subdir/x existed then we should end up with foo/subdir/foo/subdir/x but not foo/subdir/foo/subdir/foo I'm going to leave it since it's less bad than before (infinite recursion), but I intend to iterate on it once more... thanks, Kyle Evans