All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] hooks/pre-commit: add example to add Signed-off-by line to message
Date: Wed, 20 Dec 2006 15:54:51 +0000	[thread overview]
Message-ID: <200612201554.52553.andyparkins@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0611291219190.30004@wbgn013.biozentrum.uni-wuerzburg.de>

On Wednesday 2006 November 29 11:20, Johannes Schindelin wrote:

> +# . git-sh-setup
> +# git var GIT_AUTHOR_IDENT | \
> +# sed -n "s/^\(.*\) [0-9]\+ [-+][0-9]\+$/Signed-off-by: \1/p" \
> +# > $GIT_DIR/SQUASH_MSG

I've been using this; and very useful it is too.  However, I just noticed that 
I was getting "Not a git repository" errors when I tried to commit in a 
subdirectory.  I traced the problem to my use of this fragment.  It seems 
that calling git-sh-setup inside the pre-commit hook was changing GIT_DIR 
(don't know why).  When I changed this to

git var GIT_AUTHOR_IDENT | \
sed -n "s/^\(.*\) [0-9]\+ [-+][0-9]\+$/Signed-off-by: \1/p" \
 >> $(git-rev-parse --git-dir)/SQUASH_MSG

It worked correctly again.


Andy


-- 
Dr Andy Parkins, M Eng (hons), MIEE

  reply	other threads:[~2006-12-20 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 11:20 [PATCH] hooks/pre-commit: add example to add Signed-off-by line to message Johannes Schindelin
2006-12-20 15:54 ` Andy Parkins [this message]
2006-12-20 16:04 ` Andy Parkins
2006-12-20 16:18   ` Johannes Schindelin
2006-12-20 17:29     ` Junio C Hamano
2006-12-20 17:37       ` Johannes Schindelin
2006-12-20 17:44         ` Junio C Hamano
2006-12-21  8:26           ` Johannes Schindelin
2006-12-21  9:24           ` [PATCH] hooks/commit-msg: " Andy Parkins
2006-12-22  5:45             ` Junio C Hamano
2006-12-22  9:28               ` Andy Parkins

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=200612201554.52553.andyparkins@gmail.com \
    --to=andyparkins@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 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.