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

[PATCH] doc: mention 'git show' defaults to HEAD

From
Todd Zullinger <tmz@pobox.com>
Date
Jan 28, 2018, 19:16 UTC
Message-ID
<20180128191607.31199-1-tmz@pobox.com>

When 'git show' is called without any object it defaults to HEAD. This has been true since d4ed9793fd ("Simplify common default options setup for built-in log family.", 2006-04-16).

The SYNOPSIS suggests that the object argument is required. Clarify that it is not required and note the default.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
This was mentioned in #git today by qaz.  It seems reasonable to document the
default.
 Documentation/git-show.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 82a4125a2d..e73ef54017 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -9,7 +9,7 @@ git-show - Show various types of objects
 SYNOPSIS
 --------
 [verse]
-'git show' [options] <object>...
+'git show' [options] [<object>...]
 
 DESCRIPTION
 -----------
@@ -35,7 +35,7 @@ This manual page describes only the most frequently used options.
 OPTIONS
 -------
 <object>...::
-	The names of objects to show.
+	The names of objects to show (defaults to 'HEAD').
 	For a more complete list of ways to spell object names, see
 	"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
 
-- 
2.16.1
Next: Junio C Hamano
Message 1 of 2 in “doc: mention 'git show' defaults to HEAD”
  1. doc: mention 'git show' defaults to HEADTodd Zullinger, Jan 28, 2018
  2. Junio C HamanoJan 30, 2018

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.