-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit
executable file
·69 lines (56 loc) · 1.34 KB
/
git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
#
# The GIT scripted toolkit.
# Copyright (c) Petr Baudis, 2005
#
# This is the central command for the GIT toolkit, providing a humanly
# usable SCM-like interface to GIT.
#
# This command mostly only multiplexes to the individual script based
# on the first argument.
PATH=.:$PATH
error () {
echo git: $@ >&2
}
die () {
error $@
exit 1
}
help () {
cat <<__END__
The GIT scripted toolkit $(gitversion.sh)
Usage: git COMMAND [ARG]...
Available commands:
add, addremote, apply, commit, ci, diff, export, help, log, ls, lsobj,
merge, pull, rm, tag, track
__END__
}
cmd=$1;
if [ ! "$cmd" ]; then
error "missing command"
help
exit 1
fi
shift
### XXX: Compatibility hack.
# Introduced at 2005-04-12, to be removed few days later.
[ -d .dircache ] && [ ! -e .git ] && mv .dircache .git
case "$cmd" in
"add") gitadd.sh "$@";;
"addremote") gitaddremote.sh "$@";;
"apply") gitapply.sh "$@";;
"commit" | "ci")
gitcommit.sh "$@";;
"diff") gitdiff.sh "$@";;
"export") gitexport.sh "$@";;
"help") help "$@";;
"log") gitlog.sh "$@";;
"ls") gitls.sh "$@";;
"lsobj") gitlsobj.sh "$@";;
"merge") gitmerge.sh "$@";;
"pull") gitpull.sh "$@";;
"rm") gitrm.sh "$@";;
"tag") gittag.sh "$@";;
"track") gittrack.sh "$@";;
*) error "unknown command"; help;;
esac