updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / gibak / git-1.6_undashed_commands.patch
blob528bc6f61770a903f90597fe8503a1d625ff0ba8
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.
10 ---
12 diff --git a/gibak b/gibak
13 index e987468..a0e17a0 100755
14 --- a/gibak
15 +++ b/gibak
16 @@ -61,7 +61,7 @@ function __abort_on_not_initialized() {
17 exit 1
19 # further tests
20 - source git-sh-setup
21 + source "$(git --exec-path)/git-sh-setup"
22 require_work_tree
25 @@ -87,15 +87,15 @@ function __handle_git_repositories() {
26 "$rep" "$rep" "$base/$rep/.git" >> .gitmodules
27 done
28 touch .gitmodules
29 - git-add -f .gitmodules
30 - git-submodule init
31 + git add -f .gitmodules
32 + git submodule init
35 function init() {
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
46 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
54 echo
55 @@ -216,27 +216,27 @@ function commit() {
56 local modifier=
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
74 - git-add -v . \
75 + git add -v . \
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
90 local time_spec=$@
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
96 exit 1
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
101 local TMOUT=20
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 ' \
112 HEAD
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
126 # special
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
136 - git-gc --prune
137 + git gc --prune
141 @@ -302,7 +302,7 @@ function show() {
142 local time_spec=$@
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() {
151 shift # as
152 shift # of
153 local time_spec="$@"
154 - git-ls-tree -r --name-only "HEAD@{$time_spec}"
155 + git ls-tree -r --name-only "HEAD@{$time_spec}"
156 else
157 - git-ls-tree -r --name-only HEAD
158 + git ls-tree -r --name-only HEAD
162 function eat() {
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"
167 commit $@
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
171 commit $@
173 @@ -434,21 +434,21 @@ case "$1" in
175 ls-changed-files)
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
181 ls-new-files)
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
187 ls-ignored-files)
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