~intrahealth+informatics/ihris-common/4.3-dev

« back to all changes in this revision

Viewing changes to modules/FHIR/tools/php-fhir/.git/hooks/prepare-commit-msg.sample

  • Committer: Carl Leitner
  • Date: 2016-07-09 16:29:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1454.
  • Revision ID: litlfred@ibiblio.org-20160709162901-bfr3cv3vseb7dfw4
added fhir questionnaire -> form code.   added base fhir helper classes:

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
# An example hook script to prepare the commit log message.
4
 
# Called by "git commit" with the name of the file that has the
5
 
# commit message, followed by the description of the commit
6
 
# message's source.  The hook's purpose is to edit the commit
7
 
# message file.  If the hook fails with a non-zero status,
8
 
# the commit is aborted.
9
 
#
10
 
# To enable this hook, rename this file to "prepare-commit-msg".
11
 
 
12
 
# This hook includes three examples.  The first comments out the
13
 
# "Conflicts:" part of a merge commit.
14
 
#
15
 
# The second includes the output of "git diff --name-status -r"
16
 
# into the message, just before the "git status" output.  It is
17
 
# commented because it doesn't cope with --amend or with squashed
18
 
# commits.
19
 
#
20
 
# The third example adds a Signed-off-by line to the message, that can
21
 
# still be edited.  This is rarely a good idea.
22
 
 
23
 
case "$2,$3" in
24
 
  merge,)
25
 
    /opt/local/bin/perl5.16 -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
26
 
 
27
 
# ,|template,)
28
 
#   /opt/local/bin/perl5.16 -i.bak -pe '
29
 
#      print "\n" . `git diff --cached --name-status -r`
30
 
#        if /^#/ && $first++ == 0' "$1" ;;
31
 
 
32
 
  *) ;;
33
 
esac
34
 
 
35
 
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
36
 
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"