Merge pull request #406 from nicolaiskogheim/portable-msysgit

Portable msysgit
This commit is contained in:
hemanth.hm 2015-07-29 13:35:09 +05:30
commit f0194060c5
4 changed files with 33 additions and 3 deletions

30
Makefile.msys Normal file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -21,6 +21,6 @@ case "$1" in
update
;;
*)
man git-extras
git extras --help
;;
esac