1GIT-SH-SETUP(1) Git Manual GIT-SH-SETUP(1)
2
3
4
6 git-sh-setup - Common git shell script setup code
7
9 git-sh-setup
10
12 This is not a command the end user would want to run. Ever. This
13 documentation is meant for people who are studying the Porcelain-ish
14 scripts and/or are writing new ones.
15
16 The git-sh-setup scriptlet is designed to be sourced (using .) by other
17 shell scripts to set up some variables pointing at the normal git
18 directories and a few helper shell functions.
19
20 Before sourcing it, your script should set up a few variables; USAGE
21 (and LONG_USAGE, if any) is used to define message given by usage()
22 shell function. SUBDIRECTORY_OK can be set if the script can run from a
23 subdirectory of the working tree (some commands do not).
24
25 The scriptlet sets GIT_DIR and GIT_OBJECT_DIRECTORY shell variables,
26 but does not export them to the environment.
27
29 die
30 exit after emitting the supplied error message to the standard
31 error stream.
32
33 usage
34 die with the usage message.
35
36 set_reflog_action
37 set the message that will be recorded to describe the end-user
38 action in the reflog, when the script updates a ref.
39
40 is_bare_repository
41 outputs true or false to the standard output stream to indicate if
42 the repository is a bare repository (i.e. without an associated
43 working tree).
44
45 cd_to_toplevel
46 runs chdir to the toplevel of the working tree.
47
48 require_work_tree
49 checks if the repository is a bare repository, and dies if so. Used
50 by scripts that require working tree (e.g. checkout).
51
53 Written by Linus Torvalds <torvalds@osdl.org>
54
56 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
57
59 Part of the git(7) suite
60
61
62
63
64Git 1.5.3.3 10/09/2007 GIT-SH-SETUP(1)