Subject: bug#69464: Test failures

From: Collin Funk <[email-masked]>
Date: Wed, 28 Feb 2024 15:15:14 -0800

Hello, I discovered an issue in gnulib that also affects vc-dwim. My ~/.gitconfig file changed the output of `git log' which caused some issues. Here is a link to the discussion:

https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00270.html

This patch fixes a test failure that does not take into account my configuration:

Author:     Jim Meyering <[email-masked]>
AuthorDate: Tue Feb 27 19:13:14 2024 -0800
Commit:     Jim Meyering <[email-masked]>
CommitDate: Tue Feb 27 19:13:14 2024 -0800

But the grep call expects one space which is okay if we assume default options:

Author: Jim Meyering <[email-masked]>
Date:   Tue Feb 27 19:13:14 2024 -0800

Adding the --format=medium changes the git log to format like this even if the user has different settings in their ~/.gitconfig.

The ignore-dirty-submodules test fails with ERROR. I'll look into it in a bit but I'm not too familiar with git submodules. I've attached the log for that too.

Collin

From 960bd7717628bad0be9760e1c0b574e8d8ea0e12 Mon Sep 17 00:00:00 2001
From: Collin Funk <[email-masked]>
Date: Wed, 28 Feb 2024 15:00:39 -0800
Subject: [PATCH] tests: Make git log more robust against user configuration.

* tests/author: Set git log format to medium so that user
configuration does not cause test failure.
---
 tests/author | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/author b/tests/author
index b2743ed..ccd5dd2 100755
--- a/tests/author
+++ b/tests/author
@@ -27,7 +27,7 @@ fail=0
 
 name_and_addr='joe blow <[email-masked]>'
 vc-dwim --commit --author="$name_and_addr" > /dev/null
-git log --max-count=1 > out
+git log --format=medium --max-count=1 > out
 grep "^Author: $name_and_addr" out > /dev/null
 
 ##################################################
@@ -45,7 +45,7 @@ mv k ChangeLog
 echo foo >> x
 
 vc-dwim --commit > /dev/null
-git log --max-count=1 > out
+git log --format=medium --max-count=1 > out
 grep '^Author: X Y <z@example\.org>' out > /dev/null
 
 ##################################################
-- 
2.39.2