File: setup.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (52 lines) | stat: -rw-r--r-- 1,102 bytes parent folder | download | duplicates (4)
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
krepo='git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git'

get_linux() {
    rm -rf linux.orig
    git clone "$krepo" linux.orig
}

mod_linux() {
    # Tag the top and base of a very long linear sequence of commits.
    git tag bomb-top 85040bcb4643cba578839e953f25e2d1965d83d0
    git tag bomb-base bomb-top~1470

    # Add a file at the base of the linear sequence.
    git checkout bomb-base
    echo "woo-hoo" > woo-hoo.txt
    git add woo-hoo.txt
    git commit -m "Add a file"
    git tag add-file

    # Clean up and go to start position.
    git gc
    git update-ref refs/heads/master bomb-top
    git checkout master
}

setup_linux () {
    get_linux
    ( cd linux.orig && mod_linux )
}

create_empty () {
    dir="$1"
    rm -rf $dir
    mkdir $dir
    ( cd $dir && git init )
}

fill_synthetic () {
    python ../create_synthetic_repo.py | git fast-import
    git gc --aggressive
    git update-ref refs/heads/master bomb-top
    git checkout master
}

setup_synthetic()
{
    create_empty synt.orig
    ( cd synt.orig && fill_synthetic )
}

setup_linux
setup_synthetic