-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[internal] add auto detection of 'git commit --amend'
* Finally!
- Loading branch information
Showing
8 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
#!/bin/sh | ||
# | ||
# This script detects whether git commit is being executed in amend or regular mode | ||
# | ||
|
||
# Need to figure out if we are running on Windows or *NIX | ||
if [ "$(uname -o)" = "Msys" ]; then | ||
type -P wmic &>/dev/null || { echo "wmic command not found. Aborting." >&2; exit 1; } | ||
type -P grep &>/dev/null || { echo "grep command not found. Aborting." >&2; exit 1; } | ||
if $(wmic path win32_process get CommandLine | grep git.exe | grep -q -- --amend); then | ||
echo AMEND detected | ||
touch ./.amend | ||
fi | ||
else | ||
if $(ps -fp $PPID | grep -q -- --amend); then | ||
echo AMEND detected | ||
touch ./.amend | ||
fi | ||
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
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
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