]> git.cworth.org Git - hgbook-git/blobdiff - tour.mdwn
Port 2.5 (all about command options) from mercurial to git
[hgbook-git] / tour.mdwn
index 6a43df9cd847aae7a5b17afbc531b3160089e372..8c3951cb98df3429396f1df00d6f3e1880f2d792 100644 (file)
--- a/tour.mdwn
+++ b/tour.mdwn
@@ -396,8 +396,8 @@ created:
 
        $ git log --since="2 weeks ago" --until="yesterday"
 
 
        $ git log --since="2 weeks ago" --until="yesterday"
 
-Another useful option is --max-count which, unsurprisingly, limits the
-maximum number of commits to be displayed.
+Another useful option is -n or --max-count which, unsurprisingly,
+limits the maximum number of commits to be displayed.
 
 #### 2.4.3  More detailed information
 
 
 #### 2.4.3  More detailed information
 
@@ -439,7 +439,7 @@ looks suspicous, so let's tak a closer look. Remember that we can name
 it as master~3, HEAD~3, or any prefix of its commit identifier, (such
 as 13ed136b):
 
 it as master~3, HEAD~3, or any prefix of its commit identifier, (such
 as 13ed136b):
 
-       $ git log -p --max-count=1 13ed136b
+       $ git log -p -1 13ed136b
        commit 13ed136b983a9c439eddeea8a1c2076cffbb685f
        Author: Bryan O'Sullivan <bos@serpentine.com>
        Date:   Tue Sep 6 13:15:43 2005 -0700
        commit 13ed136b983a9c439eddeea8a1c2076cffbb685f
        Author: Bryan O'Sullivan <bos@serpentine.com>
        Date:   Tue Sep 6 13:15:43 2005 -0700
@@ -486,33 +486,34 @@ same output:
 
 ### 2.5  All about command options
 
 
 ### 2.5  All about command options
 
-Let’s take a brief break from exploring Mercurial commands to discuss
+Let’s take a brief break from exploring git commands to discuss
 a pattern in the way that they work; you may find this useful to keep
 in mind as we continue our tour.
 
 a pattern in the way that they work; you may find this useful to keep
 in mind as we continue our tour.
 
-Mercurial has a consistent and straightforward approach to dealing
+Git has a consistent and straightforward approach to dealing
 with the options that you can pass to commands. It follows the
 conventions for options that are common to modern Linux and Unix
 systems.
 
 with the options that you can pass to commands. It follows the
 conventions for options that are common to modern Linux and Unix
 systems.
 
-  * Every option has a long name. For example, as we’ve already seen,
-    the “hg log” command accepts a --rev option.
-  * Most options have short names, too. Instead of --rev, we can use
-    -r. (The reason that some options don’t have short names is that
-    the options in question are rarely used.)
-  * Long options start with two dashes (e.g. --rev), while short
-    options start with one (e.g. -r).
-  * Option naming and usage is consistent across commands. For
-    example, every command that lets you specify a changeset ID or
-    revision number accepts both -r and --rev arguments.
-
-In the examples throughout this book, I use short options instead of
-long. This just reflects my own preference, so don’t read anything
-significant into it.
+  * Most options have long names. For example, as we’ve already seen,
+    the “git log" command accepts a --max-count=<number> option.
+  * Some options have short, single-character names. Often these are
+    aliases for long commands, (such as "-n <number>" instead of
+    --max-count=<number>), but sometimes the option exists in
+    short-form with no long-form equivalent, (such as -p). [XXX: It
+    wouldn't hurt to fix this by adding --patch, etc. right?]
+  * Long options start with two dashes (e.g. --max-count), while short
+    options start with one (e.g. -n).
 
 
-Most commands that print output of some kind will print more output
-when passed a -v (or --verbose) option, and less when passed -q (or
---quiet).
+  * Option naming and usage is consistent across commands. For
+    example, every command that lets you specify a commit identifier
+    or range will accept the same expressions, (HEAD~3,
+    origin..master, 72d4f10e, etc), while any command that can be
+    limited by paths will accept the same expressions ("-- doc/
+    some-file.c"), etc.
+
+Many commands that print output of some kind can be made more quiet by
+passing the -q or --quiet options.
 
 ### 2.6  Making and reviewing changes
 
 
 ### 2.6  Making and reviewing changes