All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug] .git/hooks/commit-msg.sample test is reversed
@ 2015-09-15  8:43 Federico Fissore
  2015-09-15  9:10 ` Matthieu Moy
  0 siblings, 1 reply; 2+ messages in thread
From: Federico Fissore @ 2015-09-15  8:43 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

Hello everyone

In file commit-msg.sample, grep test is reversed. It greps
'^Signed-off-by: '
while it should grep
'Signed-off-by: '

If you run the sample against attached file, it won't complain. Remove 
the ^ and it will work as expected

Regards

Federico

[-- Attachment #2: test.commit.msg --]
[-- Type: text/plain, Size: 103 bytes --]

    Commit message
    
    Signed-off-by: Me <me@example.com>
    Signed-off-by: Me <me@example.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug] .git/hooks/commit-msg.sample test is reversed
  2015-09-15  8:43 [bug] .git/hooks/commit-msg.sample test is reversed Federico Fissore
@ 2015-09-15  9:10 ` Matthieu Moy
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Moy @ 2015-09-15  9:10 UTC (permalink / raw)
  To: Federico Fissore; +Cc: git

Federico Fissore <federico@fissore.org> writes:

> Hello everyone
>
> In file commit-msg.sample, grep test is reversed. It greps
> '^Signed-off-by: '
> while it should grep
> 'Signed-off-by: '
>
> If you run the sample against attached file, it won't complain. Remove
> the ^ and it will work as expected

I think the test is correct.

In grep, ^ can have two meanings:

'^foo' means "foo at the start of a line"
'[^abc]' means "one character but not a, b or c"

The Signed-off-by: trailer is meant to be at the start of a line, hence
the ^.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-15  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15  8:43 [bug] .git/hooks/commit-msg.sample test is reversed Federico Fissore
2015-09-15  9:10 ` Matthieu Moy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.