@matheusbsbs / matheus-bagliano / commits / 1dc71a9155
Fork 0

user-manual: fix rendering of history diagrams

Asciidoc appears to interpret a backslash at the end of a line as escaping the end-of-line character, which screws up the display of history diagrams like o--o--o \ o--... The obvious fix (replacing "\" by "\\") doesn't work. The only workaround I've found is to include all such diagrams in a LiteralBlock. Asciidoc claims that should be equivalent to a literal paragraph, so I don't understand why the difference--perhaps it's an asciidoc bug. Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>

J. Bruce Fields committed Mar 10, 2007 at 22:38 UTC 1dc71a9155e209ed4da866eeb7c3064e4568532e
1 file changed +21 -4
Documentation/user-manual.txt
+21 -4
@@ -437,11 +437,14 @@ We will sometimes represent git history using diagrams like the one
437 below. Commits are shown as "o", and the links between them with
438 lines drawn with - / and \. Time goes left to right:
439
440 +
441 +................................................
442 o--o--o <-- Branch A
443 /
444 o--o--o <-- master
445 \
446 o--o--o <-- Branch B
447 +................................................
448
449 If we need to talk about a particular commit, the character "o" may
450 be replaced with another letter or number.
@@ -1928,25 +1931,29 @@ $ git commit
1931 You have performed no merges into mywork, so it is just a simple linear
1932 sequence of patches on top of "origin":
1933
1931 -
1934 +................................................
1935 o--o--o <-- origin
1936 \
1937 o--o--o <-- mywork
1938 +................................................
1939
1940 Some more interesting work has been done in the upstream project, and
1941 "origin" has advanced:
1942
1943 +................................................
1944 o--o--O--o--o--o <-- origin
1945 \
1946 a--b--c <-- mywork
1947 +................................................
1948
1949 At this point, you could use "pull" to merge your changes back in;
1950 the result would create a new merge commit, like this:
1951
1946 -
1952 +................................................
1953 o--o--O--o--o--o <-- origin
1954 \ \
1955 a--b--c--m <-- mywork
1956 +................................................
1957
1958 However, if you prefer to keep the history in mywork a simple series of
1959 commits without any merges, you may instead choose to use
@@ -1963,9 +1970,11 @@ point at the latest version of origin, then apply each of the saved
1970 patches to the new mywork. The result will look like:
1971
1972
1973 +................................................
1974 o--o--O--o--o--o <-- origin
1975 \
1976 a'--b'--c' <-- mywork
1977 +................................................
1978
1979 In the process, it may discover conflicts. In that case it will stop
1980 and allow you to fix the conflicts; after fixing conflicts, use "git
@@ -2073,24 +2082,30 @@ The primary problem with rewriting the history of a branch has to do
2082 with merging. Suppose somebody fetches your branch and merges it into
2083 their branch, with a result something like this:
2084
2085 +................................................
2086 o--o--O--o--o--o <-- origin
2087 \ \
2088 t--t--t--m <-- their branch:
2089 +................................................
2090
2091 Then suppose you modify the last three commits:
2092
2093 +................................................
2094 o--o--o <-- new head of origin
2095 /
2096 o--o--O--o--o--o <-- old head of origin
2097 +................................................
2098
2099 If we examined all this history together in one repository, it will
2100 look like:
2101
2102 +................................................
2103 o--o--o <-- new head of origin
2104 /
2105 o--o--O--o--o--o <-- old head of origin
2106 \ \
2107 t--t--t--m <-- their branch:
2108 +................................................
2109
2110 Git has no way of knowing that the new head is an updated version of
2111 the old head; it treats this situation exactly the same as it would if
@@ -2151,9 +2166,11 @@ commit. Git calls this process a "fast forward".
2166
2167 A fast forward looks something like this:
2168
2169 +................................................
2170 o--o--o--o <-- old head of the branch
2171 \
2172 o--o--o <-- new head of the branch
2173 +................................................
2174
2175
2176 In some cases it is possible that the new head will *not* actually be
@@ -2161,11 +2178,11 @@ a descendant of the old head. For example, the developer may have
2178 realized she made a serious mistake, and decided to backtrack,
2179 resulting in a situation like:
2180
2181 +................................................
2182 o--o--o--o--a--b <-- old head of the branch
2183 \
2184 o--o--o <-- new head of the branch
2167 -
2168 -
2185 +................................................
2186
2187 In this case, "git fetch" will fail, and print out a warning.
2188