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

[PATCH] doc: explain default option for rev-parse --short

From
AWAndré Werlang <beppe85@gmail.com>
Date
May 18, 2017, 14:03 UTC
Message-ID
<CAP96LmMtfO5DC6hGeqJdZvcqj+29H_7=8S+uua8YC7YwFRC9Nw@mail.gmail.com>
From 2b1c229153a89c7608e64b87d2f933704c18b7ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Werlang?= <beppe85@gmail.com>
Date: Thu, 18 May 2017 10:50:11 -0300
Subject: [PATCH] doc: explain default option for rev-parse --short
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Git 2.11 introduced a computation to guess the default length for commit short hashes. The documentation isn't updated.

Signed-off-by: André Werlang <beppe85@gmail.com>
---
 Documentation/git-rev-parse.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 7241e96..b49f053 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -139,8 +139,10 @@ can be used.
 --short::
 --short=number::
  Instead of outputting the full SHA-1 values of object names try to
- abbreviate them to a shorter unique name. When no length is specified
- 7 is used. The minimum length is 4.
+ abbreviate them to a shorter unique name. When no length is specified,
+ it is guessed from the number of objects in the repository. In any case,
+ the actual length will be enough to identify the object unambiguously
+ in the current state of the repository. The minimum length is 4.

 --symbolic::
  Usually the object names are output in SHA-1 form (with
Next: Jeff King
Message 1 of 3 in “doc: explain default option for rev-parse --short”
  1. doc: explain default option for rev-parse --shortAndré Werlang, May 18, 2017
  2. Jeff KingMay 18, 2017
  3. André WerlangMay 19, 2017

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.