{"thread":{"id":"45996","subject":"[PATCH] doc: explain default option for rev-parse --short","startedAt":"2017-05-18T14:03:07Z","lastAt":"2017-05-19T15:22:05Z","messageCount":3,"participants":["André Werlang","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"320160","messageId":"CAP96LmMtfO5DC6hGeqJdZvcqj+29H_7=8S+uua8YC7YwFRC9Nw@mail.gmail.com","threadId":"45996","inReplyTo":null,"subject":"[PATCH] doc: explain default option for rev-parse --short","fromName":"André Werlang","fromEmail":"beppe85@gmail.com","sentAt":"2017-05-18T14:03:00Z","receivedAt":"2017-05-18T14:03:07Z","isPatch":true,"sender":{"key":"beppe85@gmail.com","avatar":null},"body":"From 2b1c229153a89c7608e64b87d2f933704c18b7ae Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Andr=C3=A9=20Werlang?= <beppe85@gmail.com>\nDate: Thu, 18 May 2017 10:50:11 -0300\nSubject: [PATCH] doc: explain default option for rev-parse --short\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nGit 2.11 introduced a computation to guess the default length\nfor commit short hashes. The documentation isn't updated.\n\nSigned-off-by: André Werlang <beppe85@gmail.com>\n---\n Documentation/git-rev-parse.txt | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\nindex 7241e96..b49f053 100644\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -139,8 +139,10 @@ can be used.\n --short::\n --short=number::\n  Instead of outputting the full SHA-1 values of object names try to\n- abbreviate them to a shorter unique name. When no length is specified\n- 7 is used. The minimum length is 4.\n+ abbreviate them to a shorter unique name. When no length is specified,\n+ it is guessed from the number of objects in the repository. In any case,\n+ the actual length will be enough to identify the object unambiguously\n+ in the current state of the repository. The minimum length is 4.\n\n --symbolic::\n  Usually the object names are output in SHA-1 form (with\n"},{"id":"320167","messageId":"20170518155956.ecti4audvrqlj3pt@sigill.intra.peff.net","threadId":"45996","inReplyTo":"CAP96LmMtfO5DC6hGeqJdZvcqj+29H_7=8S+uua8YC7YwFRC9Nw@mail.gmail.com","subject":"Re: [PATCH] doc: explain default option for rev-parse --short","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-05-18T15:59:56Z","receivedAt":"2017-05-18T16:00:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 18, 2017 at 11:03:00AM -0300, André Werlang wrote:\n\n> Git 2.11 introduced a computation to guess the default length\n> for commit short hashes. The documentation isn't updated.\n\nThanks for the patch. I think this is going in the right direction, but\nI have a few minor comments.\n\n> From 2b1c229153a89c7608e64b87d2f933704c18b7ae Mon Sep 17 00:00:00 2001\n> From: =?UTF-8?q?Andr=C3=A9=20Werlang?= <beppe85@gmail.com>\n> Date: Thu, 18 May 2017 10:50:11 -0300\n> Subject: [PATCH] doc: explain default option for rev-parse --short\n> MIME-Version: 1.0\n> Content-Type: text/plain; charset=UTF-8\n> Content-Transfer-Encoding: 8bit\n\nThese headers are redundant with what's in your email headers and can be\ndropped.\n\n> diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\n> index 7241e96..b49f053 100644\n> --- a/Documentation/git-rev-parse.txt\n> +++ b/Documentation/git-rev-parse.txt\n> @@ -139,8 +139,10 @@ can be used.\n>  --short::\n>  --short=number::\n>   Instead of outputting the full SHA-1 values of object names try to\n> - abbreviate them to a shorter unique name. When no length is specified\n> - 7 is used. The minimum length is 4.\n> + abbreviate them to a shorter unique name. When no length is specified,\n> + it is guessed from the number of objects in the repository. In any case,\n> + the actual length will be enough to identify the object unambiguously\n> + in the current state of the repository. The minimum length is 4.\n\nThis is definitely an improvement, though I wonder if we should mention\nthat we default to core.abbrev (which in turn defaults to the \"auto\"\nbehavior).\n\nIt looks like there are a few other mentions of \"7\" with respect to\n\"--abbrev\": git-branch.txt, git-describe.txt, git-blame.txt. Those\nshould probably get the same treatment.\n\nThere are a few other \"--abbrev\" options (e.g., ls-files and ls-tree)\nthat don't mention \"7\". But while we're fixing the others, it may be\nworth giving them all consistent text.\n\n-Peff\n"},{"id":"320275","messageId":"CAP96LmN6zXEiRA+gMJoM4MhFDWhfMpUGszvthaRTuAT_RhXpTw@mail.gmail.com","threadId":"45996","inReplyTo":"20170518155956.ecti4audvrqlj3pt@sigill.intra.peff.net","subject":"Re: [PATCH] doc: explain default option for rev-parse --short","fromName":"André Werlang","fromEmail":"beppe85@gmail.com","sentAt":"2017-05-19T15:21:58Z","receivedAt":"2017-05-19T15:22:05Z","isPatch":true,"sender":{"key":"beppe85@gmail.com","avatar":null},"body":"Hey Jeff, I'll take a look at improving the text and the other commands.\n\nThanks for the response. I'll get back to you soonish.\n\nAndré\n\n2017-05-18 12:59 GMT-03:00 Jeff King <peff@peff.net>:\n> On Thu, May 18, 2017 at 11:03:00AM -0300, André Werlang wrote:\n>\n>> Git 2.11 introduced a computation to guess the default length\n>> for commit short hashes. The documentation isn't updated.\n>\n> Thanks for the patch. I think this is going in the right direction, but\n> I have a few minor comments.\n>\n>> From 2b1c229153a89c7608e64b87d2f933704c18b7ae Mon Sep 17 00:00:00 2001\n>> From: =?UTF-8?q?Andr=C3=A9=20Werlang?= <beppe85@gmail.com>\n>> Date: Thu, 18 May 2017 10:50:11 -0300\n>> Subject: [PATCH] doc: explain default option for rev-parse --short\n>> MIME-Version: 1.0\n>> Content-Type: text/plain; charset=UTF-8\n>> Content-Transfer-Encoding: 8bit\n>\n> These headers are redundant with what's in your email headers and can be\n> dropped.\n>\n>> diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\n>> index 7241e96..b49f053 100644\n>> --- a/Documentation/git-rev-parse.txt\n>> +++ b/Documentation/git-rev-parse.txt\n>> @@ -139,8 +139,10 @@ can be used.\n>>  --short::\n>>  --short=number::\n>>   Instead of outputting the full SHA-1 values of object names try to\n>> - abbreviate them to a shorter unique name. When no length is specified\n>> - 7 is used. The minimum length is 4.\n>> + abbreviate them to a shorter unique name. When no length is specified,\n>> + it is guessed from the number of objects in the repository. In any case,\n>> + the actual length will be enough to identify the object unambiguously\n>> + in the current state of the repository. The minimum length is 4.\n>\n> This is definitely an improvement, though I wonder if we should mention\n> that we default to core.abbrev (which in turn defaults to the \"auto\"\n> behavior).\n>\n> It looks like there are a few other mentions of \"7\" with respect to\n> \"--abbrev\": git-branch.txt, git-describe.txt, git-blame.txt. Those\n> should probably get the same treatment.\n>\n> There are a few other \"--abbrev\" options (e.g., ls-files and ls-tree)\n> that don't mention \"7\". But while we're fixing the others, it may be\n> worth giving them all consistent text.\n>\n> -Peff\n\n\n\n-- \nAndré Werlang\n"}]}