threads / patch / 5224

patchgit-commit: no silent exit on duplicate Signed-off-by lines

Subject: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines

## tl;dr

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

replies: 2people: 2as markdown or json

Luben Tuikov· Aug 13, 2006, 08:03 UTC · lore

git-commit would silently exit if duplicate Signed-off-by lines were found. Users of git-commit would not know it, unless they checked '$?'. This patch makes git-commit actually print out a message that nothing was commited since duplicate Signed-off-lines were found.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-commit.sh +1 −1
diff --git a/git-commit.sh b/git-commit.sh
index 4cf3fab..edfd8c0 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -690,7 +690,7 @@ case "$verify" in
 t)
 	if test -x "$GIT_DIR"/hooks/commit-msg
 	then
-		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || exit
+		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || die "Duplicate Signed-off-by lines -- nothing commited"
 	fi
 esac
 
-- 
1.4.2.g73dbd
Junio C Hamano· Aug 13, 2006, 08:16 UTC · re: Luben Tuikov · lore

Re: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines

Luben Tuikov <ltuikov@yahoo.com> writes:
Show 8 quoted lines
> @@ -690,7 +690,7 @@ case "$verify" in
>  t)
>  	if test -x "$GIT_DIR"/hooks/commit-msg
>  	then
> -		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || exit
> +		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || die "Duplicate Signed-off-by lines -- nothing commited"
>  	fi
>  esac

Please emit the complaint from the sample hook/commit-msg script, not from git-commit.

Luben Tuikov· Aug 14, 2006, 02:41 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines

--- Junio C Hamano <junkio@cox.net> wrote:
Show 14 quoted lines
> Luben Tuikov <ltuikov@yahoo.com> writes:
> 
> > @@ -690,7 +690,7 @@ case "$verify" in
> >  t)
> >  	if test -x "$GIT_DIR"/hooks/commit-msg
> >  	then
> > -		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || exit
> > +		"$GIT_DIR"/hooks/commit-msg "$GIT_DIR"/COMMIT_EDITMSG || die "Duplicate Signed-off-by lines
> -- nothing commited"
> >  	fi
> >  esac
> 
> Please emit the complaint from the sample hook/commit-msg
> script, not from git-commit.

Ok, I will. (In which case the aforementioned patch can be dropped in favor of the new one.)

    Luben

← back to recent threads