@matheusbsbs / matheus-bagliano / commits / 494245d6d1
Fork 0

Revert "Adapt tutorial to cygwin and add test case"

This reverts 2ae6c706749b44f05917fcd04037f545d16fb345 commit.

Junio C Hamano committed Oct 15, 2005 at 17:03 UTC 494245d6d1ad365e9b8d76668ed7ff3f888057b1
2 files changed +19 -212
Documentation/tutorial.txt
+19 -52
@@ -52,9 +52,7 @@ your new project. You will now have a `.git` directory, and you can
52 inspect that with `ls`. For your new empty project, it should show you
53 three entries, among other things:
54
55 - - a symlink called `HEAD`, pointing to `refs/heads/master` (if your
56 - platform does not have native symlinks, it is a file containing the
57 - line "ref: refs/heads/master")
55 + - a symlink called `HEAD`, pointing to `refs/heads/master`
56 +
57 Don't worry about the fact that the file that the `HEAD` link points to
58 doesn't even exist yet -- you haven't created the commit that will
@@ -230,7 +228,6 @@ which will spit out
228
229 ------------
230 diff --git a/hello b/hello
233 -index 557db03..263414f 100644
231 --- a/hello
232 +++ b/hello
233 @@ -1 +1,2 @@
@@ -293,14 +290,13 @@ also wants to get a commit message
290 on its standard input, and it will write out the resulting object name for the
291 commit to its standard output.
292
296 -And this is where we create the `.git/refs/heads/master` file. This file is
293 +And this is where we start using the `.git/HEAD` file. The `HEAD` file is
294 supposed to contain the reference to the top-of-tree, and since that's
295 exactly what `git-commit-tree` spits out, we can do this all with a simple
296 shell pipeline:
297
298 ------------------------------------------------
302 -echo "Initial commit" | \
303 - git-commit-tree $(git-write-tree) > .git/refs/heads/master
299 +echo "Initial commit" | git-commit-tree $(git-write-tree) > .git/HEAD
300 ------------------------------------------------
301
302 which will say:
@@ -696,9 +692,7 @@ other point in the history than the current `HEAD`, you can do so by
692 just telling `git checkout` what the base of the checkout would be.
693 In other words, if you have an earlier tag or branch, you'd just do
694
699 -------------
700 -git checkout -b mybranch earlier-commit
701 -------------
695 + git checkout -b mybranch earlier-commit
696
697 and it would create the new branch `mybranch` at the earlier commit,
698 and check out the state at that time.
@@ -706,29 +700,17 @@ and check out the state at that time.
700
701 You can always just jump back to your original `master` branch by doing
702
709 -------------
710 -git checkout master
711 -------------
703 + git checkout master
704
705 (or any other branch-name, for that matter) and if you forget which
706 branch you happen to be on, a simple
707
716 -------------
717 -ls -l .git/HEAD
718 -------------
708 + ls -l .git/HEAD
709
720 -will tell you where it's pointing (Note that on platforms with bad or no
721 -symlink support, you have to execute
710 +will tell you where it's pointing. To get the list of branches
711 +you have, you can say
712
723 -------------
724 -cat .git/HEAD
725 -------------
726 -
727 -instead). To get the list of branches you have, you can say
728 -
729 -------------
730 -git branch
731 -------------
713 + git branch
714
715 which is nothing more than a simple script around `ls .git/refs/heads`.
716 There will be asterisk in front of the branch you are currently on.
@@ -736,9 +718,7 @@ There will be asterisk in front of the branch you are currently on.
718 Sometimes you may wish to create a new branch _without_ actually
719 checking it out and switching to it. If so, just use the command
720
739 -------------
740 -git branch <branchname> [startingpoint]
741 -------------
721 + git branch <branchname> [startingpoint]
722
723 which will simply _create_ the branch, but will not do anything further.
724 You can then later -- once you decide that you want to actually develop
@@ -864,6 +844,7 @@ $ git show-branch master mybranch
844 ! [mybranch] Some work.
845 --
846 + [master] Merged "mybranch" changes.
847 ++ [master~1] Some fun.
848 ++ [mybranch] Some work.
849 ------------------------------------------------
850
@@ -890,10 +871,8 @@ Now, let's pretend you are the one who did all the work in
871 to the `master` branch. Let's go back to `mybranch`, and run
872 resolve to get the "upstream changes" back to your branch.
873
893 -------------
894 -git checkout mybranch
895 -git resolve HEAD master "Merge upstream changes."
896 -------------
874 + git checkout mybranch
875 + git resolve HEAD master "Merge upstream changes."
876
877 This outputs something like this (the actual commit object names
878 would be different)
@@ -1109,17 +1088,13 @@ i.e. `<project>.git`. Let's create such a public repository for
1088 project `my-git`. After logging into the remote machine, create
1089 an empty directory:
1090
1112 -------------
1113 -mkdir my-git.git
1114 -------------
1091 + mkdir my-git.git
1092
1093 Then, make that directory into a GIT repository by running
1094 `git init-db`, but this time, since its name is not the usual
1095 `.git`, we do things slightly differently:
1096
1120 -------------
1121 -GIT_DIR=my-git.git git-init-db
1122 -------------
1097 + GIT_DIR=my-git.git git-init-db
1098
1099 Make sure this directory is available for others you want your
1100 changes to be pulled by via the transport of your choice. Also
@@ -1143,9 +1118,7 @@ Your "public repository" is now ready to accept your changes.
1118 Come back to the machine you have your private repository. From
1119 there, run this command:
1120
1146 -------------
1147 -git push <public-host>:/path/to/my-git.git master
1148 -------------
1121 + git push <public-host>:/path/to/my-git.git master
1122
1123 This synchronizes your public repository to match the named
1124 branch head (i.e. `master` in this case) and objects reachable
@@ -1155,9 +1128,7 @@ As a real example, this is how I update my public git
1128 repository. Kernel.org mirror network takes care of the
1129 propagation to other publicly visible machines:
1130
1158 -------------
1159 -git push master.kernel.org:/pub/scm/git/git.git/
1160 -------------
1131 + git push master.kernel.org:/pub/scm/git/git.git/
1132
1133
1134 Packing your repository
@@ -1170,9 +1141,7 @@ not so convenient to transport over the network. Since git objects are
1141 immutable once they are created, there is a way to optimize the
1142 storage by "packing them together". The command
1143
1173 -------------
1174 -git repack
1175 -------------
1144 + git repack
1145
1146 will do it for you. If you followed the tutorial examples, you
1147 would have accumulated about 17 objects in `.git/objects/??/`
@@ -1196,9 +1165,7 @@ Our programs are always perfect ;-).
1165 Once you have packed objects, you do not need to leave the
1166 unpacked objects that are contained in the pack file anymore.
1167
1199 -------------
1200 -git prune-packed
1201 -------------
1168 + git prune-packed
1169
1170 would remove them for you.
1171
t/t1200-tutorial.sh deleted
-160
@@ -1,160 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright (c) 2005 Johannes Schindelin
4 -#
5 -
6 -test_description='Test git-rev-parse with different parent options'
7 -
8 -. ./test-lib.sh
9 -
10 -echo "Hello World" > hello
11 -echo "Silly example" > example
12 -
13 -git-update-index --add hello example
14 -
15 -test_expect_success 'blob' "test blob = \"$(git-cat-file -t 557db03)\""
16 -
17 -test_expect_success 'blob 557db03' "test \"Hello World\" = \"$(git-cat-file blob 557db03)\""
18 -
19 -echo "It's a new day for git" >>hello
20 -cat > diff.expect << EOF
21 -diff --git a/hello b/hello
22 -index 557db03..263414f 100644
23 ---- a/hello
24 -+++ b/hello
25 -@@ -1 +1,2 @@
26 - Hello World
27 -+It's a new day for git
28 -EOF
29 -git-diff-files -p > diff.output
30 -test_expect_success 'git-diff-files -p' 'cmp diff.expect diff.output'
31 -git diff > diff.output
32 -test_expect_success 'git diff' 'cmp diff.expect diff.output'
33 -
34 -tree=$(git-write-tree 2>/dev/null)
35 -
36 -test_expect_success 'tree' "test 8988da15d077d4829fc51d8544c097def6644dbb = $tree"
37 -
38 -output="$(echo "Initial commit" | git-commit-tree $(git-write-tree) 2>&1 > .git/refs/heads/master)"
39 -
40 -test_expect_success 'commit' "test 'Committing initial tree 8988da15d077d4829fc51d8544c097def6644dbb' = \"$output\""
41 -
42 -git-diff-index -p HEAD > diff.output
43 -test_expect_success 'git-diff-index -p HEAD' 'cmp diff.expect diff.output'
44 -
45 -git diff HEAD > diff.output
46 -test_expect_success 'git diff HEAD' 'cmp diff.expect diff.output'
47 -
48 -#rm hello
49 -#test_expect_success 'git-read-tree --reset HEAD' "git-read-tree --reset HEAD ; test \"hello: needs update\" = \"$(git-update-index --refresh)\""
50 -
51 -cat > whatchanged.expect << EOF
52 -diff-tree VARIABLE (from root)
53 -Author: VARIABLE
54 -Date: VARIABLE
55 -
56 - Initial commit
57 -
58 -diff --git a/example b/example
59 -new file mode 100644
60 -index 0000000..f24c74a
61 ---- /dev/null
62 -+++ b/example
63 -@@ -0,0 +1 @@
64 -+Silly example
65 -diff --git a/hello b/hello
66 -new file mode 100644
67 -index 0000000..557db03
68 ---- /dev/null
69 -+++ b/hello
70 -@@ -0,0 +1 @@
71 -+Hello World
72 -EOF
73 -
74 -git-whatchanged -p --root | \
75 - sed -e "1s/^\(.\{10\}\).\{40\}/\1VARIABLE/" \
76 - -e "2,3s/^\(.\{8\}\).*$/\1VARIABLE/" \
77 -> whatchanged.output
78 -test_expect_success 'git-whatchanged -p --root' 'cmp whatchanged.expect whatchanged.output'
79 -
80 -git tag my-first-tag
81 -test_expect_success 'git tag my-first-tag' 'cmp .git/refs/heads/master .git/refs/tags/my-first-tag'
82 -
83 -# TODO: test git-clone
84 -
85 -git checkout -b mybranch
86 -test_expect_success 'git checkout -b mybranch' 'cmp .git/refs/heads/master .git/refs/heads/mybranch'
87 -
88 -cat > branch.expect <<EOF
89 - master
90 -* mybranch
91 -EOF
92 -
93 -git branch > branch.output
94 -test_expect_success 'git branch' 'cmp branch.expect branch.output'
95 -
96 -git checkout mybranch
97 -echo "Work, work, work" >>hello
98 -git commit -m 'Some work.' hello
99 -
100 -git checkout master
101 -
102 -echo "Play, play, play" >>hello
103 -echo "Lots of fun" >>example
104 -git commit -m 'Some fun.' hello example
105 -
106 -test_expect_failure 'git resolve now fails' 'git resolve HEAD mybranch "Merge work in mybranch"'
107 -
108 -cat > hello << EOF
109 -Hello World
110 -It's a new day for git
111 -Play, play, play
112 -Work, work, work
113 -EOF
114 -
115 -git commit -m 'Merged "mybranch" changes.' hello
116 -
117 -cat > show-branch.expect << EOF
118 -* [master] Merged "mybranch" changes.
119 - ! [mybranch] Some work.
120 ---
121 -+ [master] Merged "mybranch" changes.
122 -++ [mybranch] Some work.
123 -EOF
124 -
125 -git show-branch master mybranch > show-branch.output
126 -test_expect_success 'git show-branch' 'cmp show-branch.expect show-branch.output'
127 -
128 -git checkout mybranch
129 -
130 -cat > resolve.expect << EOF
131 -Updating from VARIABLE to VARIABLE.
132 - example | 1 +
133 - hello | 1 +
134 - 2 files changed, 2 insertions(+), 0 deletions(-)
135 -EOF
136 -
137 -git resolve HEAD master "Merge upstream changes." | \
138 - sed -e "1s/[0-9a-f]\{40\}/VARIABLE/g" > resolve.output
139 -test_expect_success 'git resolve' 'cmp resolve.expect resolve.output'
140 -
141 -cat > show-branch2.expect << EOF
142 -! [master] Merged "mybranch" changes.
143 - * [mybranch] Merged "mybranch" changes.
144 ---
145 -++ [master] Merged "mybranch" changes.
146 -EOF
147 -
148 -git show-branch master mybranch > show-branch2.output
149 -test_expect_success 'git show-branch' 'cmp show-branch2.expect show-branch2.output'
150 -
151 -# TODO: test git fetch
152 -
153 -# TODO: test git push
154 -
155 -test_expect_success 'git repack' 'git repack'
156 -test_expect_success 'git prune-packed' 'git prune-packed'
157 -test_expect_failure '-> only packed objects' 'find -type f .git/objects/[0-9a-f][0-9a-f]'
158 -
159 -test_done
160 -