git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Nice error message for empty idents
Date: Sat, 18 Feb 2006 18:27:31 +0100	[thread overview]
Message-ID: <20060218172731.GV31278@pasky.or.cz> (raw)
In-Reply-To: <7vzmkpqco1.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Sat, Feb 18, 2006 at 09:44:14AM CET, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> It appears that some people who did not care about having bogus
> names in their own commit messages are bitten by the recent
> change to require a sane environment [*1*].
> 
> While it was a good idea to prevent people from using bogus
> names to create commits and doing sign-offs, the error message
> is not very informative.  This patch attempts to warn things
> upfront and hint people how to fix their environments.
> 
> Likes, dislikes, don't cares?

One dislike from me - you shouldn't care if you ain't gonna do it - it
makes no sense to require valid gecos if you are never committing
anything. Note that this "premature requirement" plague has already hit
GIT - come on:

	$ git-rev-list --help
	fatal: Not a git repository

That's worse than CVS (which allows cvs --help cmd but not cvs cmd
--help outside of a repository).

I agree that the error message itself is bad.

---

[PATCH] Nice error message for empty idents

Signed-off-by: Petr Baudis <pasky@suse.cz>

---
commit 19b5bda8f0301ed4b856c5cd9137637b89d95d30
tree 8f91bfd101c32f258c3d8cca467eb7be26d62b91
parent 8dcc626cd144b2c6eae2a299242bbbe905cb0059
author Petr Baudis <pasky@suse.cz> Sat, 18 Feb 2006 18:26:32 +0100
committer Petr Baudis <xpasky@machine.or.cz> Sat, 18 Feb 2006 18:26:32 +0100

 ident.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ident.c b/ident.c
index 23b8cfc..c57ba5c 100644
--- a/ident.c
+++ b/ident.c
@@ -168,9 +168,10 @@ static const char *get_ident(const char 
 	if (!email)
 		email = git_default_email;
 
-	if (!*name || !*email)
-		die("empty ident %s <%s> not allowed",
-		    name, email);
+	if (!*name)
+		die("empty realname not allowed - please set a realname for your login or use GIT_AUTHOR_NAME");
+	if (!*email)
+		die("empty email not allowed - please set your GIT_AUTHOR_EMAIL to a non-empty value");
 
 	strcpy(date, git_default_date);
 	if (date_str)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams

  parent reply	other threads:[~2006-02-18 17:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-18  8:44 [RFC] empty ident? Junio C Hamano
2006-02-18 10:00 ` Nicolas Vilz 'niv'
2006-02-18 17:27 ` Petr Baudis [this message]
2006-02-18 18:55   ` [PATCH] Nice error message for empty idents Junio C Hamano
2006-02-19  4:56   ` [PATCH] Delay "empty ident" errors until they really matter Junio C Hamano

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=20060218172731.GV31278@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).