git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 2/3] sha1dc: use sha1collisiondetection as a submodule

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 17, 2017, 11:38 UTC
Message-ID
<20170517113824.31700-3-avarab@gmail.com>
In-Reply-To
<20170517113824.31700-1-avarab@gmail.com>

Now that we don't need local modifications to the code anymore with my avar/sha1collisiondetection:easier-inclusion-in-other-programs branch we can use the upstream code-as is.

If and when this change gets accepted by upstream we should of course point to the https://github.com/cr-marcstevens/sha1collisiondetection master branch instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 .gitmodules            | 4 ++++
 Makefile               | 8 ++++----
 hash.h                 | 2 +-
 sha1collisiondetection | 1 +
 4 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 sha1collisiondetection
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000..b60238a087
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "sha1collisiondetection"]
+	path = sha1collisiondetection
+	url = https://github.com/avar/sha1collisiondetection.git
+	branch = easier-inclusion-in-other-programs
diff --git a/Makefile b/Makefile
index 342466d83a..63223fd02f 100644
--- a/Makefile
+++ b/Makefile
@@ -1412,15 +1412,15 @@ ifdef APPLE_COMMON_CRYPTO
 	BASIC_CFLAGS += -DSHA1_APPLE
 else
 	DC_SHA1 := YesPlease
-	LIB_OBJS += sha1dc/sha1.o
-	LIB_OBJS += sha1dc/ubc_check.o
+	LIB_OBJS += sha1dc/lib/sha1.o
+	LIB_OBJS += sha1dc/lib/ubc_check.o
 	BASIC_CFLAGS += \
 		-DSHA1_DC \
 		-DSHA1DC_NO_STANDARD_INCLUDES \
 		-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
 		-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
-		-DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C="\"../sha1dc_git.c\"" \
-		-DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H="\"../sha1dc_git.h\"" \
+		-DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C="\"../../sha1dc_git.c\"" \
+		-DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H="\"../../sha1dc_git.h\"" \
 		-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
 endif
 endif
diff --git a/hash.h b/hash.h
index a11fc9233f..e585237136 100644
--- a/hash.h
+++ b/hash.h
@@ -8,7 +8,7 @@
 #elif defined(SHA1_OPENSSL)
 #include <openssl/sha.h>
 #elif defined(SHA1_DC)
-#include "sha1dc/sha1.h"
+#include "sha1dc/lib/sha1.h"
 #else /* SHA1_BLK */
 #include "block-sha1/sha1.h"
 #endif
diff --git a/sha1collisiondetection b/sha1collisiondetection
new file mode 160000
index 0000000000..5423dd8bcf
--- /dev/null
+++ b/sha1collisiondetection
@@ -0,0 +1 @@
+Subproject commit 5423dd8bcf3cdbd029dfa08d5d5f6dc044f7ac6d
-- 
2.13.0.303.g4ebf302169
Previous: Ævar Arnfjörð BjarmasonNext: Stefan Beller
Message 12 of 17 in “Git 2.13.0 segfaults on Solaris SPARC due to DC_SHA1=YesPlease being on by default”
  1. Ævar Arnfjörð BjarmasonMay 15, 2017
  2. Marc StevensMay 15, 2017
  3. Ævar Arnfjörð BjarmasonMay 15, 2017
  4. Jeff KingMay 15, 2017
  5. demerphqJun 1, 2017
  6. Michael KebeMay 16, 2017
  7. sha1dc: fix issues with a big endian platformJunio C Hamano, May 17, 2017
  8. Ævar Arnfjörð BjarmasonMay 17, 2017
  9. Junio C HamanoMay 17, 2017
  10. 0/3 Use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, May 17, 2017
  11. 1/3 sha1dc: update from my fork of upstreamÆvar Arnfjörð Bjarmason, May 17, 2017
  12. 2/3 sha1dc: use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, May 17, 2017
  13. Stefan BellerMay 17, 2017
  14. Ævar Arnfjörð BjarmasonMay 17, 2017
  15. Stefan BellerMay 17, 2017
  16. Brandon WilliamsMay 18, 2017
  17. Johannes SchindelinMay 17, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.