git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC PATCH] bugreport: also print value of no_proxy envvar

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Mar 22, 2023, 17:34 UTC
Message-ID
<20230322173421.2243947-1-jonathantanmy@google.com>

At $DAYJOB, there was an issue that could have been diagnosed much more quickly had we known what the $no_proxy environment variable was set to. Print this value when the user runs "git bugreport". This is useful not only when a command that explicitly uses the network (e.g. fetch or clone) is run, but also in a partial clone (in which lazy fetches may occur).

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
Taking off the author's hat and putting on the reviewer's hat, I'm
not so sure if this is the right approach, since $no_proxy might have
information that the user doesn't want to share (especially since it
could be used beyond the current repository, and even beyond Git), the
user being informed that they can delete any lines notwithstanding.
Therefore I'm sending this patch as RFC.
---
 builtin/bugreport.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index 5bc254be80..c9dd817e70 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -12,6 +12,7 @@ static void get_system_info(struct strbuf *sys_info)
 {
 	struct utsname uname_info;
 	char *shell = NULL;
+	char *no_proxy = NULL;
 
 	/* get git version from native cmd */
 	strbuf_addstr(sys_info, _("git version:\n"));
@@ -39,6 +40,9 @@ static void get_system_info(struct strbuf *sys_info)
 	shell = getenv("SHELL");
 	strbuf_addf(sys_info, "$SHELL (typically, interactive shell): %s\n",
 		    shell ? shell : "<unset>");
+
+	no_proxy = getenv("no_proxy");
+	strbuf_addf(sys_info, "$no_proxy: %s\n", no_proxy ? no_proxy : "<unset>");
 }
 
 static void get_populated_hooks(struct strbuf *hook_info, int nongit)
-- 
2.40.0.348.gf938b09366-goog
Next: Junio C Hamano
Message 1 of 3 in “bugreport: also print value of no_proxy envvar”
  1. bugreport: also print value of no_proxy envvarJonathan Tan, Mar 22, 2023
  2. Junio C HamanoMar 22, 2023
  3. Glen ChooMar 27, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.