From nobody Tue Apr 16 08:26:33 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547393363032169.57626889049197; Sun, 13 Jan 2019 07:29:23 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97E0F3680F; Sun, 13 Jan 2019 15:29:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89E5F424E; Sun, 13 Jan 2019 15:29:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 77389181BA1A; Sun, 13 Jan 2019 15:29:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0DFTKEj029660 for ; Sun, 13 Jan 2019 10:29:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id C7265424E; Sun, 13 Jan 2019 15:29:20 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3370B18371 for ; Sun, 13 Jan 2019 15:29:17 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Sun, 13 Jan 2019 16:29:17 +0100 Message-Id: <20190113152917.3476-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH v2] applier: synchronize tags lazily into the cache X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 13 Jan 2019 15:29:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Every time the patchew's applier mode is restarted, it repopulates a cache of git repositories. For QEMU, the git repo has thousands of tags which take a very long time to create. Synchronize refs/heads/* only (--mirror=3Dfetch would synchronize all of refs/*); the tags are only used by patchew-cli when a Based-on trailer is found, and can be populated lazily. Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng --- v1->v2: always fetch refs/heads, so that HEAD contains a valid reference patchew-cli | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patchew-cli b/patchew-cli index 5a39f79..388d197 100755 --- a/patchew-cli +++ b/patchew-cli @@ -43,9 +43,18 @@ def git_clone_repo(clone, remote, head, logf, checkout= =3DTrue, recursive=3DFalse): cwd=3Dcache_repo, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE) - subprocess.check_call(["git", "remote", "add", "-f", "--mirror=3Dfetch= ", + subprocess.check_call(["git", "remote", "add", remote_name, remote], cwd=3Dcache_repo, stdout=3Dlogf, stderr=3Dlogf) + subprocess.check_call(["git", "config", + "remote.%s.fetch" % (remote_name,), + "+refs/heads/*:refs/heads/*"], cwd=3Dcache_repo, + stdout=3Dlogf, stderr=3Dlogf) + subprocess.check_call(["git", "fetch", remote_name], cwd=3Dcache_repo, + stdout=3Dlogf, stderr=3Dlogf) + if head.startswith("refs/tags/"): + subprocess.check_call(["git", "fetch", remote_name, "+%s:%s" % (he= ad, head)], + cwd=3Dcache_repo, stdout=3Dlogf, stderr=3Dlo= gf) clone_cmd =3D ["git", "clone", "-q"] if recursive: clone_cmd +=3D ["--recursive"] --=20 2.20.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel