#!/usr/bin/env zsh

alias \
	ga="git add" \
	gpl="git pull" \
	gph="git push" \
	gl="git log" \
	gldaily='git log --pretty="format:- %s" --after="00:00" --before="24:00"' \


function gc() {
	if ! __is_diff; then
		echo "Nothing to commit, working tree clean"
		return
	fi

	if [[ "$@" != "" ]]; then
		commit="$@"
	else
		echo "Enter commit message:" && read commit
	fi
 	git commit -m "$commit"
}

function __is_diff() {
	! git diff --quiet HEAD $REF -- $DIR
}

function gdf() {
	__is_diff && git diff HEAD $RED -- $DIR || echo "Repo is unchanged"
}