Permalink
Browse files

git 1.7.11, fix issue with path

  • Loading branch information...
orefalo committed Aug 7, 2012
1 parent ef0291c commit a4f51aeb043e8ea4ece9b78d7d09e380d5d3c8b2
Showing with 36 additions and 13 deletions.
  1. +3 −1 README.md
  2. +1 −1 cmds/g2-freeze.sh
  3. +1 −1 cmds/g2-ig.sh
  4. +1 −1 cmds/g2-panic.sh
  5. +3 −3 cmds/g2-undo.sh
  6. +17 −0 g2-completion.sh
  7. +5 −1 g2-config.sh
  8. +5 −5 g2.sh
View
@@ -408,7 +408,6 @@ Distributed under the GNU General Public License, version 2.0.
##TODO
-* upgrade g2-msys to 1.7.11
* doc: provide basic guidance on how a commit is performed using g2
* doc: add typical solutions:
* doc: talk about gc
@@ -419,6 +418,9 @@ Distributed under the GNU General Public License, version 2.0.
* enforce completions for undo *, and all the upstream commands
## FIXED
+
+* upgrade g2-msys to 1.7.11
+* fix little issue with undo,freeze,dt,ig
* g rv wasn't working
* g dt upstream
* g rb upstream
View
@@ -4,7 +4,7 @@
[[ $1 = "-m" ]] && {
[[ -n $2 ]] && { msg=$2; shift 2; } || { echo "Usage: freeze -m message"; exit 1; }
}
-( [[ -z "$@" ]] && "$GIT_EXE" add -A || "$GIT_EXE" add -A "$@" ) && {
+( [[ -z "$@" ]] && "$GIT_EXE" add -A || "$GIT_EXE" add -A "$GIT_PREFIX/$@" ) && {
[[ -n $msg ]] && {
[[ $("$GIT_EXE" g2iswip) = "true" ]] && echo "fatal: wip detected, please <unwip> and commit <ci>." && exit 1
"$GIT_EXE" commit -m "$msg" && "$GIT_EXE" status -s
View
@@ -2,4 +2,4 @@
#
# Ignores a file and automatically adds it to gitignore & removes from source control
-[[ -z "$@" ]] && echo "usage: ignore [file]" || { ([ ! -e .gitignore ] && touch .gitignore); echo $1 >> .gitignore && echo "Ignoring file $1" && "$GIT_EXE" rm --cached "$@" > /dev/null 2>&1 && "$GIT_EXE" st; }
+[[ -z "$@" ]] && echo "usage: ignore [file]" || { ([ ! -e .gitignore ] && touch .gitignore); echo "$GIT_PREFIX/$1" >> .gitignore && echo "Ignoring file $1" && "$GIT_EXE" rm --cached "$GIT_PREFIX/$@" > /dev/null 2>&1 && "$GIT_EXE" st; }
View
@@ -1,7 +1,7 @@
#!/bin/bash
#
-read -p "Remove all untracked files and checkout HEAD, are you sure (y/n)? " -n 1 -r
+read -p "Remove all un-tracked files and checkout HEAD, are you sure (y/n)? " -n 1 -r
[[ $REPLY == [yY]* ]] && {
echo
"$GIT_EXE" abort
View
@@ -4,11 +4,11 @@
if [ $# -lt 1 ]
then
- echo "Usage : g undo <file|'commit'|'merge'>"
+ echo "Usage : g undo <file|commit|merge> <?path>"
exit
fi
-read -p "warning: the action will discard your changes, please confirm (y/n)? " -n 1 -r
+read -p "warning: the action may discard your changes, please confirm (y/n)? " -n 1 -r
echo
[[ $REPLY = [nN]* ]] && exit 0
@@ -24,6 +24,6 @@ case "$1" in
echo "Reverting back prior to the last merge."
"$GIT_EXE" reset --hard ORIG_HEAD
;;
- *) "$GIT_EXE" checkout -- "$1"
+ *) "$GIT_EXE" checkout -- "$GIT_PREFIX/$1"
;;
esac
View
@@ -1447,6 +1447,23 @@ _git_track ()
__gitcomp_nl "$(__git_refs)"
}
+_git_undo()
+{
+ case "$cur" in
+ c*)
+ __gitcomp "commit"
+ return
+ ;;
+ m*)
+ __gitcomp "merge"
+ return
+ ;;
+ esac
+ COMPREPLY=()
+
+}
+
+
__git_main ()
{
local i c=1 command __git_dir
View
@@ -73,6 +73,10 @@ $GIT_EXE config --global core.excludesfile ~/.gitignore_global
#"$GIT_EXE" config --global alias.alias "!"$GIT_EXE" config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\: \\2/' | sort"
+
+#TODO
+# inline freeze, undo, co
+
# tells what branch have merged with master
#"$GIT_EXE" config --global alias.ismerged 'branch -a --merged master'
@@ -108,7 +112,7 @@ cd $DIR
# Process all aliases dynamically
for cmd in $cmds
do
- al=$( basename $cmd )
+ al=$(basename $cmd)
al=${al/g2-/}
al=${al/\.sh/}
al=${al/ /}
View
10 g2.sh
@@ -38,7 +38,7 @@ Usage:
cp <commit> - cherry-pick
ci <?params...> - commit
clone <url> - clone a remote repository
- df/dt <?params...> - compares files
+ df/dt <?params...> <file> or <upstream> - compares files
fetch - synchronizes remote branches
freeze/unfreeze <?-m comment> <?file> - freeze/unfreeze files
gc - garbage collects: run fsck & gc
@@ -54,21 +54,21 @@ Usage:
ls <?params...> - list files under source control
panic - gets you back on HEAD, cleans all untracked files
pull/push <?opts> <remote> <branch> - deals with other branches
- rb <?params...> <branch> - rebase
+ rb <?params...> <branch> or <upstream> - rebase
rm <params...> - remove
rs <params...> - reset
- rs 'upstream' - resets branch to upstream state
+ rs upstream - resets branch to upstream state
rt <?params...> - remote
rv <commit> - revert
setup - configures user, key, editor, tools
sh <?-deep> - show commit contents
sm <?params...> - submodule
ss <?params> - stash
st <?params...> - status
- sync - syncs working branch: fetch, rebase & push
+ sync <?upstream> - syncs working branch: fetch, rebase & push
tg - tag
track <?upstream_branch> - shows/set tracking
- undo file|'commit'|'merge'
+ undo <file>|commit <hash>|merge - reverts changes
wip/unwip - save/restore work in progress to branch
EOF
return 0;

0 comments on commit a4f51ae

Please sign in to comment.