Skip to content

Commit

Permalink
[internal] add auto detection of 'git commit --amend'
Browse files Browse the repository at this point in the history
* Finally!
  • Loading branch information
pbatard committed May 14, 2018
1 parent 029b7e5 commit 2b0d7a2
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .amend.cmd

This file was deleted.

19 changes: 19 additions & 0 deletions _detect-amend.sh
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
6 changes: 5 additions & 1 deletion _pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
# .git/hooks/ with the following content:
# #!/bin/sh
# if [ -x ./_pre-commit.sh ]; then
# source ./_pre-commit.sh
# . ./_pre-commit.sh
# fi

type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }

if [ -x ./_detect-amend.sh ]; then
. ./_detect-amend.sh
fi

VER=`git log --oneline | wc -l`
# adjust so that we match the github commit count
TAGVER=`expr $VER + 1`
Expand Down
8 changes: 4 additions & 4 deletions examples/wdi-simple.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,717,0
PRODUCTVERSION 1,3,717,0
FILEVERSION 1,3,718,0
PRODUCTVERSION 1,3,718,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -25,13 +25,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "WDI-Simple"
VALUE "FileVersion", "1.3.717"
VALUE "FileVersion", "1.3.718"
VALUE "InternalName", "WDI-Simple"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "wdi-simple.exe"
VALUE "ProductName", "WDI-Simple"
VALUE "ProductVersion", "1.3.717"
VALUE "ProductVersion", "1.3.718"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
8 changes: 4 additions & 4 deletions examples/zadic.rc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,717,0
PRODUCTVERSION 1,3,717,0
FILEVERSION 1,3,718,0
PRODUCTVERSION 1,3,718,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -74,13 +74,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Zadic"
VALUE "FileVersion", "1.3.717"
VALUE "FileVersion", "1.3.718"
VALUE "InternalName", "Zadic"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "zadic.exe"
VALUE "ProductName", "Zadic"
VALUE "ProductVersion", "1.3.717"
VALUE "ProductVersion", "1.3.718"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
2 changes: 1 addition & 1 deletion examples/zadig.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#define FIELD_ORANGE RGB(255,240,200)
#define ARROW_GREEN RGB(92,228,65)
#define ARROW_ORANGE RGB(253,143,56)
#define APP_VERSION "Zadig 2.3.717"
#define APP_VERSION "Zadig 2.3.718"

// These are used to flag end users about the driver they are going to replace
enum driver_type {
Expand Down
8 changes: 4 additions & 4 deletions examples/zadig.rc
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,3,717,0
PRODUCTVERSION 2,3,717,0
FILEVERSION 2,3,718,0
PRODUCTVERSION 2,3,718,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -264,13 +264,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Zadig"
VALUE "FileVersion", "2.3.717"
VALUE "FileVersion", "2.3.718"
VALUE "InternalName", "Zadig"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "zadig.exe"
VALUE "ProductName", "Zadig"
VALUE "ProductVersion", "2.3.717"
VALUE "ProductVersion", "2.3.718"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
8 changes: 4 additions & 4 deletions libwdi/libwdi.rc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,717,0
PRODUCTVERSION 1,3,717,0
FILEVERSION 1,3,718,0
PRODUCTVERSION 1,3,718,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,13 +68,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "libwdi: Windows Driver Installer Library"
VALUE "FileVersion", "1.3.717"
VALUE "FileVersion", "1.3.718"
VALUE "InternalName", "libwdi"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "libwdi"
VALUE "ProductName", "libwdi"
VALUE "ProductVersion", "1.3.717"
VALUE "ProductVersion", "1.3.718"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down

0 comments on commit 2b0d7a2

Please sign in to comment.