git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ben Aurel <ben.aurel@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Error: "You have some suspicious patch lines"
Date: Tue, 22 Jul 2008 03:26:20 -0400	[thread overview]
Message-ID: <20080722072620.GA3796@sigill.intra.peff.net> (raw)
In-Reply-To: <4885895C.5050108@gmail.com>

On Tue, Jul 22, 2008 at 09:16:44AM +0200, Ben Aurel wrote:

> -----------------------------------------
>
> Editing '.git/hooks/pre-commit' and comment out the following lines
> --
> 61             if (/^\s* \t/) {
> 62                 bad_line("indent SP followed by a TAB", $_);
> 63             }
> --
>
> And finally "git commit" works again.
>
> The question now is: Is it really necessary to edit the git script  
> everytime? Is there a urgent reason why git refuses to commit because of  
> "suspicious" lines? Is it really necessary?

The pre-commit hook that ships with git checks whitespace as an example
of what one _could_ do with hooks. It is not meant to be enabled by
default (unless you want that whitespace checking).

So either:

 1. You enabled it by setting the execute bit. If so, then don't do
    that.

 2. Something is broken, and it has caused the hook to be enabled
    accidentally. I recall somebody complaining that hooks were enabled
    by default under cygwin because the filesystem didn't support the
    execute bit. Are you working on an exec-bit challenged filesystem?

In newer versions of git, the hooks actually ship with a .sample
extension so that they will not be used accidentally, regardless of the
executable bit. In the meantime, it is safe to simply delete
.git/hooks/pre-commit if it is bothering you.

-Peff

  reply	other threads:[~2008-07-22  7:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22  7:16 Error: "You have some suspicious patch lines" Ben Aurel
2008-07-22  7:26 ` Jeff King [this message]
2008-07-22  9:13 ` Jakub Narebski

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080722072620.GA3796@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=ben.aurel@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).