From 0838a316ccc83f80cf59ce9f11a16c20b1b30439 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 27 Sep 2007 22:10:29 -0700 Subject: [PATCH] Port 2.5 (all about command options) from mercurial to git --- tour.mdwn | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tour.mdwn b/tour.mdwn index 56690e1..8c3951c 100644 --- a/tour.mdwn +++ b/tour.mdwn @@ -486,33 +486,34 @@ same output: ### 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. -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. - * 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= option. + * Some options have short, single-character names. Often these are + aliases for long commands, (such as "-n " instead of + --max-count=), 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.43.0