1 From: Lee Marlow <lee.marlow@gmail.com>
2 Date: Fri, 25 Jul 2008 16:40:28 +0000 (-0600)
3 Subject: Stop using deprecated git dashed commands (e.g. git-add)
4 X-Git-Url: http://eigenclass.org/repos/gitweb?p=gibak.git;a=commitdiff_plain;h=0081e234c152eea665b0dd9cbfc0f2f77f7d04a3;hp=820ef0549a72ad8f1a30a50ac4e66f8b4d0f9f6c
6 Stop using deprecated git dashed commands (e.g. git-add)
8 The dashed commands will be removed from PATH in git 1.6
9 Use 'git add' instead of 'git-add', etc.
12 diff --git a/gibak b/gibak
13 index e987468..a0e17a0 100755
16 @@ -61,7 +61,7 @@ function __abort_on_not_initialized() {
21 + source "$(git --exec-path)/git-sh-setup"
25 @@ -87,15 +87,15 @@ function __handle_git_repositories() {
26 "$rep" "$rep" "$base/$rep/.git" >> .gitmodules
29 - git-add -f .gitmodules
31 + git add -f .gitmodules
36 __abort_on_initialized
38 # I know it's the default... but let's be explicit!
39 - git-init --shared=umask
40 + git init --shared=umask
41 chmod -R u+rwX,go-rwx .git
43 # Add a gitweb description
44 @@ -185,8 +185,8 @@ EOF
48 - git-add -f .gitignore
49 - git-commit -q -a -m"Initialized by $SCRIPT_NAME"
50 + git add -f .gitignore
51 + git commit -q -a -m"Initialized by $SCRIPT_NAME"
52 chmod u+x .git/hooks/pre-commit
53 chmod u+x .git/hooks/post-checkout
55 @@ -216,27 +216,27 @@ function commit() {
58 echo "Committing to repository, this may take a long time" >&2
59 - if git-ls-files --modified --others --exclude-standard | egrep -q '(^|/).gitignore$'; then
60 + if git ls-files --modified --others --exclude-standard | egrep -q '(^|/).gitignore$'; then
61 echo "Some .gitignore added or modified, determining newly ignored files." >&2
62 # I don't like myself for using such a sloppy way of
63 # removing previously-tracked newly-ignored files...
64 # :( help me! ahhhhrrrggg
65 # seems like the only way to stop tracking newly-ignored files
66 - #git-rm --cached -r -f . >/dev/null
67 + #git rm --cached -r -f . >/dev/null
69 # better way, using ometastore
70 ometastore -d -i -z | \
71 xargs -0 git rm --cached -r -f --ignore-unmatch -- 2>/dev/null
73 echo "Adding new and modified files." >&2
76 || die "Could not complete addition of files to history store!"
77 __handle_git_repositories
78 test -n "$what" || modifier="-a"
79 echo "Committing." >&2
80 - git-commit $modifier -m"Committed on $( date +"%a, %d %b %Y %H:%M:%S %z" )" -- $@
81 + git commit $modifier -m"Committed on $( date +"%a, %d %b %Y %H:%M:%S %z" )" -- $@
82 echo "Optimizing and compacting repository (might take a while)." >&2
83 - git-gc --auto || git-gc # the --auto is on newer versions
84 + git gc --auto || git gc # the --auto is on newer versions
88 @@ -244,13 +244,13 @@ function rm_older_than() {
89 __abort_on_not_initialized
92 - if ! which git-filter-branch &>/dev/null; then
93 + if ! which git filter-branch &>/dev/null; then
94 echo "Please install a recent version of Git" >&2
95 echo "See http://git.or.cz for more information about Git" >&2
99 - if test $(git-rev-parse "HEAD@{$time_spec}") = "$(git-rev-parse HEAD)"; then
100 + if test $(git rev-parse "HEAD@{$time_spec}") = "$(git rev-parse HEAD)"; then
102 echo "You are about to remove *all* commits made before the very last one you made"
103 echo "Press enter or wait 20 seconds to confirm. Abort with CRTL-C."
104 @@ -258,15 +258,15 @@ function rm_older_than() {
107 # Something like that
108 - git-filter-branch --parent-filter \
109 - 'test $(git-rev-parse "HEAD@{$time_spec}") = "$GIT_COMMIT" || cat ' \
110 + git filter-branch --parent-filter \
111 + 'test $(git rev-parse "HEAD@{$time_spec}") = "$GIT_COMMIT" || cat ' \
113 if test "$?" != "0"; then
114 die "Please make sure you did '$SCRIPT_NAME commit' before removing old files."
117 # See git mailing list
118 - # "Trying to use git-filter-branch to compress history by removing
119 + # "Trying to use git filter-branch to compress history by removing
120 # large, obsolete binary files"
122 git reset --soft # was '--hard' on the post...
123 @@ -274,7 +274,7 @@ function rm_older_than() {
124 #vi .git/packed-refs # Use vi to remove the line referring to
125 # refs/original... No need since we have linear, no tags, nothing
127 - git-reflog expire --all --expire-unreachable=0
128 + git reflog expire --all --expire-unreachable=0
130 echo "Committing the removal action"
132 @@ -288,7 +288,7 @@ function rm_older_than() {
133 git commit -m"$msg" $witness_file
135 # Finally make sure everything is ok, and remove old stuff
141 @@ -302,7 +302,7 @@ function show() {
144 echo "Showing: $HOME/$file_to_restore" >&2
145 - GIT_PAGER=cat git-show "HEAD@{'$time_spec'}:$file_to_restore"
146 + GIT_PAGER=cat git show "HEAD@{'$time_spec'}:$file_to_restore"
149 function archive_to() {
150 @@ -353,18 +353,18 @@ function ls_stored_files() {
154 - git-ls-tree -r --name-only "HEAD@{$time_spec}"
155 + git ls-tree -r --name-only "HEAD@{$time_spec}"
157 - git-ls-tree -r --name-only HEAD
158 + git ls-tree -r --name-only HEAD
163 __abort_on_not_initialized
165 - git-add -v -- $@ || die "Could not add '$@' to the history store"
166 + git add -v -- $@ || die "Could not add '$@' to the history store"
168 - git-rm -r -f -- $@ || die "Problem removing '$@'"
169 + git rm -r -f -- $@ || die "Problem removing '$@'"
170 rm -rf -- $@ # some empty dirs may remain. clean'em up
173 @@ -434,21 +434,21 @@ case "$1" in
176 echo "These files have been modified:" >&2
177 - git-ls-files --exclude-standard --modified
178 + git ls-files --exclude-standard --modified
179 echo "Use '$SCRIPT_NAME commit' to store them" >&2
182 echo "These files are not yet stored:" >&2
183 - git-ls-files --exclude-standard --others
184 + git ls-files --exclude-standard --others
185 echo "Use '$SCRIPT_NAME commit' to store them" >&2
188 echo "These files are ignored:" >&2
189 - git-ls-files --exclude-standard --ignored --others --directory
190 + git ls-files --exclude-standard --ignored --others --directory
192 ls-newly-ignored-files)
193 echo "These files have been ignored since the last commit:" >&2
194 - if git-ls-files --modified --others --exclude-standard | egrep -q '(^|/).gitignore$'; then
195 + if git ls-files --modified --others --exclude-standard | egrep -q '(^|/).gitignore$'; then
196 ometastore -d -i | sort