From owner-dev-commits-ports-all@freebsd.org Thu Apr 8 15:25:11 2021 Return-Path: Delivered-To: dev-commits-ports-all@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 2309F5DED65; Thu, 8 Apr 2021 15:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FGQ7C0V1nz3PYd; Thu, 8 Apr 2021 15:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03C954E8B; Thu, 8 Apr 2021 15:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 138FPAf9024028; Thu, 8 Apr 2021 15:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 138FPAZ4024027; Thu, 8 Apr 2021 15:25:10 GMT (envelope-from git) Date: Thu, 8 Apr 2021 15:25:10 GMT Message-Id: <202104081525.138FPAZ4024027@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rene Ladan Subject: git: ce196940be57 - main - tindex: fix when INDEX fails and ports are deleted since the last success. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce196940be576646bf30593d6781df3a0170a947 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 15:25:11 -0000 The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=ce196940be576646bf30593d6781df3a0170a947 commit ce196940be576646bf30593d6781df3a0170a947 Author: Rene Ladan AuthorDate: 2021-04-08 15:18:22 +0000 Commit: Rene Ladan CommitDate: 2021-04-08 15:25:06 +0000 tindex: fix when INDEX fails and ports are deleted since the last success. `git log' cannot get the log of a non-existent file, which the script uses to obtain the last person who touched a port, so check if the file exists before getting its log. This is similar to the Subversion case, which only inspected changed files. The Git version still also checks added ports. While here, call git in blame() using the predefined global variable. Reported by: antoine --- Tools/scripts/tindex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/tindex b/Tools/scripts/tindex index 9adbfc4e7b80..cf8eb8c6ce8e 100755 --- a/Tools/scripts/tindex +++ b/Tools/scripts/tindex @@ -42,9 +42,11 @@ fi # -------------------------------------------------------- blame() { - # Find out who is responsible for current version of file $1 + # Find out who is responsible for current version of file $1, if not deleted - git log --no-patch --max-count=1 --format='%ce' $1 + if [ -e $1 ]; then + ${GIT} log --no-patch --max-count=1 --format='%ce' $1 + fi } indexfail() {