summaryrefslogtreecommitdiff
path: root/zscripts/nicegit.zsh
blob: 276d98eaa6e85997baa15c3ee95f396c4405147b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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"
}