Skip to contentSkip to conversation

doc: mention 'git show' defaults to HEAD

PATCH In review Todd Zullinger 2 participants 2 messages Jan 28, 2018 – Jan 30, 2018 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: mention 'git show' defaults to HEAD

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.

---
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(-)
Documentation/git-show.txt +2 -2
index 82a4125a2d..e73ef54017 100644
@@ -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].
 
Signature · 1 line
2.16.1
#1 lore raw
Quoted 11 lines · Todd Zullinger

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.

---
This was mentioned in #git today by qaz. It seems reasonable to document the default.

Sounds sensible.

Quoted 25 lines
 Documentation/git-show.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/git-show.txt +2 -2
index 82a4125a2d..e73ef54017 100644
@@ -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].