Commit Graph

7 Commits

Author SHA1 Message Date
Ludovic Courtès e782756080
git-authenticate: Prevent removal of '.guix-authorizations'.
* guix/git-authenticate.scm (commit-authorized-keys)
[parents-have-authorizations-file?, assert-parents-lack-authorizations]:
New procedures.
Use the latter before returning DEFAULT-AUTHORIZATIONS.
* guix/git.scm (false-if-git-not-found): Export.
* guix/tests/git.scm (populate-git-repository): Add 'remove' clause.
* tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"):
New test.
2020-06-07 23:10:46 +02:00
Ludovic Courtès d67a881966
utils: Add 'with-environment-variables'.
* guix/tests/gnupg.scm (call-with-environment-variables)
(with-environment-variables): Move to...
* guix/utils.scm: ... here.
* guix/tests/git.scm: Adjust accordingly.
2020-06-06 23:28:49 +02:00
Ludovic Courtès c83eedba23
git-authenticate: Add tests.
* guix/tests/git.scm (call-with-environment-variables)
(with-environment-variables): Remove.
* guix/tests/git.scm (populate-git-repository): Add clauses for signed
commits and signed merges.
* guix/tests/gnupg.scm: New file.
* tests/git-authenticate.scm: New file.
* tests/ed25519bis.key, tests/ed25519bis.sec: New files.
* Makefile.am (dist_noinst_DATA): Add 'guix/tests/gnupg.scm'.
(SCM_TESTS): Add 'tests/git-authenticate.scm'.
(EXTRA_DIST): Add tests/ed25519bis.{key,sec}.
2020-06-05 22:54:06 +02:00
Ludovic Courtès 3c91f00341
tests: Invoke 'git' with a custom '.gitconfig' and ignore the system config.
Fixes <https://bugs.gnu.org/37679>.
Reported by Gábor Boskovits <boskovits@gmail.com>.

* guix/tests/git.scm (call-with-environment-variables): New procedure.
(with-environment-variables): New macro.
(populate-git-repository)[git]: Wrap (git-command) invocation in
'call-with-temporary-directory' and 'with-environment-variables'.
2020-04-19 13:27:06 +02:00
Ludovic Courtès 9719e8d37a
channels: Allow news entries to refer to a tag.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/channels.scm (<channel-news-entry>)[tag]: New field.
(sexp->channel-news-entry): Accept either 'commit' or 'tag' in 'entry'
forms.
(resolve-channel-news-entry-tag): New procedure.
(channel-news-for-commit): Move 'with-repository' form one level
higher.  Call 'resolve-channel-news-entry-tag' on all the news entries.
* guix/tests/git.scm (populate-git-repository): Add clause for 'tag'.
* tests/channels.scm ("channel-news, one entry"): Create a tag and add
an entry with a tag.  Check that the tag is resolved and also visible in
the <channel-news-entry> record.
* doc/guix.texi (Channels): Mention tags in news entries.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 8ba7fd3cd6
channels: Add support for a news file.
* guix/channels.scm (<channel-metadata>)[news-file]: New field.
(read-channel-metadata): Set the 'news-file' field.
(read-channel-metadata-from-source): Likewise.
(<channel-news>, <channel-news-entry>): New record types.
(sexp->channel-news-entry, read-channel-news)
(channel-news-for-commit): New procedures.
* guix/tests/git.scm (populate-git-repository): For 'add', allow
CONTENTS to be a procedure.
* tests/channels.scm ("channel-news, no news")
("channel-news, one entry"): New tests.
* doc/guix.texi (Channels): Document it.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 873f6f1334
git: Add 'commit-difference'.
* guix/git.scm (commit-closure, commit-difference): New procedures.
* guix/tests/git.scm, tests/git.scm: New files.
* Makefile.am (dist_noinst_DATA): Add guix/tests/git.scm.
(SCM_TESTS): Add tests/git.scm.
2019-09-23 10:38:43 +02:00