Skip to content

Instantly share code, notes, and snippets.

@alper
Last active June 19, 2019 08:41
Show Gist options
  • Save alper/22aadce3015cb15c3eafc667cdf4ae79 to your computer and use it in GitHub Desktop.
Save alper/22aadce3015cb15c3eafc667cdf4ae79 to your computer and use it in GitHub Desktop.

Revisions

  1. alper revised this gist Jun 19, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion prepare-commit-msg
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    #!/usr/bin/env python3

    import sys
    import re

    commit_msg_filepath = sys.argv[1]

  2. alper created this gist Jun 19, 2019.
    13 changes: 13 additions & 0 deletions prepare-commit-msg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/usr/bin/env python3

    import sys
    import re

    commit_msg_filepath = sys.argv[1]

    with open(commit_msg_filepath, 'r+') as fh:
    lines = fh.readlines()

    if '#' not in lines[0]:
    print("No issue number in first line of commit message. Stopping.")
    sys.exit(1)