unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 63261@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>, bjc@spork.org
Subject: bug#63261: [PATCH] Makefile.am: Only auto-configure Git when available.
Date: Thu,  4 May 2023 10:06:14 -0400	[thread overview]
Message-ID: <eddcf3028b5030804f2e76e970e3912073335161.1683209161.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <874jospdr2.fsf@psyduck.jhoto.kublai.com>

* Makefile.am (.git/hooks/pre-push): Only run recipe if the '.git' directory
exists.  Make it silent.
(.git/config): Likewise, and also check if the 'git' command is available.

Reported-by: Brian Cully <bjc@spork.org>
---
 Makefile.am | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4a9124e0c2..8af69f88ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1115,10 +1115,14 @@ cuirass-jobs: $(GOBJECTS)
 
 # Git auto-configuration.
 .git/hooks/pre-push: etc/git/pre-push
-	cp etc/git/pre-push .git/hooks/pre-push
+	$(AM_V_at)if test -d .git; then \
+	cp etc/git/pre-push .git/hooks/pre-push; \
+	fi
 
 .git/config: etc/git/gitconfig
-	git config include.path ../etc/git/gitconfig
+	$(AM_V_at)if command -v git >/dev/null && test -d .git; then \
+	git config include.path ../etc/git/gitconfig; \
+	fi
 
 nodist_noinst_DATA = .git/hooks/pre-push .git/config
 

base-commit: ae6643326a983d141fd8320a755181d21e5a1f2f
-- 
2.39.2





  parent reply	other threads:[~2023-05-04 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 10:47 bug#63261: Recent changes to git config cause errors for non-committers Brian Cully via Bug reports for GNU Guix
2023-05-04 13:38 ` Maxim Cournoyer
2023-05-04 14:06 ` Maxim Cournoyer [this message]
2023-05-07  3:34 ` Maxim Cournoyer
2023-05-13 19:03   ` Leo Famulari
2023-05-15 13:38     ` Maxim Cournoyer

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eddcf3028b5030804f2e76e970e3912073335161.1683209161.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=63261@debbugs.gnu.org \
    --cc=bjc@spork.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).