From 1df6ec267ae38105fb486bbc298504b86cdae5e4 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 16 Sep 2017 21:01:57 +0300
Subject: [PATCH] - Added last-commit Git alias to last "true" commit (ignore
 fixups, squashes and merges). - Modify fixup and add squash Git aliases to be
 fully automated (no need to enter the commit intended).

---
 .gitconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitconfig b/.gitconfig
index e624333..2c4accd 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -8,8 +8,9 @@
     empty-commit = commit --allow-empty
 	exec = "!exec "
     ff = merge --no-edit --ff-only master
-    fixup = commit --fixup
+    fixup = !git commit --fixup $(git last-commit)
     forget = reset HEAD^
+    last-commit = "!git log --no-merges --abbrev-commit --format=\"%h %s\" | awk '{if ($2 != \"fixup!\" && $2 != \"squash!\") {print $1; exit}}'"
     merg = merge --no-edit
     posh = push --set-upstream origin HEAD
     pul = pull --progress
@@ -19,6 +20,7 @@
     root = rev-parse --show-toplevel
     serve-git = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
     serve-http = !git update-server-info && cd .git && python -m SimpleHTTPServer
+    squash = !git commit --squash $(git last-commit)
     staash = stash --all
     stat = status --short --branch
     tag-version = !git tag --annotate --force --message "v$(cat VERSION)" "v$(cat VERSION)"
-- 
GitLab