All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-config: print error message if the config file cannot be read
@ 2007-10-09 12:51 Gerrit Pape
  2007-10-09 13:16 ` Johannes Schindelin
  2007-10-09 13:30 ` Johannes Sixt
  0 siblings, 2 replies; 5+ messages in thread
From: Gerrit Pape @ 2007-10-09 12:51 UTC (permalink / raw)
  To: Junio C Hamano, git

Instead of simply exiting with 255, print an error message including
the reason why the config file cannot be opened or read.

The problem was noticed by Joey Hess, reported through
 http://bugs.debian.org/445208

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 builtin-config.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/builtin-config.c b/builtin-config.c
index 1bb0ebb..750a403 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -235,8 +235,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		argv++;
 	}
 
-	if (show_all)
-		return git_config(show_all_config);
+	if (show_all) {
+		if (git_config(show_all_config) == -1)
+			die("unable to read config file %s: %s",
+			    getenv(CONFIG_ENVIRONMENT), strerror(errno));
+		return 0;
+	}
 	switch (argc) {
 	case 2:
 		return get_value(argv[1], NULL);
-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-12 11:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-09 12:51 [PATCH] git-config: print error message if the config file cannot be read Gerrit Pape
2007-10-09 13:16 ` Johannes Schindelin
2007-10-09 13:30 ` Johannes Sixt
2007-10-12 11:40   ` [PATCH amend] " Gerrit Pape
2007-10-12 11:59     ` Johannes Sixt

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.