-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LrWm3/main
allow exec 'i.sh' without sourcing, add command help, introduce optional post-commit hook
- Loading branch information
Showing
3 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
## | ||
# post-commit hook | ||
## | ||
|
||
if which i.sh >/dev/null 2>&1; then | ||
commit_message=$(git log -1 --pretty=format:%s) | ||
repo_name=$(basename $(git rev-parse --show-toplevel)) | ||
branch_name=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "$repo_name" = "i" ]; then | ||
exit 0 | ||
fi | ||
|
||
i.sh "[repo:$repo_name] (branch:$branch_name) cmsg: '$commit_message'" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters