threads / patch / 4130

patchEnsure author information is set before asking for commit message.

Subject: [PATCH] Ensure author information is set before asking for commit message.

## tl;dr

3 messages between May 14, 2006 and May 14, 2006. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Sean· May 14, 2006, 01:51 UTC · lore

It's better to find out you need to set your author information properly before you enter a long commit message.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---
 git-commit.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
ae880db6fc12a0774c25925abbcc353fe6c9e46f
Show changes to git-commit.sh +1 −0
diff --git a/git-commit.sh b/git-commit.sh
index 26cd7ca..866ed6c 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -640,6 +640,7 @@ case "$no_edit" in
 		exit 1
 		;;
 	esac
+	git-var GIT_AUTHOR_IDENT > /dev/null  || die
 	${VISUAL:-${EDITOR:-vi}} "$GIT_DIR/COMMIT_EDITMSG"
 	;;
 esac
-- 
1.3.2.g260bd
Junio C Hamano· May 14, 2006, 02:41 UTC · re: Sean · lore

Re: [PATCH] Ensure author information is set before asking for commit message.

Sean <seanlkml@sympatico.ca> writes:
> It's better to find out you need to set your author information
> properly before you enter a long commit message.
>
> Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>

Makes sense but I suspect you would want COMMITTER not AUTHOR. Imagine you pulled from somewhere else and it conflicted, requiring you to hand resolve and then run git-commit.

Sean· May 14, 2006, 03:09 UTC · re: Junio C Hamano · lore

[PATCH] Ensure author & committer before asking for commit message.

It's better to find out you need to fix your author and committer information before you enter a long commit message.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---

On Sat, 13 May 2006 19:41:27 -0700 Junio C Hamano <junkio@cox.net> wrote:

> Makes sense but I suspect you would want COMMITTER not AUTHOR.
> Imagine you pulled from somewhere else and it conflicted,
> requiring you to hand resolve and then run git-commit.

Hmm.. It seems that both sets of environment variables must be properly set before commit will succeed? For some reason I thought that if AUTHOR was properly set it would be used as the committer too when the GIT_COMMITTER_* environment variables weren't set. All I ever use are the config user.email/name variables which do work for both author and committer.

But it looks like we have to test both variables before proceeding.
 git-commit.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
801ac3c2e4ec7fd0dd91975800897f30938b4e68
Show changes to git-commit.sh +2 −0
diff --git a/git-commit.sh b/git-commit.sh
index 26cd7ca..6ef1a9d 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -640,6 +640,8 @@ case "$no_edit" in
 		exit 1
 		;;
 	esac
+	git-var GIT_AUTHOR_IDENT > /dev/null  || die
+	git-var GIT_COMMITTER_IDENT > /dev/null  || die
 	${VISUAL:-${EDITOR:-vi}} "$GIT_DIR/COMMIT_EDITMSG"
 	;;
 esac
-- 
1.3.2.gd9a4

← back to recent threads