6 # git_add_config "some.var=value"
7 # every ' in value must be replaced with the 4-character sequence '\'' before
8 # calling this function or Git will barf. Will not be effective unless running
9 # Git version 1.7.3 or later.
11 GIT_CONFIG_PARAMETERS
="${GIT_CONFIG_PARAMETERS:+$GIT_CONFIG_PARAMETERS }'$1'"
12 export GIT_CONFIG_PARAMETERS
14 git_add_config
"user.name=Git-Browser Test"
15 git_add_config
"user.email=-"
16 git_add_config
"rerere.enabled=false"
19 export GIT_DIR
=test.git
21 git config core.bare false
22 git config core.logallrefupdates false
24 echo "Hello World" >hello
25 echo "Silly example" >example
27 echo "file in a dir" >dir
/file
29 git add hello example dir
/file
30 echo "It's a new day for git" >>hello
31 git commit
-m "initial commit"
35 git commit
-m "bring hello up to date"
39 git checkout
-b mybranch
40 echo "Work, work, work" >>hello
41 git commit
-m 'Some work.' hello
46 echo "Play, play, play" >>hello
47 echo "Lots of fun" >>example
48 git commit
-m 'Some fun.' hello example
52 git merge
-m "Merge work in mybranch" mybranch ||
:
53 echo "Hello World" >hello
54 echo "It's a new day for git" >>hello
55 echo "Play, play, play" >>hello
56 echo "Work, work, work" >>hello
58 git commit
-m "mybranch merged"
64 git config core.bare true
65 rm -f "$GIT_DIR/index" "$GIT_DIR/ORIG_HEAD" "$GIT_DIR/COMMIT_EDITMSG"
66 git pack-refs
--all --prune
68 git prune
--expire=now
71 cat <<CONF >../git-browser.conf
72 gitbin: $(command -v git)
73 warehouse: $(cd .. && pwd -P)
79 cat <<'CONF' >../lighttpd.conf
81 include_shell "echo \"confdir = \\"`pwd -P`\\"\""
82 server.document-root = confdir
84 server.bind = "127.0.0.1"
85 $SERVER["socket"] == "[::1]:"+port {}
86 server.modules = ( "mod_alias", "mod_cgi", "mod_accesslog" )
87 server.indexfiles = ( "index.html" )
88 cgi.assign = ( ".cgi" => "" )
89 mimetype.assign = ( ".html" => "text/html", ".css" => "text/css", ".js" => "text/javascript" )
90 alias.url = ( "/git-browser/" => confdir + "/" )
91 accesslog.filename = "/dev/stderr"