From owner-freebsd-git@freebsd.org Wed Jul 22 17:17:29 2020 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 E4DDE359D1D for ; Wed, 22 Jul 2020 17:17:29 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a05:fc87:1:5::15]) (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 (2048 bits) client-digest SHA256) (Client CN "www.spoerlein.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBhwm56Lxz4T8Z for ; Wed, 22 Jul 2020 17:17:27 +0000 (UTC) (envelope-from uqs@freebsd.org) Received: from localhost (acme.spoerlein.net [IPv6:2a05:fc87:1:5:0:0:0:15]) by acme.spoerlein.net (8.15.2/8.15.2) with ESMTPS id 06MHHHpb019961 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 22 Jul 2020 19:17:18 +0200 (CEST) (envelope-from uqs@freebsd.org) Date: Wed, 22 Jul 2020 19:17:17 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Dan Langille Cc: freebsd-git@freebsd.org Subject: Re: FreshPorts status update 2020.07.21 Message-ID: <20200722171717.GG16439@acme.spoerlein.net> References: <3c7b8854-f5e8-4c72-acb3-f1147eae9df3@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7b8854-f5e8-4c72-acb3-f1147eae9df3@www.fastmail.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4BBhwm56Lxz4T8Z X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:39540, ipnet:2a05:fc87::/32, country:CH]; local_wl_from(0.00)[freebsd.org] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.33 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: Wed, 22 Jul 2020 17:17:30 -0000 On Tue, 2020-07-21 at 20:02:48 -0400, Dan Langille wrote: > Hello, > > At present, devgit.FreshPorts.org is keeping up with all port commits. > > Processing is initiated manually. I run a script to set some flags. This could be run by a commit-hook pulling a URL. FreshPorts can do the rest. I welcome discussion on how to do this. > > I'd rather keep the URL private, for less abuse-potential. We could add in some auth or ACL. Invoking the URL will get FreshPorts to query the FreeBSD repo. > > > I've posted the following issue at https://github.com/FreshPorts/git_proc_commit/issues/23 > > ### > I am having trouble detecting a port delete or copy. Under subversion, as seen at https://svnweb.freebsd.org/ports?view=revision&revision=542761, you get a deleted notice. > > In the email (https://docs.freebsd.org/cgi/getmsg.cgi?fetch=1326960+0+current/svn-ports-head) this turns up as: head/net/kdav/ under Deleted. > > In git, it does not, from what I can tell. I can find: > > $ grep net/kda 2020.07.21.17.15.38.000000.d016c9140a6e4b7627d26485926a659f2686185d.xml > - net/kdav became a framework and was therefore moved to net/kf5-kdav. > > > > > (Sorry, the above is the XML generated by https://github.com/FreshPorts/git_proc_commit/blob/master/git-to-freshports/git-to-freshports-xml.py) > > Knowing that a file has been deleted within a commit is vital. Detecting it from within the commit log is the optimal approach. Does anything have a suggestion here? > > I can see that the Makefile & pkg-plist have been renamed, and distinfo has been deleted. Perhaps it's just a matter of changing my approach. However, this does not yet sound like a solid plan. > > I welcome suggestions for something I have missed in the git interface please. I don't know how stable these interfaces and outputs are in git over time, but you can get the full diff with git log -p or git show -p and could feed that through, say diffstat. A better approach might be to use --compact-summary (see the git log manpage for some possible outputs and variants of it). (I'm using --format here to suppress printing of the commit message, which might mess up parsing the output we're actually interested in) $ git show --compact-summary --format=%h 44b2876caf1f56d6e940a329a2f8e06724fd621f 44b2876caf1f MOVED | 1 + devel/Makefile | 1 - devel/py-trio/Makefile (gone) | 38 -------------------------------------- devel/py-trio/distinfo (gone) | 3 --- devel/py-trio/pkg-descr (gone) | 13 ------------- 5 files changed, 1 insertion(+), 55 deletions(-) Probably even better is this: $ git show --summary --format=%h 44b2876caf1f56d6e940a329a2f8e06724fd621f 44b2876caf1f delete mode 100644 devel/py-trio/Makefile delete mode 100644 devel/py-trio/distinfo delete mode 100644 devel/py-trio/pkg-descr (why does this drop the changes to MOVED and devel/Makefile though? The manpage entry is cryptic enough: Output a condensed summary of extended header information such as creations, renames and mode changes. ) hth Uli