From: Simon Tournier <zimon.toutoune@gmail.com>
To: bokr@bokr.com
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Stephen Paul Weber" <singpolyma@singpolyma.net>,
guix-devel@gnu.org, 0@psycoti.ca
Subject: Re: git-fetch without a hash
Date: Mon, 06 Feb 2023 18:01:31 +0100 [thread overview]
Message-ID: <87bkm6k9sk.fsf@gmail.com> (raw)
In-Reply-To: <20230205174410.GA2570@LionPure>
Hi,
On dim., 05 févr. 2023 at 18:44, bokr@bokr.com wrote:
>> From my understanding, we could have something like,
>>
>> (sha256 (no-hash))
>>
>> where ’no-hash’ would return a string, say
>> "0000000000000000000000000000000000000000000000000000" or whatever else
>> that would satisfy this hypothetical ’sha256’ sanitizer.
> For portability to any hash algorithm that returns a hex string,
> how about letting them hash a zero-length string (which can never
> represent a package tarball or other archive), and using the
> resulting strings as no-hash flags?
Instead of “0000000000000000000000000000000000000000000000000000”, you
are proposing “0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73”
which is the Guix hash of empty.
> $ sha256sum /dev/null
> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /dev/null
$ touch foo
$ guix hash foo
0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73
$ guix hash foo -f hex -H sha256
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Yeah, probably better. :-)
> These strings must be unique for whatever hash algorithm,
> so a short table could be used to recognize them as
> no-hash indicators.
Well, I do not understand “These strings must be unique for whatever
hash algorithm”. What do you mean?
Cheers,
simon
next prev parent reply other threads:[~2023-02-06 18:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 3:04 git-fetch without a hash Stephen Paul Weber
2022-12-21 22:49 ` Ludovic Courtès
2023-01-03 19:31 ` Stephen Paul Weber
2023-01-03 21:34 ` Ludovic Courtès
2023-01-05 10:06 ` Simon Tournier
2023-01-09 11:16 ` Ludovic Courtès
2023-01-11 15:34 ` Simon Tournier
2023-02-05 17:44 ` bokr
2023-02-06 17:01 ` Simon Tournier [this message]
2023-01-09 17:13 ` Ludovic Courtès
2023-01-09 17:35 ` Stephen Paul Weber
2023-01-17 16:01 ` Ludovic Courtès
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: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkm6k9sk.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=0@psycoti.ca \
--cc=bokr@bokr.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=singpolyma@singpolyma.net \
/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://git.savannah.gnu.org/cgit/guix.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).