Sha256: f7e5627b5a26d0026ef50352f7393350ee58cc101f5e8337f944b57a5039968c

Contents?: true

Size: 1.21 KB

Versions: 908

Compression:

Stored size: 1.21 KB

Contents

#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source.  The hook's purpose is to edit the commit
# message file.  If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg".

# This hook includes three examples.  The first comments out the
# "Conflicts:" part of a merge commit.
#
# The second includes the output of "git diff --name-status -r"
# into the message, just before the "git status" output.  It is
# commented because it doesn't cope with --amend or with squashed
# commits.
#
# The third example adds a Signed-off-by line to the message, that can
# still be edited.  This is rarely a good idea.

case "$2,$3" in
  merge,)
    /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;

# ,|template,)
#   /usr/bin/perl -i.bak -pe '
#      print "\n" . `git diff --cached --name-status -r`
#	 if /^#/ && $first++ == 0' "$1" ;;

  *) ;;
esac

# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

Version data entries

908 entries across 484 versions & 70 rubygems

Version Path
mygithug-0.5.1 levels/bisect/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/unstash/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/blame/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/diff/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/stash/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/conflict/.githug/hooks/prepare-commit-msg.sample
mygithug-0.5.1 levels/delete_branch/.githug/hooks/prepare-commit-msg.sample
dandelion-0.5.4 spec/fixtures/repo.git/hooks/prepare-commit-msg.sample
dandelion-0.5.4 spec/fixtures/repo_submodule.git/hooks/prepare-commit-msg.sample
dandelion-0.5.4 spec/fixtures/repo_symlink.git/hooks/prepare-commit-msg.sample
ssstats-0.3.0 ./.git/hooks/prepare-commit-msg.sample
dtk-common-0.12.0 rich_tests/fixtures/rugged_test1/repo1.git/hooks/prepare-commit-msg.sample
dtk-common-0.12.0 rich_tests/fixtures/dsl_test4/sm-dtk-dtk.git/hooks/prepare-commit-msg.sample
image_limit_resize-0.1.0 hooks/prepare-commit-msg.sample
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
dandelion-0.5.3 spec/fixtures/repo_symlink.git/hooks/prepare-commit-msg.sample
dandelion-0.5.3 spec/fixtures/repo.git/hooks/prepare-commit-msg.sample
dandelion-0.5.3 spec/fixtures/repo_submodule.git/hooks/prepare-commit-msg.sample
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
dandelion-0.5.2 spec/fixtures/repo.git/hooks/prepare-commit-msg.sample