diff --git a/Makefile.msys b/Makefile.msys new file mode 100644 index 000000000..29b8be6d9 --- /dev/null +++ b/Makefile.msys @@ -0,0 +1,30 @@ +MANPREFIX ?= /doc/git/html +BINS = $(wildcard bin/git-*) +MANS = $(wildcard man/git-*.md) +MAN_HTML = $(MANS:.md=.html) + +install: + @mkdir -p $(DESTDIR)$(MANPREFIX) + @mkdir -p $(DESTDIR)/bin + @echo "... installing bins to $(DESTDIR)/bin" + @echo "... installing man pages to $(DESTDIR)$(MANPREFIX)" + @$(foreach BIN, $(BINS), \ + echo "... installing `basename $(BIN)`"; \ + cp -f $(BIN) $(DESTDIR)/$(BIN); \ + ) + cp -f man/git-*.html $(DESTDIR)$(MANPREFIX) + @mkdir -p $(DESTDIR)/etc/bash_completion.d + cp -f etc/bash_completion.sh $(DESTDIR)/etc/bash_completion.d/git-extras + +uninstall: + @$(foreach BIN, $(BINS), \ + echo "... uninstalling $(DESTDIR)/$(BIN)"; \ + rm -f $(DESTDIR)/$(BIN); \ + ) + @$(foreach MAN, $(MAN_HTML), \ + echo "... uninstalling $(DESTDIR)$(MANPREFIX)/`basename $(MAN)`"; \ + rm -f "$(DESTDIR)$(MANPREFIX)/`basename $(MAN)`"; \ + ) + rm -f $(DESTDIR)/etc/bash_completion.d/git-extras + +.PHONY: install uninstall diff --git a/bin/git-alias b/bin/git-alias index 5a93f0d4a..34ad3a9e9 100755 --- a/bin/git-alias +++ b/bin/git-alias @@ -1,7 +1,7 @@ #!/usr/bin/env bash case $# in - 0) git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort ;; + 0) git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort ;; 1) git alias | grep -e -- "$1" ;; *) git config --global "alias.$1" "$2" ;; esac diff --git a/bin/git-changelog b/bin/git-changelog index d2f874972..f6df152d6 100755 --- a/bin/git-changelog +++ b/bin/git-changelog @@ -453,7 +453,7 @@ main() { cat "$tmpfile" rm -f "$tmpfile" else - mv -f "$tmpfile" "$changelog" + cp -f "$tmpfile" "$changelog" [[ -n "$GIT_EDITOR" ]] && $GIT_EDITOR "$changelog" if [[ $? -ne 0 ]]; then _exit diff --git a/bin/git-extras b/bin/git-extras index 720cc755b..804f4c1ac 100755 --- a/bin/git-extras +++ b/bin/git-extras @@ -21,6 +21,6 @@ case "$1" in update ;; *) - man git-extras + git extras --help ;; esac