Skip to content

Commit ed605fa

Browse files
avarttaylorr
authored andcommitted
Makefile: document SHA-1 and SHA-256 default and selection order
For the *_SHA1 and *_SHA256 flags we've discussed the various flags, but not the fact that when you define multiple flags we'll pick one. Which one we pick depends on the order they're listed in the Makefile, which differed from the order we discussed them in this documentation. Let's be explicit about how we select these, and re-arrange the listings so that they're listed in the priority order we've picked. I'd personally prefer that the selection was more explicit, and that we'd error out if conflicting flags were provided, but per the discussion downhtread of[1] the consensus was to keep theses semantics. This behavior makes it easier to e.g. integrate with autoconf-like systems, where the configuration can provide everything it can support, and Git is tasked with picking the first one it prefers. 1. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 84d71c2 commit ed605fa

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Makefile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,11 @@ include shared.mak
481481
#
482482
# === SHA-1 backend ===
483483
#
484+
# ==== Default SHA-1 backend ====
485+
#
486+
# If no *_SHA1 backend is picked, the first supported one listed in
487+
# "SHA-1 implementations" will be picked.
488+
#
484489
# ==== Options common to all SHA-1 implementations ====
485490
#
486491
# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
@@ -489,14 +494,14 @@ include shared.mak
489494
#
490495
# ==== SHA-1 implementations ====
491496
#
492-
# Define DC_SHA1 to enable the collision-detecting sha1
493-
# algorithm. This is slower, but may detect attempted collision attacks.
497+
# Define OPENSSL_SHA1 to link to the SHA-1 routines from the OpenSSL
498+
# library.
494499
#
495500
# Define BLK_SHA1 to make use of optimized C SHA-1 routines bundled
496501
# with git (in the block-sha1/ directory).
497502
#
498-
# Define OPENSSL_SHA1 to link to the SHA-1 routines from the OpenSSL
499-
# library.
503+
# Define DC_SHA1 to enable the collision-detecting sha1
504+
# algorithm. This is slower, but may detect attempted collision attacks.
500505
#
501506
# ==== Options for the sha1collisiondetection library ====
502507
#
@@ -515,12 +520,12 @@ include shared.mak
515520
#
516521
# ==== SHA-256 implementations ====
517522
#
523+
# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
524+
#
518525
# Define NETTLE_SHA256 to use the SHA-256 routines in libnettle.
519526
#
520527
# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
521528
#
522-
# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
523-
#
524529
# If don't enable any of the *_SHA256 settings in this section, Git
525530
# will default to its built-in sha256 implementation.
526531
#

0 commit comments

Comments
 (0)