From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: john muhl <jm@pub.pink>
Cc: emacs-devel@gnu.org
Subject: Re: master 8d4a8b7dfd0: ; Re-apply accidentally reverted commit
Date: Mon, 18 Mar 2024 20:02:06 +0100 [thread overview]
Message-ID: <87plvrcqj5.fsf@gmail.com> (raw)
In-Reply-To: <87zfuwpapo.fsf@pub.pink> (john muhl's message of "Sun, 17 Mar 2024 19:50:20 -0500")
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
john muhl <jm@pub.pink> writes:
> The test you added here fails when run by a user that doesn’t have
> Git configured. When run by such a user the ‘git commit -mFirst’
> command errors which causes the test to fail:
>
> $ git commit -mFirst
> Author identity unknown
>
> *** Please tell me who you are.
I can reproduce the failure running 'EMAIL= make test' (since EMAIL is
how I let Git know about my email, rather than ~/.gitconfig:user.email).
The attached patch lets the test pass; let me know if it looks sensible?
I'll install it then.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-vc-git-test-when-no-identities-are-configured.patch --]
[-- Type: text/x-patch, Size: 1595 bytes --]
From 5b4456728ef7957d5e858d41834adbb7eeab8b35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@gmail.com>
Date: Mon, 18 Mar 2024 19:47:59 +0100
Subject: [PATCH] Fix vc-git test when no identities are configured
Reported by john muhl <jm@pub.pink>.
* test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo): Set
some environment variables (lifted from vc-tests.el) to let
'git commit' compute dummy author and committer identities.
---
test/lisp/vc/vc-git-tests.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el
index fd3e8ccd602..bbf0c4277dd 100644
--- a/test/lisp/vc/vc-git-tests.el
+++ b/test/lisp/vc/vc-git-tests.el
@@ -88,10 +88,17 @@ vc-git-test--with-repo
The current directory will be set to the top of that repository; NAME
will be bound to that directory's file name. Once BODY exits, the
-directory will be deleted."
+directory will be deleted.
+
+Some dummy environment variables will be set for the duration of BODY to
+allow 'git commit' to determine identities for authors and committers."
(declare (indent 1))
`(ert-with-temp-directory ,name
- (let ((default-directory ,name))
+ (let ((default-directory ,name)
+ (process-environment (append '("EMAIL=john@doe.ee"
+ "GIT_AUTHOR_NAME=A"
+ "GIT_COMMITTER_NAME=C")
+ process-environment)))
(vc-create-repo 'Git)
,@body)))
--
2.44.0
next prev parent reply other threads:[~2024-03-18 19:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <171071192781.29642.16850908468499185478@vcs2.savannah.gnu.org>
[not found] ` <20240317214528.4FA50C1CB35@vcs2.savannah.gnu.org>
2024-03-18 0:50 ` master 8d4a8b7dfd0: ; Re-apply accidentally reverted commit john muhl
2024-03-18 7:31 ` Kévin Le Gouguec
2024-03-18 19:02 ` Kévin Le Gouguec [this message]
2024-03-19 1:46 ` john muhl
2024-03-19 21:27 ` Kévin Le Gouguec
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=87plvrcqj5.fsf@gmail.com \
--to=kevin.legouguec@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jm@pub.pink \
/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/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.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.