From owner-freebsd-git@freebsd.org Tue Mar 2 09:12:47 2021 Return-Path: Delivered-To: freebsd-git@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC47562149 for ; Tue, 2 Mar 2021 09:12:47 +0000 (UTC) (envelope-from rene@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DqWcb5T2nz3LLP; Tue, 2 Mar 2021 09:12:47 +0000 (UTC) (envelope-from rene@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614676367; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yuqz//QAND/2aYPHmRoDxL0lYnyp9PpPENMCBolF50Q=; b=hvG0L5R59k82Uyeiz4D6vPTYTadvihJNu59b3LaY3NjOYTzc4OKuQTLWI8Ao4O3hkrz8Rr 83kmBLheZPTiksNOt4MJFWZQxelZacKHV0IE8ELJBnnDfnvFSBYCwl7fWQP6ZhWrmJa7gj sdGqKFZFAWPIWww3y8efTONpMv4Amuu/vNQVdA4j6x5YtX5QBHh28+7n5ZiByKTU07CNXc 5quYQ3HpWsu0Pm0KBh4vVYFbh/d7inv4C4KBi8FS0mLWO6R9ejQpKYhgs4uxY0Z/aiScZ3 jn3eeCzMP+zJ6FgS0spLn9ee9qhIQA8oQ1kdy98hpjhrw/gNzVpXQ/Wnfax9eA== Received: by freefall.freebsd.org (Postfix, from userid 1185) id ACDB31A14C; Tue, 2 Mar 2021 09:12:47 +0000 (UTC) Date: Tue, 2 Mar 2021 09:12:47 +0000 From: Rene Ladan To: Brooks Davis Cc: Brandon Bergren , John Mehr via freebsd-git Subject: Re: Ports Repocopy Message-ID: <20210302091247.GA97315@freefall.freebsd.org> References: <202102221945.11MJjCiO063445@slippy.cwsent.com> <20210222211032.GA21063@freefall.freebsd.org> <20210301235618.GD50170@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210301235618.GD50170@spindle.one-eyed-alien.net> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1614676367; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yuqz//QAND/2aYPHmRoDxL0lYnyp9PpPENMCBolF50Q=; b=bW25CFJtmOXIZsMUCjnQMqgaldkLxc641RqngeDGSfywocgUaMjsl/67n9j344h2PkzGFQ awjdUHh2cK/qzAUlb+FHg4er/WAkHGknSqYcif5zxru8KKZmqQDTiuvZZq9tkcELDWfSbq slcGLzDkl08o4CBuJl1DzBOK4b1WxHaRkSXAidex0wdB/03I/LE/8Reeps7HyoEvuKETFZ 2T1NBOja2vM6WuzWZW69GRU7FNA6g1SRemwR2pd6hyE6gaeGi7wzZK70lKsw3RCbyZaLPX 6kdQk/QhQ8UqTv+yoTcZB0K2yl7Q0bU0BIlcrSeTeWEqXnTelEXNgtK8qjB9Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1614676367; a=rsa-sha256; cv=none; b=gtD1GnS662pJMyWsdt1Ox95BumylGNXobnffPFq6pFzIo/hI3zI4wR9v5o7uH7GgXrrPO5 sTT7ayWSWtUlrlX+CrMe10uacJK3+51xf58VKD8MISokutIRg7zYZcSapqZUsTn6mph+V3 OpVJDluBO9eTvNLP1oIZks3/NPL5Ew1YVYHVMSJE6gZND4RwGuLBSqOWpdrsyYhNHHxMSZ +fOCfMogQfi9RpFKmRnAXhmebCLmNMJzVh9zl2KJKXW1WE1SR+P1py92TbOS3Z75GHM1kT zhS2BH9eaK0GeiDL1tgqOlhWU+g21nbl83aN4BE1fv1c2mBRLXtZHhB7PyUMDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 09:12:47 -0000 On Mon, Mar 01, 2021 at 11:56:18PM +0000, Brooks Davis wrote: > On Mon, Feb 22, 2021 at 09:10:32PM +0000, Rene Ladan wrote: > > On Mon, Feb 22, 2021 at 02:46:40PM -0600, Brandon Bergren wrote: > > > On Mon, Feb 22, 2021, at 1:45 PM, Cy Schubert wrote: > > > > When ports switches to GIT, given that there is no GIT equivalent to svn > > > > copy will repocopy become a thing of the past? Will we live with this or > > > > will there be some kind of procedure ports committers must follow to > > > > approximate a repocopy? > > > > > > > > > > Renames and copies in git are inferred, not tracked. > > > > > > About all you can do to make following stuff easier across a copy is to cp -a and immediately commit, before making any changes, so that it shows up in the index with identical file hashes as what it was copied from. > > > > > > Following a file's history across a copy is dependent on the settings the person looking at the history is using. > > > > > > It is not enabled by default because it is an extremely expensive operation -- it is O(n^2) where n is the number of files in the tree, plus even then it only works if the original file was modified in the same commit. Otherwise you have to use --find-copies-harder which is an even more expensive option. > > > > > > If the commit was done by committing an unmodified version first, you can theoretically use `git log --follow -C100% --find-copies-harder ` which should probably be able to do its work without having to compute similarities on all of the objects. But if you have many files with the same contents, I don't really know what the log will look like past that point. I *think* it will just randomly mix history. I haven't tested it though. > > > > > > I suppose writing a tool that adds metadata about the copy to a git note or something would be the best way to track this stuff... > > > > Hm, or just write something at the bottom of the commit message, like > > cherry-pick -x does? I remmber that emaste suggested something like this > > in the last git working group meeting. > > For simple cases like copying one port or resurrecting one port, I think > the easiest thing to do is to cause the new copy to exist in one commit > (but don't hook it up) and then update it. E.g., > > resurrection: > git revert --no-commit > > git revert --continue (or whatever the equivalent is) > > git add + git commit > > copying: > git cp cat/port cat/portng Alas, there is no "git cp", only "git mv". Or did you mean a plain "cp"? > git commit cat/portng > > git add + git commit > > This gives git the best chance to infer the right history by ensuring > identical files are copied. I think the copying case will work better > than resurrection from a tooling perspective. Resurrection will likely go > best if ports are deleted in independent commits rather than in one big > one during expiration. > Hm, the git version of rmport still creates one big commit when removing multiple ports, but I can probably change that to individual commits (and one push at the end). René