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
dandelion-0.5.2 spec/fixtures/repo_symlink.git/hooks/prepare-commit-msg.sample
dandelion-0.5.2 spec/fixtures/repo.git/hooks/prepare-commit-msg.sample
dandelion-0.5.1 spec/fixtures/repo.git/hooks/prepare-commit-msg.sample
dandelion-0.5.1 spec/fixtures/repo_submodule.git/hooks/prepare-commit-msg.sample
dandelion-0.5.1 spec/fixtures/repo_symlink.git/hooks/prepare-commit-msg.sample
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
ssstats-0.2.1 ./.git/hooks/prepare-commit-msg.sample
jekyll-git_metadata-0.2.0 test/test_repo/dot_git/hooks/prepare-commit-msg.sample
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/cache/bundler/git/tdiary-io-mongodb-bb656d137ce87a3aab1f6e0d4b23de1368d87710/hooks/prepare-commit-msg.sample
tdiary-5.0.5 vendor/bundle/cache/bundler/git/tdiary-io-mongodb-bb656d137ce87a3aab1f6e0d4b23de1368d87710/hooks/prepare-commit-msg.sample
tdiary-5.0.5 vendor/bundle/cache/bundler/git/tdiary-contrib-9ab75deb2f5c1d4ed03ad541a92a9187d5f2560f/hooks/prepare-commit-msg.sample
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/cache/bundler/git/tdiary-contrib-9ab75deb2f5c1d4ed03ad541a92a9187d5f2560f/hooks/prepare-commit-msg.sample
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/cache/bundler/git/vagrant-spec-7f2ea299b3766e9a077e5bd825aa24cac5a3ef16/hooks/prepare-commit-msg.sample
captain_hoog-2.0.0 spec/fixtures/neverland.git/hooks/prepare-commit-msg.sample
dtk-common-0.11.0 rich_tests/fixtures/dsl_test4/sm-dtk-dtk.git/hooks/prepare-commit-msg.sample
dtk-common-0.11.0 rich_tests/fixtures/rugged_test1/repo1.git/hooks/prepare-commit-msg.sample
danger-linear_history-0.0.2 spec/fixtures/nonlinear/hooks/prepare-commit-msg.sample
danger-linear_history-0.0.2 spec/fixtures/linear/hooks/prepare-commit-msg.sample