From 36f8f2ba1e1c83c833736f234da4db58413645bf Mon Sep 17 00:00:00 2001 From: NANRI Date: Thu, 24 Jan 2013 02:28:45 +0900 Subject: [PATCH 1/4] add install script for PortableGit(msysgit) $(BINS) => /bin $(MAN_HTML) => /doc/git/html --- Makefile.msys | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Makefile.msys 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 From 434b7681ced6d117f05d8383e3724a73fa77f941 Mon Sep 17 00:00:00 2001 From: NANRI Date: Wed, 23 Jan 2013 05:32:58 +0900 Subject: [PATCH 2/4] git-extras: use git-help instead of man PortableGit doesn't have man command. --- bin/git-extras | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5e14c08fc5672220a40674a4411e0b162cd08f24 Mon Sep 17 00:00:00 2001 From: NANRI Date: Wed, 23 Jan 2013 05:42:00 +0900 Subject: [PATCH 3/4] git-changelog: use cp instead of mv mv command cannot overwrite in PortableGit(msysgit). --- bin/git-changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 22406cef6ad80247997b1b3ae62751e75c1df666 Mon Sep 17 00:00:00 2001 From: NANRI Date: Thu, 24 Jan 2013 21:58:23 +0900 Subject: [PATCH 4/4] git-alias: use sed insted of colrm PortableGit doesn't have colrm command. --- bin/git-alias | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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