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

3 messages from 2006-08-13 to 2006-08-14. Participants: Luben Tuikov, Junio C Hamano.
Thread: https://gitlist.dev/t/5224

## Luben Tuikov, 2006-08-13 08:03

Subject: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines
Message-ID: <20060813080328.14584.qmail@web31805.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060813080328.14584.qmail%40web31805.mail.mud.yahoo.com

```
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(-)

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, 2006-08-13 08:16

Subject: Re: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines
Message-ID: <7vejvlm4op.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vejvlm4op.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060813080328.14584.qmail@web31805.mail.mud.yahoo.com>

```
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.

```

## Luben Tuikov, 2006-08-14 02:41

Subject: Re: [PATCH] git-commit: no silent exit on duplicate Signed-off-by lines
Message-ID: <20060814024146.85979.qmail@web31807.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060814024146.85979.qmail%40web31807.mail.mud.yahoo.com
In-Reply-To: <7vejvlm4op.fsf@assigned-by-dhcp.cox.net>

```
--- Junio C Hamano <junkio@cox.net> wrote:
> 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

```
