git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Anders Höckersten via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Robert P. J. Day" <rpjday@crashcourse.ca>,
	"Anders Höckersten" <anders@hockersten.se>,
	"Anders Höckersten" <anders@hockersten.se>
Subject: [PATCH v2] describe-doc: clarify default length of abbreviation
Date: Mon, 17 May 2021 05:53:50 +0000	[thread overview]
Message-ID: <pull.1026.v2.git.git.1621230831465.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1026.git.git.1621150366442.gitgitgadget@gmail.com>

From: =?UTF-8?q?Anders=20H=C3=B6ckersten?= <anders@hockersten.se>

Clarify the default length used for the abbreviated form used for
commits in git describe.

The behavior was modified in Git 2.11.0, but the documentation was not
updated to clarify the new behavior.

Signed-off-by: Anders Höckersten <anders@hockersten.se>
---
    describe-doc: clarify default length of abbreviation
    
    Clarify the default length used for the abbreviated form used for
    commits in git describe.
    
    The behavior was modified in Git 2.11.0, but the documentation was not
    updated to clarify the new behavior.
    
    Changes since v1:
    
     * tweaked the wording in --abbrev parameter to better match
       implementation, as suggested by Bagas Sanjaya
     * trailing whitespace removed
    
    Signed-off-by: Anders Höckersten anders@hockersten.se

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1026%2Fahockersten%2Fdescribe-doc-abbreviation-clarification-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1026/ahockersten/describe-doc-abbreviation-clarification-v2
Pull-Request: https://github.com/git/git/pull/1026

Range-diff vs v1:

 1:  a3aa09ab6fca ! 1:  4cf527801901 describe-doc: clarify default length of abbreviation
     @@ Documentation/git-describe.txt: OPTIONS
      -	Instead of using the default 7 hexadecimal digits as the
      -	abbreviated object name, use <n> digits, or as many digits
      -	as needed to form a unique object name.  An <n> of 0
     --	will suppress long format, only showing the closest tag.
      +	Instead of using the default number of hexadecimal digits (which
     -+	will vary according to the size of the repository with a default of 
     -+	7) of the abbreviated object name, use <n> digits, or as many digits
     -+	as needed to form a unique object name.  An <n> of 0 will suppress 
     -+	long format, only showing the closest tag.
     ++	will vary according to the number of objects in the repository with
     ++	a default of 7) of the abbreviated object name, use <n> digits, or
     ++	as many digits as needed to form a unique object name. An <n> of 0
     + 	will suppress long format, only showing the closest tag.
       
       --candidates=<n>::
     - 	Instead of considering only the 10 most recent tags as
      @@ Documentation/git-describe.txt: at the end.
       
       The number of additional commits is the number
     @@ Documentation/git-describe.txt: at the end.
      -The hash suffix is "-g" + unambiguous abbreviation for the tip commit
      -of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
      +The hash suffix is "-g" + an unambigous abbreviation for the tip commit
     -+of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The 
     -+length of the abbreviation scales as the repository grows, using the 
     -+approximate number of objects in the repository and a bit of math 
     ++of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
     ++length of the abbreviation scales as the repository grows, using the
     ++approximate number of objects in the repository and a bit of math
      +around the birthday paradox, and defaults to a minimum of 7.
       The "g" prefix stands for "git" and is used to allow describing the version of
       a software depending on the SCM the software is managed with. This is useful


 Documentation/git-describe.txt | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index a88f6ae2c6e7..c6a79c2a0f29 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -63,9 +63,10 @@ OPTIONS
 	Automatically implies --tags.
 
 --abbrev=<n>::
-	Instead of using the default 7 hexadecimal digits as the
-	abbreviated object name, use <n> digits, or as many digits
-	as needed to form a unique object name.  An <n> of 0
+	Instead of using the default number of hexadecimal digits (which
+	will vary according to the number of objects in the repository with
+	a default of 7) of the abbreviated object name, use <n> digits, or
+	as many digits as needed to form a unique object name. An <n> of 0
 	will suppress long format, only showing the closest tag.
 
 --candidates=<n>::
@@ -139,8 +140,11 @@ at the end.
 
 The number of additional commits is the number
 of commits which would be displayed by "git log v1.0.4..parent".
-The hash suffix is "-g" + unambiguous abbreviation for the tip commit
-of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
+The hash suffix is "-g" + an unambigous abbreviation for the tip commit
+of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
+length of the abbreviation scales as the repository grows, using the
+approximate number of objects in the repository and a bit of math
+around the birthday paradox, and defaults to a minimum of 7.
 The "g" prefix stands for "git" and is used to allow describing the version of
 a software depending on the SCM the software is managed with. This is useful
 in an environment where people may use different SCMs.

base-commit: 48bf2fa8bad054d66bd79c6ba903c89c704201f7
-- 
gitgitgadget

  parent reply	other threads:[~2021-05-17  5:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-16  7:32 [PATCH] " Anders Höckersten via GitGitGadget
2021-05-16 11:34 ` Junio C Hamano
2021-05-16 12:00 ` Bagas Sanjaya
2021-05-16 12:47   ` Anders Höckersten
2021-05-16 12:58     ` Junio C Hamano
2021-05-17  5:51       ` Anders Höckersten
2021-05-16 18:51   ` Felipe Contreras
2021-05-16 19:00     ` Robert P. J. Day
2021-05-16 21:07       ` Felipe Contreras
2021-05-17  5:53 ` Anders Höckersten via GitGitGadget [this message]
2021-05-17 16:44   ` [PATCH v2] " Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1026.v2.git.git.1621230831465.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=anders@hockersten.se \
    --cc=bagasdotme@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    --subject='Re: [PATCH v2] describe-doc: clarify default length of abbreviation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).