git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/6] user-manual: fix rendering of history diagrams

From
JFJ. Bruce Fields <bfields@citi.umich.edu>
Date
Mar 11, 2007, 04:35 UTC
Message-ID
<1173587735398-git-send-email-bfields@citi.umich.edu>
In-Reply-To
<11735877343565-git-send-email-bfields@citi.umich.edu>
From: J. Bruce Fields <bfields@citi.umich.edu>

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>
---
 Documentation/user-manual.txt |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 1e151b4..0919574 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -437,11 +437,14 @@ We will sometimes represent git history using diagrams like the one
 below.  Commits are shown as "o", and the links between them with
 lines drawn with - / and \.  Time goes left to right:
 
+
+................................................
          o--o--o <-- Branch A
         /
  o--o--o <-- master
         \
          o--o--o <-- Branch B
+................................................
 
 If we need to talk about a particular commit, the character "o" may
 be replaced with another letter or number.
@@ -1928,25 +1931,29 @@ $ git commit
 You have performed no merges into mywork, so it is just a simple linear
 sequence of patches on top of "origin":
 
-
+................................................
  o--o--o <-- origin
         \
          o--o--o <-- mywork
+................................................
 
 Some more interesting work has been done in the upstream project, and
 "origin" has advanced:
 
+................................................
  o--o--O--o--o--o <-- origin
         \
          a--b--c <-- mywork
+................................................
 
 At this point, you could use "pull" to merge your changes back in;
 the result would create a new merge commit, like this:
 
-
+................................................
  o--o--O--o--o--o <-- origin
         \        \
          a--b--c--m <-- mywork
+................................................
  
 However, if you prefer to keep the history in mywork a simple series of
 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
 patches to the new mywork.  The result will look like:
 
 
+................................................
  o--o--O--o--o--o <-- origin
 		 \
 		  a'--b'--c' <-- mywork
+................................................
 
 In the process, it may discover conflicts.  In that case it will stop
 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
 with merging.  Suppose somebody fetches your branch and merges it into
 their branch, with a result something like this:
 
+................................................
  o--o--O--o--o--o <-- origin
         \        \
          t--t--t--m <-- their branch:
+................................................
 
 Then suppose you modify the last three commits:
 
+................................................
 	 o--o--o <-- new head of origin
 	/
  o--o--O--o--o--o <-- old head of origin
+................................................
 
 If we examined all this history together in one repository, it will
 look like:
 
+................................................
 	 o--o--o <-- new head of origin
 	/
  o--o--O--o--o--o <-- old head of origin
         \        \
          t--t--t--m <-- their branch:
+................................................
 
 Git has no way of knowing that the new head is an updated version of
 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".
 
 A fast forward looks something like this:
 
+................................................
  o--o--o--o <-- old head of the branch
            \
             o--o--o <-- new head of the branch
+................................................
 
 
 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
 realized she made a serious mistake, and decided to backtrack,
 resulting in a situation like:
 
+................................................
  o--o--o--o--a--b <-- old head of the branch
            \
             o--o--o <-- new head of the branch
-
-
+................................................
 
 In this case, "git fetch" will fail, and print out a warning.
 
-- 
1.5.0.gb75812-dirty
Previous: J. Bruce FieldsNext: J. Bruce Fields
Message 19 of 27 in “Documentation (mostly user manual) patches”
  1. J. Bruce FieldsMar 4, 2007
  2. Documentation: mention module option to git-cvsimportJ. Bruce Fields, Mar 4, 2007
  3. user-manual: reset to ORIG_HEAD not HEAD to undo mergeJ. Bruce Fields, Mar 4, 2007
  4. user-manual: ensure generated manual references stylesheetJ. Bruce Fields, Mar 4, 2007
  5. user-manual: insert earlier of mention content-addressable architectureJ. Bruce Fields, Mar 4, 2007
  6. user-manual: how to replace commits older than most recentJ. Bruce Fields, Mar 4, 2007
  7. user-manual: more detailed merge discussionJ. Bruce Fields, Mar 4, 2007
  8. glossary: Add definitions for dangling and unreachable objectsJ. Bruce Fields, Mar 4, 2007
  9. Yasushi SHOJIMar 5, 2007
  10. Robert PluimMar 16, 2007
  11. J. Bruce FieldsMar 16, 2007
  12. Junio C HamanoMar 5, 2007
  13. J. Bruce FieldsMar 5, 2007
  14. J. Bruce FieldsMar 11, 2007
  15. 1/6 glossary: fix overoptimistic automatic linking of defined termsJ. Bruce Fields, Mar 11, 2007
  16. 2/6 user-manual: fix inconsistent exampleJ. Bruce Fields, Mar 11, 2007
  17. 3/6 user-manual: fix inconsistent use of pull and mergeJ. Bruce Fields, Mar 11, 2007
  18. 4/6 user-manual: fix missing colon in git-show exampleJ. Bruce Fields, Mar 11, 2007
  19. 5/6 user-manual: fix rendering of history diagramsJ. Bruce Fields, Mar 11, 2007
  20. 6/6 user-manual: install user manual stylesheet with other web documentsJ. Bruce Fields, Mar 11, 2007
  21. J. Bruce FieldsMar 11, 2007
  22. Ramsay JonesMar 13, 2007
  23. J. Bruce FieldsMar 14, 2007
  24. Junio C HamanoMar 11, 2007
  25. Ramsay JonesMar 7, 2007
  26. J. Bruce FieldsMar 16, 2007
  27. J. Bruce FieldsMar 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.