From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Yaron Wittenstein <yaron.wittenstein@gmail.com>
Subject: Re: [PATCH v2 1/2] githooks.txt: Replace mentions of SHA-1 specific properties
Date: Mon, 01 Mar 2021 08:48:04 -0800 [thread overview]
Message-ID: <xmqqsg5estvf.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <294fb32de2681dfeac836d2b64c7e0853721d1a3.1614591751.git.ps@pks.im> (Patrick Steinhardt's message of "Mon, 1 Mar 2021 10:43:47 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> Subject: Re: [PATCH v2 1/2] githooks.txt: Replace mentions of SHA-1 specific properties
Looking at "git shortlog --no-merges -200 master" output, I'd
suggest to please downcase "Replace" to match.
> The githooks(5) documentation states in several places that the hook
> will receive a SHA-1 or hashes of 40 characters length. Given that we're
> transitioning to a world where both SHA-1 and SHA-256 are supported,
> this is inaccurate.
>
> Fix the issue by replacing mentions of SHA-1 with "object name" and not
> explicitly mentioning the hash size.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> Documentation/githooks.txt | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
> index 1f3b57d04d..4dad80052e 100644
> --- a/Documentation/githooks.txt
> +++ b/Documentation/githooks.txt
> @@ -138,7 +138,7 @@ given); `template` (if a `-t` option was given or the
> configuration option `commit.template` is set); `merge` (if the
> commit is a merge or a `.git/MERGE_MSG` file exists); `squash`
> (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by
> -a commit SHA-1 (if a `-c`, `-C` or `--amend` option was given).
> +a commit object name (if a `-c`, `-C` or `--amend` option was given).
>
> If the exit status is non-zero, `git commit` will abort.
>
> @@ -231,19 +231,19 @@ named remote is not being used both values will be the same.
> Information about what is to be pushed is provided on the hook's standard
> input with lines of the form:
>
> - <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
> + <local ref> SP <local object name> SP <remote ref> SP <remote object name> LF
>
> For instance, if the command +git push origin master:foreign+ were run the
> hook would receive a line like the following:
>
> refs/heads/master 67890 refs/heads/foreign 12345
>
> -although the full, 40-character SHA-1s would be supplied. If the foreign ref
> -does not yet exist the `<remote SHA-1>` will be 40 `0`. If a ref is to be
> -deleted, the `<local ref>` will be supplied as `(delete)` and the `<local
> -SHA-1>` will be 40 `0`. If the local commit was specified by something other
> -than a name which could be expanded (such as `HEAD~`, or a SHA-1) it will be
> -supplied as it was originally given.
> +although the full object name would be supplied. If the foreign ref does not
> +yet exist the `<remote object name>` will be the all-zeroes object name. If a
> +ref is to be deleted, the `<local ref>` will be supplied as `(delete)` and the
> +`<local object name>` will be the all-zeroes object name. If the local commit
> +was specified by something other than a name which could be expanded (such as
> +`HEAD~`, or an object name) it will be supplied as it was originally given.
>
> If this hook exits with a non-zero status, `git push` will abort without
> pushing anything. Information about why the push is rejected may be sent
> @@ -268,7 +268,7 @@ input a line of the format:
> where `<old-value>` is the old object name stored in the ref,
> `<new-value>` is the new object name to be stored in the ref and
> `<ref-name>` is the full name of the ref.
> -When creating a new ref, `<old-value>` is 40 `0`.
> +When creating a new ref, `<old-value>` is the all-zeroes object name.
>
> If the hook exits with non-zero status, none of the refs will be
> updated. If the hook exits with zero, updating of individual refs can
> @@ -550,7 +550,7 @@ command-dependent arguments may be passed in the future.
> The hook receives a list of the rewritten commits on stdin, in the
> format
>
> - <old-sha1> SP <new-sha1> [ SP <extra-info> ] LF
> + <old-object-name> SP <new-object-name> [ SP <extra-info> ] LF
<???-object-name> is a tad longer than the original as a
placeholder, but this line does not look so bad.
Thanks.
> The 'extra-info' is again command-dependent. If it is empty, the
> preceding SP is also omitted. Currently, no commands pass any
> @@ -566,7 +566,7 @@ rebase::
> For the 'squash' and 'fixup' operation, all commits that were
> squashed are listed as being rewritten to the squashed commit.
> This means that there will be several lines sharing the same
> - 'new-sha1'.
> + 'new-object-name'.
> +
> The commits are guaranteed to be listed in the order that they were
> processed by rebase.
next prev parent reply other threads:[~2021-03-01 16:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 5:50 [PATCH] githooks.txt: Clarify documentation on reference-transaction hook Patrick Steinhardt
2021-02-26 6:03 ` Jeff King
2021-03-01 9:33 ` Patrick Steinhardt
2021-03-01 9:43 ` [PATCH v2 1/2] githooks.txt: Replace mentions of SHA-1 specific properties Patrick Steinhardt
2021-03-01 16:48 ` Junio C Hamano [this message]
2021-03-01 9:43 ` [PATCH v2 2/2] githooks.txt: Clarify documentation on reference-transaction hook Patrick Steinhardt
2021-03-01 16:54 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqsg5estvf.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=yaron.wittenstein@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).