Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Feb 2021 21:10:32 +0000
From:      Rene Ladan <rene@freebsd.org>
To:        Brandon Bergren <bdragon@freebsd.org>
Cc:        John Mehr via freebsd-git <freebsd-git@freebsd.org>
Subject:   Re: Ports Repocopy
Message-ID:  <20210222211032.GA21063@freefall.freebsd.org>
In-Reply-To: <e3d39a6b-eaf8-4f13-bd7d-28363ae5a7dd@www.fastmail.com>
References:  <202102221945.11MJjCiO063445@slippy.cwsent.com> <e3d39a6b-eaf8-4f13-bd7d-28363ae5a7dd@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <filename>` 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.

René



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210222211032.GA21063>