From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iN5cLQMHP2GqDwEAgWs5BA (envelope-from ) for ; Mon, 13 Sep 2021 10:08:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uIEaKQMHP2EXRwAA1q6Kng (envelope-from ) for ; Mon, 13 Sep 2021 08:08:35 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C56D118E40 for ; Mon, 13 Sep 2021 10:08:34 +0200 (CEST) Received: from localhost ([::1]:39690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPh0y-0006yd-5o for larch@yhetil.org; Mon, 13 Sep 2021 04:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPh0U-0006sr-TL for guix-patches@gnu.org; Mon, 13 Sep 2021 04:08:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPh0U-0003vZ-M2 for guix-patches@gnu.org; Mon, 13 Sep 2021 04:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPh0U-0003E7-DN for guix-patches@gnu.org; Mon, 13 Sep 2021 04:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50359] [PATCH 3/3] import: Add 'generic-git' updater. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Sep 2021 08:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50359 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen Cc: 50359@debbugs.gnu.org, Sarah Morgensen Received: via spool by 50359-submit@debbugs.gnu.org id=B50359.163152043312338 (code B ref 50359); Mon, 13 Sep 2021 08:08:02 +0000 Received: (at 50359) by debbugs.gnu.org; 13 Sep 2021 08:07:13 +0000 Received: from localhost ([127.0.0.1]:44175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPgzg-0003Cw-MV for submit@debbugs.gnu.org; Mon, 13 Sep 2021 04:07:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPgze-0003Ci-Du for 50359@debbugs.gnu.org; Mon, 13 Sep 2021 04:07:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57238) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPgzY-0003AR-Py; Mon, 13 Sep 2021 04:07:04 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47240 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPgzY-00029Y-Fx; Mon, 13 Sep 2021 04:07:04 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <5d10dd1e65b0a65ada4a8102310c10de42f53e8d.1631290349.git.public@yoctocell.xyz> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 Fructidor an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 13 Sep 2021 10:07:03 +0200 In-Reply-To: <5d10dd1e65b0a65ada4a8102310c10de42f53e8d.1631290349.git.public@yoctocell.xyz> (Xinglu Chen's message of "Fri, 10 Sep 2021 18:21:30 +0200") Message-ID: <875yv4c314.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631520515; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=sjQniy4gLnaDZm5WA19o84cjMpC/jDU+HTAsdeNi4WU=; b=YJ2CpQTilRtDQUtfWLcbbxqYLNrEUAWO1oSiHqsF3uc1TSkg99W7gPYsMV7e4T34FsLOp7 ZeBqQ+UxmNAiNCAzqdJ2Zl5k/dqgdelgpmy//b78M9LpRVQiD5xh0fkS0C0pZW9ZoWm8pj R4/0fDPcCemxxEOP1RlR+byLbOaXI5zApnKMW5F7HUjDkzQ4PO5Dp6TG+7+UegRlVv9fkV Tf8GRwceQER/ekex6DF7nv7siwzdEeS3IEpknQb1vN488SJOIlM1WjBSJ2TOVewhxsHgTN tzBO5zeTk9hCRckw7olUsf8KFcFk2QbluIN88bUqng7HelbI7ZwcKxCpjA9xgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631520515; a=rsa-sha256; cv=none; b=gMFoehuzbjd1W894vJK/GZ3tLHKUBk1Os02X9wSDUGw/Q9JrOkq/5sDe3Yb1qZjLCTzpGR QqygxfWWJuSnxZnSh+j0+vN0t9hujK61MdB0aL3T/pY4LD39fOm6K/Z0kNzUokVfxiGvhN Y4BRDa73SS3ZNs6R46oNauTVXdq9blYs6IaV933EES5FqnJ2glBAhJ8ZqAbe85gT4u1FfJ z7/KTWHupVNArBNt4gEzgnmaHjGVzuVLfd4zwUnfYHdwcRFMpuxz4eE53naJwLuDDqFAw1 K4Yp8bSBWkL13aqssYOPH+jG/lvUN79d1rXaBxOzEsFflozqfRLFtaZTzJ/hgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C56D118E40 X-Spam-Score: -1.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: J0/uk7nBx6OV Xinglu Chen skribis: > * guix/git.scm (ls-remote-refs): New procedure. > * tests/git.scm ("remote-refs" "remote-refs: only tags"): New tests. > * guix/import/git.scm: New file. > * doc/guix.texi (Invoking guix refresh): Document it. > * tests/import-git.scm: New test file. > * Makefile.am (MODULES, SCM_TESTS): Register the new files. > > Co-authored-by: Sarah Morgensen Nice, thanks for writing the tests! > +++ b/tests/git.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2019, 2020 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2021 Xinglu Chen ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -161,4 +162,29 @@ > (commit-relation master1 merge) > (commit-relation merge master1)))))) >=20=20 > +(test-equal "remote-refs" > + '("refs/heads/develop" "refs/heads/master" > + "refs/tags/v1.0" "refs/tags/v1.1") > + (with-temporary-git-repository directory > + '((add "a.txt" "A") > + (commit "First commit") > + (tag "v1.0" "release-1.0") > + (branch "develop") > + (checkout "develop") > + (add "b.txt" "B") > + (commit "Second commit") > + (tag "v1.1" "release-1.1")) > + (remote-refs directory))) [...] > +(test-equal "latest-git-tag-version: no custom prefix, suffix, and delim= iter" > + "1.0.1" > + (with-temporary-git-repository directory > + '((add "a.txt" "A") > + (commit "First commit") > + (tag "1.0.1" "Release 1.0.1")) > + (let ((package (make-package directory "1.0.0"))) > + (latest-git-tag-version package)))) I think that for each of these tests that uses the =E2=80=98git=E2=80=99 co= mmand under the hood, you=E2=80=99ll need something like what =E2=80=98tests/git.scm=E2= =80=99 does: (unless (which (git-command)) (test-skip 1)) (test-equal =E2=80=A6) It=E2=80=99d admittedly annoying to have this boilerplate, but I can=E2=80= =99t think of a better solution. Could you send an updated version? Then we=E2=80=99ll be all set! Thank you, Ludo=E2=80=99.