From: "Ludovic Courtès" <ludo@gnu.org>
To: Xinglu Chen <public@yoctocell.xyz>
Cc: 50359@debbugs.gnu.org, Sarah Morgensen <iskarian@mgsn.dev>
Subject: [bug#50359] [PATCH 3/3] import: Add 'generic-git' updater.
Date: Mon, 13 Sep 2021 10:07:03 +0200 [thread overview]
Message-ID: <875yv4c314.fsf@gnu.org> (raw)
In-Reply-To: <5d10dd1e65b0a65ada4a8102310c10de42f53e8d.1631290349.git.public@yoctocell.xyz> (Xinglu Chen's message of "Fri, 10 Sep 2021 18:21:30 +0200")
Xinglu Chen <public@yoctocell.xyz> 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 <iskarian@mgsn.dev>
Nice, thanks for writing the tests!
> +++ b/tests/git.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -161,4 +162,29 @@
> (commit-relation master1 merge)
> (commit-relation merge master1))))))
>
> +(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 delimiter"
> + "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 ‘git’ command under
the hood, you’ll need something like what ‘tests/git.scm’ does:
(unless (which (git-command)) (test-skip 1))
(test-equal …)
It’d admittedly annoying to have this boilerplate, but I can’t think of
a better solution.
Could you send an updated version? Then we’ll be all set!
Thank you,
Ludo’.
next prev parent reply other threads:[~2021-09-13 8:08 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 15:50 [bug#50359] [PATCH] import: Add 'generic-git' updater Xinglu Chen
2021-09-05 0:19 ` Sarah Morgensen
2021-09-05 1:03 ` Sarah Morgensen
2021-09-05 10:36 ` Xinglu Chen
2021-09-06 5:40 ` Sarah Morgensen
2021-09-06 12:20 ` Xinglu Chen
2021-09-07 1:00 ` Sarah Morgensen
2021-09-07 19:13 ` Xinglu Chen
2021-09-08 18:28 ` Xinglu Chen
2021-09-10 8:36 ` Ludovic Courtès
2021-09-10 13:23 ` Xinglu Chen
2021-09-05 13:11 ` Xinglu Chen
2021-09-06 3:14 ` Sarah Morgensen
2021-09-10 16:20 ` [bug#50359] [PATCH 0/3] " Xinglu Chen
2021-09-10 16:21 ` [bug#50359] [PATCH 1/3] tests: git: Don't read from the users global Git config file Xinglu Chen
2021-09-10 16:21 ` [bug#50359] [PATCH 2/3] tests: git: Make 'tag' directive non-interactive Xinglu Chen
2021-09-13 8:03 ` Ludovic Courtès
2021-09-10 16:21 ` [bug#50359] [PATCH 3/3] import: Add 'generic-git' updater Xinglu Chen
2021-09-13 8:07 ` Ludovic Courtès [this message]
2021-09-16 9:09 ` Sarah Morgensen
2021-09-16 12:48 ` Xinglu Chen
2021-09-16 23:42 ` Sarah Morgensen
2021-09-17 7:48 ` Xinglu Chen
2021-09-17 8:04 ` [bug#50359] [PATCH v3 0/3] " Xinglu Chen
2021-09-17 8:04 ` [bug#50359] [PATCH v3 1/3] tests: git: Don't read from the users global Git config file Xinglu Chen
2021-09-17 8:04 ` [bug#50359] [PATCH v3 2/3] tests: git: Make 'tag' directive non-interactive Xinglu Chen
2021-09-17 8:04 ` [bug#50359] [PATCH v3 3/3] import: Add 'generic-git' updater Xinglu Chen
2021-09-18 17:47 ` bug#50359: [PATCH v3 0/3] " Ludovic Courtès
2021-09-15 8:44 ` [bug#50359] [PATCH 3/3] import: " iskarian
2021-09-15 11:59 ` Xinglu Chen
2021-09-16 9:46 ` Sarah Morgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yv4c314.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=50359@debbugs.gnu.org \
--cc=iskarian@mgsn.dev \
--cc=public@yoctocell.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.