This is a tidy up before we add additional hash agorithms. This patch does not change code. It only contains renames. After this patch, all hash algorithm implementations are in sha/. --- Makefile | 16 ++++++++-------- hash.h | 6 +++--- {block-sha1 => sha/sha1}/sha1.c | 2 +- {block-sha1 => sha/sha1}/sha1.h | 0 {sha1dc => sha/sha1dc}/.gitattributes | 0 {sha1dc => sha/sha1dc}/LICENSE.txt | 0 {sha1dc => sha/sha1dc}/sha1.c | 0 {sha1dc => sha/sha1dc}/sha1.h | 0 {sha1dc => sha/sha1dc}/ubc_check.c | 0 {sha1dc => sha/sha1dc}/ubc_check.h | 0 sha1dc_git.c => sha/sha1dc_git.c | 0 sha1dc_git.h => sha/sha1dc_git.h | 2 +- {ppc => sha/sha1ppc}/sha1.c | 0 {ppc => sha/sha1ppc}/sha1.h | 0 {ppc => sha/sha1ppc}/sha1ppc.S | 0 {sha256 => sha/sha256}/gcrypt.h | 0 {sha256/block => sha/sha256}/sha256.c | 0 {sha256/block => sha/sha256}/sha256.h | 0 18 files changed, 13 insertions(+), 13 deletions(-) rename {block-sha1 => sha/sha1}/sha1.c (99%) rename {block-sha1 => sha/sha1}/sha1.h (100%) rename {sha1dc => sha/sha1dc}/.gitattributes (100%) rename {sha1dc => sha/sha1dc}/LICENSE.txt (100%) rename {sha1dc => sha/sha1dc}/sha1.c (100%) rename {sha1dc => sha/sha1dc}/sha1.h (100%) rename {sha1dc => sha/sha1dc}/ubc_check.c (100%) rename {sha1dc => sha/sha1dc}/ubc_check.h (100%) rename sha1dc_git.c => sha/sha1dc_git.c (100%) rename sha1dc_git.h => sha/sha1dc_git.h (95%) rename {ppc => sha/sha1ppc}/sha1.c (100%) rename {ppc => sha/sha1ppc}/sha1.h (100%) rename {ppc => sha/sha1ppc}/sha1ppc.S (100%) rename {sha256 => sha/sha256}/gcrypt.h (100%) rename {sha256/block => sha/sha256}/sha256.c (100%) rename {sha256/block => sha/sha256}/sha256.h (100%) diff --git a/Makefile b/Makefile index 42a061d3fb75..bac1b30b2f1f 100644 --- a/Makefile +++ b/Makefile @@ -1158,7 +1158,7 @@ THIRD_PARTY_SOURCES += compat/obstack.% THIRD_PARTY_SOURCES += compat/poll/% THIRD_PARTY_SOURCES += compat/regex/% THIRD_PARTY_SOURCES += sha1collisiondetection/% -THIRD_PARTY_SOURCES += sha1dc/% +THIRD_PARTY_SOURCES += sha/sha1dc/% GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) EXTLIBS = @@ -1657,11 +1657,11 @@ ifdef OPENSSL_SHA1 BASIC_CFLAGS += -DSHA1_OPENSSL else ifdef BLK_SHA1 - LIB_OBJS += block-sha1/sha1.o + LIB_OBJS += sha/sha1/sha1.o BASIC_CFLAGS += -DSHA1_BLK else ifdef PPC_SHA1 - LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o + LIB_OBJS += sha/sha1ppc/sha1.o sha/sha1ppc/sha1ppc.o BASIC_CFLAGS += -DSHA1_PPC else ifdef APPLE_COMMON_CRYPTO @@ -1670,7 +1670,7 @@ ifdef APPLE_COMMON_CRYPTO else DC_SHA1 := YesPlease BASIC_CFLAGS += -DSHA1_DC - LIB_OBJS += sha1dc_git.o + LIB_OBJS += sha/sha1dc_git.o ifdef DC_SHA1_EXTERNAL ifdef DC_SHA1_SUBMODULE ifneq ($(DC_SHA1_SUBMODULE),auto) @@ -1685,8 +1685,8 @@ ifdef DC_SHA1_SUBMODULE LIB_OBJS += sha1collisiondetection/lib/ubc_check.o BASIC_CFLAGS += -DDC_SHA1_SUBMODULE else - LIB_OBJS += sha1dc/sha1.o - LIB_OBJS += sha1dc/ubc_check.o + LIB_OBJS += sha/sha1dc/sha1.o + LIB_OBJS += sha/sha1dc/ubc_check.o endif BASIC_CFLAGS += \ -DSHA1DC_NO_STANDARD_INCLUDES \ @@ -1707,7 +1707,7 @@ ifdef GCRYPT_SHA256 BASIC_CFLAGS += -DSHA256_GCRYPT EXTLIBS += -lgcrypt else - LIB_OBJS += sha256/block/sha256.o + LIB_OBJS += sha/sha256/sha256.o BASIC_CFLAGS += -DSHA256_BLK endif endif @@ -2782,7 +2782,7 @@ sparse: $(SP_OBJ) GEN_HDRS := command-list.h unicode-width.h EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/% ifndef GCRYPT_SHA256 - EXCEPT_HDRS += sha256/gcrypt.h + EXCEPT_HDRS += sha/sha256/gcrypt.h endif CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H)) HCO = $(patsubst %.h,%.hco,$(CHK_HDRS)) diff --git a/hash.h b/hash.h index 52a4f1a3f430..f1b941218dc8 100644 --- a/hash.h +++ b/hash.h @@ -10,9 +10,9 @@ #elif defined(SHA1_OPENSSL) #include <openssl/sha.h> #elif defined(SHA1_DC) -#include "sha1dc_git.h" +#include "sha/sha1dc_git.h" #else /* SHA1_BLK */ -#include "block-sha1/sha1.h" +#include "sha/sha1/sha1.h" #endif #if defined(SHA256_GCRYPT) @@ -20,7 +20,7 @@ #elif defined(SHA256_OPENSSL) #include <openssl/sha.h> #else -#include "sha256/block/sha256.h" +#include "sha/sha256/sha256.h" #endif #ifndef platform_SHA_CTX diff --git a/block-sha1/sha1.c b/sha/sha1/sha1.c similarity index 99% rename from block-sha1/sha1.c rename to sha/sha1/sha1.c index 22b125cf8c12..ad9f7e50a395 100644 --- a/block-sha1/sha1.c +++ b/sha/sha1/sha1.c @@ -7,7 +7,7 @@ */ /* this is only to get definitions for memcpy(), ntohl() and htonl() */ -#include "../git-compat-util.h" +#include "git-compat-util.h" #include "sha1.h" diff --git a/block-sha1/sha1.h b/sha/sha1/sha1.h similarity index 100% rename from block-sha1/sha1.h rename to sha/sha1/sha1.h diff --git a/sha1dc/.gitattributes b/sha/sha1dc/.gitattributes similarity index 100% rename from sha1dc/.gitattributes rename to sha/sha1dc/.gitattributes diff --git a/sha1dc/LICENSE.txt b/sha/sha1dc/LICENSE.txt similarity index 100% rename from sha1dc/LICENSE.txt rename to sha/sha1dc/LICENSE.txt diff --git a/sha1dc/sha1.c b/sha/sha1dc/sha1.c similarity index 100% rename from sha1dc/sha1.c rename to sha/sha1dc/sha1.c diff --git a/sha1dc/sha1.h b/sha/sha1dc/sha1.h similarity index 100% rename from sha1dc/sha1.h rename to sha/sha1dc/sha1.h diff --git a/sha1dc/ubc_check.c b/sha/sha1dc/ubc_check.c similarity index 100% rename from sha1dc/ubc_check.c rename to sha/sha1dc/ubc_check.c diff --git a/sha1dc/ubc_check.h b/sha/sha1dc/ubc_check.h similarity index 100% rename from sha1dc/ubc_check.h rename to sha/sha1dc/ubc_check.h diff --git a/sha1dc_git.c b/sha/sha1dc_git.c similarity index 100% rename from sha1dc_git.c rename to sha/sha1dc_git.c diff --git a/sha1dc_git.h b/sha/sha1dc_git.h similarity index 95% rename from sha1dc_git.h rename to sha/sha1dc_git.h index 41e1c3fd3f78..100a7cc9d641 100644 --- a/sha1dc_git.h +++ b/sha/sha1dc_git.h @@ -5,7 +5,7 @@ #elif defined(DC_SHA1_SUBMODULE) #include "sha1collisiondetection/lib/sha1.h" #else -#include "sha1dc/sha1.h" +#include "sha/sha1dc/sha1.h" #endif #ifdef DC_SHA1_EXTERNAL diff --git a/ppc/sha1.c b/sha/sha1ppc/sha1.c similarity index 100% rename from ppc/sha1.c rename to sha/sha1ppc/sha1.c diff --git a/ppc/sha1.h b/sha/sha1ppc/sha1.h similarity index 100% rename from ppc/sha1.h rename to sha/sha1ppc/sha1.h diff --git a/ppc/sha1ppc.S b/sha/sha1ppc/sha1ppc.S similarity index 100% rename from ppc/sha1ppc.S rename to sha/sha1ppc/sha1ppc.S diff --git a/sha256/gcrypt.h b/sha/sha256/gcrypt.h similarity index 100% rename from sha256/gcrypt.h rename to sha/sha256/gcrypt.h diff --git a/sha256/block/sha256.c b/sha/sha256/sha256.c similarity index 100% rename from sha256/block/sha256.c rename to sha/sha256/sha256.c diff --git a/sha256/block/sha256.h b/sha/sha256/sha256.h similarity index 100% rename from sha256/block/sha256.h rename to sha/sha256/sha256.h -- 2.20.1