git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Design of multiple hash support
@ 2018-11-05  1:00 brian m. carlson
  2018-11-05  2:36 ` Junio C Hamano
  2018-11-05 19:03 ` Duy Nguyen
  0 siblings, 2 replies; 7+ messages in thread
From: brian m. carlson @ 2018-11-05  1:00 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

I'm currently working on getting Git to support multiple hash algorithms
in the same binary (SHA-1 and SHA-256).  In order to have a fully
functional binary, we'll need to have some way of indicating to certain
commands (such as init and show-index) that they should assume a certain
hash algorithm.

There are basically two approaches I can take.  The first is to provide
each command that needs to learn about this with its own --hash
argument.  So we'd have:

  git init --hash=sha256
  git show-index --hash=sha256 <some-file

The other alternative is that we provide a global option to git, which
is parsed by all programs, like so:

  git --hash=sha256 init
  git --hash=sha256 show-index <some-file

There's also the question of what we want to call the option.  The
obvious name is --hash, which is intuitive and straightforward.
However, the transition plan names the config option
extensions.objectFormat, so --object-format is also a possibility.  If
we ever decide to support, say, zstd compression instead of zlib, we
could leverage the same option (say, --object-format=sha256:zstd) and
avoid the need for an additional option.  This might be planning for a
future that never occurs, though.

I'd like to write this code in the way most acceptable to the list, so
I'd appreciate input from others on what they'd like to see in the final
series.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-06  0:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05  1:00 Design of multiple hash support brian m. carlson
2018-11-05  2:36 ` Junio C Hamano
2018-11-05 18:03   ` Stefan Beller
2018-11-05 23:54     ` brian m. carlson
2018-11-05 19:03 ` Duy Nguyen
2018-11-05 22:00   ` Jonathan Nieder
2018-11-06  0:13     ` brian m. carlson

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).