git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org
Cc: Stefan Beller <sbeller@google.com>
Subject: [RFC PATCH] help: add optional instructions for reporting bugs
Date: Thu,  9 Mar 2017 11:30:50 -0800	[thread overview]
Message-ID: <20170309193050.19988-1-sbeller@google.com> (raw)

Git is distributed in various ways by various organizations. The Git
community prefers to have bugs reported on the mailing list, whereas
other organizations may rather want to have filed a bug in a bug tracker
or such.  The point of contact is different by organization as well.

When reporting bugs, users will usually look at the output of
'git --version' at one point to write a quality bug report.
So that is a good spot to provide additional information to the user
about e.g. additional the organizational quirks how to report a bug.

As the output of 'git --version' is parsed by scripts as well,
we only want to present this information to users, which is why
we only give the output to TTYs.

Signed-off-by: Stefan Beller <sbeller@google.com>
---

Not sure if this is a good idea at all, hence RFC.

Thanks,
Stefan

 help.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/help.c b/help.c
index bc6cd19cf3..d4c1fbe5cb 100644
--- a/help.c
+++ b/help.c
@@ -9,6 +9,12 @@
 #include "version.h"
 #include "refs.h"
 
+#ifdef GIT_BUG_REPORT_HELP
+const char git_bug_reporting_string[] = GIT_BUG_REPORT_HELP;
+#else
+const char git_bug_reporting_string[] = "To report bugs send a plain text email to git@vger.kernel.org";
+#endif
+
 void add_cmdname(struct cmdnames *cmds, const char *name, int len)
 {
 	struct cmdname *ent;
@@ -435,6 +441,8 @@ int cmd_version(int argc, const char **argv, const char *prefix)
 			/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
 		}
 	}
+	if (isatty(1))
+		puts(git_bug_reporting_string);
 	return 0;
 }
 
-- 
2.12.0.190.g6e60aba09d.dirty


             reply	other threads:[~2017-03-09 19:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 19:30 Stefan Beller [this message]
2017-03-10 18:13 ` [RFC PATCH] help: add optional instructions for reporting bugs Jonathan Nieder
2017-03-10 21:50   ` Christian Couder
2017-03-12 12:47     ` Jeff King
2017-03-13 18:00       ` Stefan Beller

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20170309193050.19988-1-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.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://80x24.org/mirrors/git.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).