* [PATCH 1/3] sha1dc: update from upstream
2017-06-06 15:12 ` [PATCH 0/3] update sha1dc Ævar Arnfjörð Bjarmason
@ 2017-06-06 15:12 ` Ævar Arnfjörð Bjarmason
2017-06-06 15:12 ` [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule Ævar Arnfjörð Bjarmason
` (3 subsequent siblings)
4 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 15:12 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Adam Dinwoodie, Ramsay Jones, Liam R . Howlett,
Michael Kebe, Ævar Arnfjörð Bjarmason
Update sha1dc from the latest version by the upstream
maintainer[1].
See commit a0103914c2 ("sha1dc: update from upstream", 2017-05-20) for
the latest update. That update was done sans some whitespace changes
by upstream, which is why the diff here isn't the same as the upstream
cc46554..e139984.
It also brings in a change[2] upstream made which should hopefully
address the breakage in 2.13.1 on Cygwin, see [3]. Cygwin defines both
_BIG_ENDIAN and _LITTLE_ENDIAN.
Adam Dinwoodie reports on the mailing list that that upstream commit
fixes the issue on Cygwin[4].
1. https://github.com/cr-marcstevens/sha1collisiondetection/commit/e1399840b501a68ac6c8d7ed9a5cb1455480200e
2. https://github.com/cr-marcstevens/sha1collisiondetection/commit/a24eef58c0684078405f8c7a89f9b78271432005
3. <20170606100355.GC25777@dinwoodie.org> (https://public-inbox.org/git/20170606100355.GC25777@dinwoodie.org/)
4. <20170606124323.GD25777@dinwoodie.org> (https://public-inbox.org/git/20170606124323.GD25777@dinwoodie.org/)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
sha1dc/sha1.c | 30 ++++++++++++++++++++++++------
sha1dc/sha1.h | 6 +++---
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
index 3dff80ac72..facea1bb56 100644
--- a/sha1dc/sha1.c
+++ b/sha1dc/sha1.c
@@ -35,15 +35,33 @@
#ifdef SHA1DC_BIGENDIAN
#undef SHA1DC_BIGENDIAN
#endif
-#if (!defined SHA1DC_FORCE_LITTLEENDIAN) && \
- ((defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
- (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) || \
- defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
- defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) || defined(SHA1DC_FORCE_BIGENDIAN))
+#if (defined(_BYTE_ORDER) || defined(__BYTE_ORDER) || defined(__BYTE_ORDER__))
+
+#if ((defined(_BYTE_ORDER) && (_BYTE_ORDER == _BIG_ENDIAN)) || \
+ (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
+ (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) )
#define SHA1DC_BIGENDIAN
+#endif
+
+#else
+
+#if (defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN) || defined(__BIG_ENDIAN__) || \
+ defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
+ defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \
+ defined(__sparc))
+#define SHA1DC_BIGENDIAN
+#endif
-#endif /*ENDIANNESS SELECTION*/
+#endif
+
+#if (defined(SHA1DC_FORCE_LITTLEENDIAN) && defined(SHA1DC_BIGENDIAN))
+#undef SHA1DC_BIGENDIAN
+#endif
+#if (defined(SHA1DC_FORCE_BIGENDIAN) && !defined(SHA1DC_BIGENDIAN))
+#define SHA1DC_BIGENDIAN
+#endif
+/*ENDIANNESS SELECTION*/
#if (defined SHA1DC_FORCE_UNALIGNED_ACCESS || \
defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \
diff --git a/sha1dc/sha1.h b/sha1dc/sha1.h
index a0ff5d1305..1e4e94be54 100644
--- a/sha1dc/sha1.h
+++ b/sha1dc/sha1.h
@@ -61,9 +61,9 @@ void SHA1DCInit(SHA1_CTX*);
Function to enable safe SHA-1 hashing:
Collision attacks are thwarted by hashing a detected near-collision block 3 times.
Think of it as extending SHA-1 from 80-steps to 240-steps for such blocks:
- The best collision attacks against SHA-1 have complexity about 2^60,
- thus for 240-steps an immediate lower-bound for the best cryptanalytic attacks would be 2^180.
- An attacker would be better off using a generic birthday search of complexity 2^80.
+ The best collision attacks against SHA-1 have complexity about 2^60,
+ thus for 240-steps an immediate lower-bound for the best cryptanalytic attacks would be 2^180.
+ An attacker would be better off using a generic birthday search of complexity 2^80.
Enabling safe SHA-1 hashing will result in the correct SHA-1 hash for messages where no collision attack was detected,
but it will result in a different SHA-1 hash for messages where a collision attack was detected.
--
2.13.0.506.g27d5fe0cd
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule
2017-06-06 15:12 ` [PATCH 0/3] update sha1dc Ævar Arnfjörð Bjarmason
2017-06-06 15:12 ` [PATCH 1/3] sha1dc: update from upstream Ævar Arnfjörð Bjarmason
@ 2017-06-06 15:12 ` Ævar Arnfjörð Bjarmason
2017-06-06 18:48 ` Stefan Beller
2017-06-06 15:12 ` [PATCH 3/3] sha1collisiondetection: automatically enable when submodule is populated Ævar Arnfjörð Bjarmason
` (2 subsequent siblings)
4 siblings, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 15:12 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Adam Dinwoodie, Ramsay Jones, Liam R . Howlett,
Michael Kebe, Ævar Arnfjörð Bjarmason
Add an option to use the sha1collisiondetection library from the
submodule in sha1collisiondetection/ instead of in the copy in the
sha1dc/ directory.
This allows us to try out the submodule in sha1collisiondetection
without breaking the build for anyone who's not expecting them as we
work out any kinks.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
.gitmodules | 4 ++++
Makefile | 12 ++++++++++++
hash.h | 4 ++++
sha1collisiondetection | 1 +
4 files changed, 21 insertions(+)
create mode 100644 .gitmodules
create mode 160000 sha1collisiondetection
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000..cbeebdab7a
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "sha1collisiondetection"]
+ path = sha1collisiondetection
+ url = https://github.com/cr-marcstevens/sha1collisiondetection.git
+ branch = master
diff --git a/Makefile b/Makefile
index 7c621f7f76..adeff26d57 100644
--- a/Makefile
+++ b/Makefile
@@ -146,6 +146,12 @@ all::
# algorithm. This is slower, but may detect attempted collision attacks.
# Takes priority over other *_SHA1 knobs.
#
+# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
+# sha1collisiondetection shipped as a submodule instead of the
+# non-submodule copy in sha1dc/. This is an experimental option used
+# by the git project to migrate to using sha1collisiondetection as a
+# submodule.
+#
# Define OPENSSL_SHA1 environment variable when running make to link
# with the SHA1 routine from openssl library.
#
@@ -1416,8 +1422,14 @@ ifdef APPLE_COMMON_CRYPTO
BASIC_CFLAGS += -DSHA1_APPLE
else
DC_SHA1 := YesPlease
+ifdef DC_SHA1_SUBMODULE
+ LIB_OBJS += sha1collisiondetection/lib/sha1.o
+ LIB_OBJS += sha1collisiondetection/lib/ubc_check.o
+ BASIC_CFLAGS += -DDC_SHA1_SUBMODULE
+else
LIB_OBJS += sha1dc/sha1.o
LIB_OBJS += sha1dc/ubc_check.o
+endif
BASIC_CFLAGS += \
-DSHA1_DC \
-DSHA1DC_NO_STANDARD_INCLUDES \
diff --git a/hash.h b/hash.h
index a11fc9233f..bef3e630a0 100644
--- a/hash.h
+++ b/hash.h
@@ -8,7 +8,11 @@
#elif defined(SHA1_OPENSSL)
#include <openssl/sha.h>
#elif defined(SHA1_DC)
+#ifdef DC_SHA1_SUBMODULE
+#include "sha1collisiondetection/lib/sha1.h"
+#else
#include "sha1dc/sha1.h"
+#endif
#else /* SHA1_BLK */
#include "block-sha1/sha1.h"
#endif
diff --git a/sha1collisiondetection b/sha1collisiondetection
new file mode 160000
index 0000000000..e1399840b5
--- /dev/null
+++ b/sha1collisiondetection
@@ -0,0 +1 @@
+Subproject commit e1399840b501a68ac6c8d7ed9a5cb1455480200e
--
2.13.0.506.g27d5fe0cd
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule
2017-06-06 15:12 ` [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule Ævar Arnfjörð Bjarmason
@ 2017-06-06 18:48 ` Stefan Beller
2017-06-06 19:03 ` Ævar Arnfjörð Bjarmason
0 siblings, 1 reply; 26+ messages in thread
From: Stefan Beller @ 2017-06-06 18:48 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> Add an option to use the sha1collisiondetection library from the
> submodule in sha1collisiondetection/ instead of in the copy in the
> sha1dc/ directory.
>
> This allows us to try out the submodule in sha1collisiondetection
> without breaking the build for anyone who's not expecting them as we
> work out any kinks.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Other projects using submodules sometimes have
a .gitattributes entry to have .gitmodules not exported
via git-archive. Do we want a similar thing?
Speaking of attributes, I wonder if we want to specify
the .gitmodules file to be text with unixy file endings:
Having an entry
.gitattributes eol=crlf
to simulate a Windows environment doesn't harm
submodule operation, which is good. I'll check if we
have a test for that.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule
2017-06-06 18:48 ` Stefan Beller
@ 2017-06-06 19:03 ` Ævar Arnfjörð Bjarmason
2017-06-06 19:09 ` Stefan Beller
0 siblings, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 19:03 UTC (permalink / raw)
To: Stefan Beller
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 8:48 PM, Stefan Beller <sbeller@google.com> wrote:
> On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> Add an option to use the sha1collisiondetection library from the
>> submodule in sha1collisiondetection/ instead of in the copy in the
>> sha1dc/ directory.
>>
>> This allows us to try out the submodule in sha1collisiondetection
>> without breaking the build for anyone who's not expecting them as we
>> work out any kinks.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>
> Other projects using submodules sometimes have
> a .gitattributes entry to have .gitmodules not exported
> via git-archive. Do we want a similar thing?
Right now we end up with an empty directory due to the issue you noted
in https://public-inbox.org/git/CAGZ79kZC98CxA69QjmX2s_SU6z1CSgKgwZeqvwiMRAQc6+S3xg@mail.gmail.com/
It's probably best to have the .gitmodules file as some hint that
something should be there. We also ship the other .git* files.
> Speaking of attributes, I wonder if we want to specify
> the .gitmodules file to be text with unixy file endings:
> Having an entry
> .gitattributes eol=crlf
> to simulate a Windows environment doesn't harm
> submodule operation, which is good. I'll check if we
> have a test for that.
I have no idea what that would do or why we'd have it, but I'm going
to understand this as you looking into it :)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule
2017-06-06 19:03 ` Ævar Arnfjörð Bjarmason
@ 2017-06-06 19:09 ` Stefan Beller
0 siblings, 0 replies; 26+ messages in thread
From: Stefan Beller @ 2017-06-06 19:09 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 12:03 PM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Tue, Jun 6, 2017 at 8:48 PM, Stefan Beller <sbeller@google.com> wrote:
>> On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
>> <avarab@gmail.com> wrote:
>>> Add an option to use the sha1collisiondetection library from the
>>> submodule in sha1collisiondetection/ instead of in the copy in the
>>> sha1dc/ directory.
>>>
>>> This allows us to try out the submodule in sha1collisiondetection
>>> without breaking the build for anyone who's not expecting them as we
>>> work out any kinks.
>>>
>>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>>
>> Other projects using submodules sometimes have
>> a .gitattributes entry to have .gitmodules not exported
>> via git-archive. Do we want a similar thing?
>
> Right now we end up with an empty directory due to the issue you noted
> in https://public-inbox.org/git/CAGZ79kZC98CxA69QjmX2s_SU6z1CSgKgwZeqvwiMRAQc6+S3xg@mail.gmail.com/
>
> It's probably best to have the .gitmodules file as some hint that
> something should be there. We also ship the other .git* files.
Ok, but then let's talk about the other .git* files, would we want to
distribute these via tarballs? (I guess it is a minor thing if at all and
nobody downloading a git tarball would be surprised by these metadata
files or annoyed by them, so all is good?)
>
>> Speaking of attributes, I wonder if we want to specify
>> the .gitmodules file to be text with unixy file endings:
>> Having an entry
>> .gitattributes eol=crlf
>> to simulate a Windows environment doesn't harm
>> submodule operation, which is good. I'll check if we
>> have a test for that.
>
> I have no idea what that would do or why we'd have it, but I'm going
> to understand this as you looking into it :)
I looked briefly into it and it seems to be no problem just as config files
on Windows are no problem. I just spoke up too quickly.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 3/3] sha1collisiondetection: automatically enable when submodule is populated
2017-06-06 15:12 ` [PATCH 0/3] update sha1dc Ævar Arnfjörð Bjarmason
2017-06-06 15:12 ` [PATCH 1/3] sha1dc: update from upstream Ævar Arnfjörð Bjarmason
2017-06-06 15:12 ` [PATCH 2/3] sha1dc: optionally use sha1collisiondetection as a submodule Ævar Arnfjörð Bjarmason
@ 2017-06-06 15:12 ` Ævar Arnfjörð Bjarmason
2017-06-06 18:23 ` [PATCH 0/3] update sha1dc Stefan Beller
2017-06-13 2:09 ` [PATCH 0/3] update sha1dc Liam R. Howlett
4 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 15:12 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Adam Dinwoodie, Ramsay Jones, Liam R . Howlett,
Michael Kebe, Ævar Arnfjörð Bjarmason
From: Junio C Hamano <gitster@pobox.com>
If a user wants to experiment with the version of collision
detecting sha1 from the submodule, the user needed to not just
populate the submodule but also needed to turn the knob.
A Makefile trick is easy enough to do so, so let's do this. When
somebody with a copy of the submodule populated wants not to use it,
that can be done by overriding it in config.mak or from the command
line.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index adeff26d57..eeccbff1cd 100644
--- a/Makefile
+++ b/Makefile
@@ -993,6 +993,10 @@ EXTLIBS =
GIT_USER_AGENT = git/$(GIT_VERSION)
+ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h)
+DC_SHA1_SUBMODULE = auto
+endif
+
include config.mak.uname
-include config.mak.autogen
-include config.mak
--
2.13.0.506.g27d5fe0cd
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] update sha1dc
2017-06-06 15:12 ` [PATCH 0/3] update sha1dc Ævar Arnfjörð Bjarmason
` (2 preceding siblings ...)
2017-06-06 15:12 ` [PATCH 3/3] sha1collisiondetection: automatically enable when submodule is populated Ævar Arnfjörð Bjarmason
@ 2017-06-06 18:23 ` Stefan Beller
2017-06-06 18:51 ` Ævar Arnfjörð Bjarmason
2017-06-13 2:09 ` [PATCH 0/3] update sha1dc Liam R. Howlett
4 siblings, 1 reply; 26+ messages in thread
From: Stefan Beller @ 2017-06-06 18:23 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> This updates sha1dc fixing the issue on Cygwin introduced in 2.13.1,
> and hopefully not regressing elsewhere. Liam, it would be much
> appreciated if you could test this on SPARC.
>
> As before the "sha1dc: update from upstream" patch is what should
> fast-track to master/maint and be in 2.13.2, the other two are the
> cooking submodule use, that's all unchanged aside from of course the
> submodule pointing to the same upstream commit as the code import
> itself does.
>
> Junio: There's a whitespace change to sha1.h that am warns about, but
> which it applies anyway that you didn't apply from my previous
> patch. I think it probably makes sense to just take upstream's
> whitespace shenanigans as-is instead of seeing that diff every time we
> update. I guess we could also send them a pull request...
I would suggest the pull request.
Also as to not make the mistake from before that I jump on the
submodule bandwagon here:
Patch 1 ought to go in its on series/patch, so with that out the way
we have more time to consider the pros and cons of the rest of
the series?
Thanks,
Stefan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] update sha1dc
2017-06-06 18:23 ` [PATCH 0/3] update sha1dc Stefan Beller
@ 2017-06-06 18:51 ` Ævar Arnfjörð Bjarmason
2017-06-06 19:01 ` [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations Jeff King
0 siblings, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 18:51 UTC (permalink / raw)
To: Stefan Beller
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 8:23 PM, Stefan Beller <sbeller@google.com> wrote:
> On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> This updates sha1dc fixing the issue on Cygwin introduced in 2.13.1,
>> and hopefully not regressing elsewhere. Liam, it would be much
>> appreciated if you could test this on SPARC.
>>
>> As before the "sha1dc: update from upstream" patch is what should
>> fast-track to master/maint and be in 2.13.2, the other two are the
>> cooking submodule use, that's all unchanged aside from of course the
>> submodule pointing to the same upstream commit as the code import
>> itself does.
>>
>> Junio: There's a whitespace change to sha1.h that am warns about, but
>> which it applies anyway that you didn't apply from my previous
>> patch. I think it probably makes sense to just take upstream's
>> whitespace shenanigans as-is instead of seeing that diff every time we
>> update. I guess we could also send them a pull request...
>
> I would suggest the pull request.
Looking at this again it's not a bug, just upstream choosing to indent
a comment with spaces, not a bug.
So it makes sense to just apply as-is so we don't have that diff with
them / different sha1s on the files etc.
> Also as to not make the mistake from before that I jump on the
> submodule bandwagon here:
> Patch 1 ought to go in its on series/patch, so with that out the way
> we have more time to consider the pros and cons of the rest of
> the series?
Yes it makes perfect sense to just take the 1st patch here and make
the submodule changes cook. This is just how I submitted it the last
time and Junio took the 1st patch into a maint topic, so I figured I'd
send it like this again.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations
2017-06-06 18:51 ` Ævar Arnfjörð Bjarmason
@ 2017-06-06 19:01 ` Jeff King
2017-06-06 19:04 ` Ævar Arnfjörð Bjarmason
2017-06-06 19:05 ` Stefan Beller
0 siblings, 2 replies; 26+ messages in thread
From: Jeff King @ 2017-06-06 19:01 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason
Cc: Stefan Beller, git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 06, 2017 at 08:51:35PM +0200, Ævar Arnfjörð Bjarmason wrote:
> On Tue, Jun 6, 2017 at 8:23 PM, Stefan Beller <sbeller@google.com> wrote:
> > On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
> > <avarab@gmail.com> wrote:
> >> This updates sha1dc fixing the issue on Cygwin introduced in 2.13.1,
> >> and hopefully not regressing elsewhere. Liam, it would be much
> >> appreciated if you could test this on SPARC.
> >>
> >> As before the "sha1dc: update from upstream" patch is what should
> >> fast-track to master/maint and be in 2.13.2, the other two are the
> >> cooking submodule use, that's all unchanged aside from of course the
> >> submodule pointing to the same upstream commit as the code import
> >> itself does.
> >>
> >> Junio: There's a whitespace change to sha1.h that am warns about, but
> >> which it applies anyway that you didn't apply from my previous
> >> patch. I think it probably makes sense to just take upstream's
> >> whitespace shenanigans as-is instead of seeing that diff every time we
> >> update. I guess we could also send them a pull request...
> >
> > I would suggest the pull request.
>
> Looking at this again it's not a bug, just upstream choosing to indent
> a comment with spaces, not a bug.
>
> So it makes sense to just apply as-is so we don't have that diff with
> them / different sha1s on the files etc.
Agreed. Maybe we'd also want this patch:
-- >8 --
Subject: sha1dc: ignore indent-with-non-tab whitespace violations
The upstream sha1dc code indents some lines with spaces.
While this doesn't match Git's coding guidelines, it's better
to leave this imported code untouched than to try to make it
match our style. However, we can use .gitattributes to tell
"diff --check" and "git am" not to bother us about it.
Signed-off-by: Jeff King <peff@peff.net>
---
sha1dc/.gitattributes | 1 +
1 file changed, 1 insertion(+)
create mode 100644 sha1dc/.gitattributes
diff --git a/sha1dc/.gitattributes b/sha1dc/.gitattributes
new file mode 100644
index 000000000..da53f4054
--- /dev/null
+++ b/sha1dc/.gitattributes
@@ -0,0 +1 @@
+* whitespace=-indent-with-non-tab
--
2.13.1.664.g1b5a21ec3
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations
2017-06-06 19:01 ` [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations Jeff King
@ 2017-06-06 19:04 ` Ævar Arnfjörð Bjarmason
2017-06-06 19:05 ` Stefan Beller
1 sibling, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-06-06 19:04 UTC (permalink / raw)
To: Jeff King
Cc: Stefan Beller, git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones,
Liam R . Howlett, Michael Kebe
On Tue, Jun 6, 2017 at 9:01 PM, Jeff King <peff@peff.net> wrote:
> On Tue, Jun 06, 2017 at 08:51:35PM +0200, Ævar Arnfjörð Bjarmason wrote:
>
>> On Tue, Jun 6, 2017 at 8:23 PM, Stefan Beller <sbeller@google.com> wrote:
>> > On Tue, Jun 6, 2017 at 8:12 AM, Ævar Arnfjörð Bjarmason
>> > <avarab@gmail.com> wrote:
>> >> This updates sha1dc fixing the issue on Cygwin introduced in 2.13.1,
>> >> and hopefully not regressing elsewhere. Liam, it would be much
>> >> appreciated if you could test this on SPARC.
>> >>
>> >> As before the "sha1dc: update from upstream" patch is what should
>> >> fast-track to master/maint and be in 2.13.2, the other two are the
>> >> cooking submodule use, that's all unchanged aside from of course the
>> >> submodule pointing to the same upstream commit as the code import
>> >> itself does.
>> >>
>> >> Junio: There's a whitespace change to sha1.h that am warns about, but
>> >> which it applies anyway that you didn't apply from my previous
>> >> patch. I think it probably makes sense to just take upstream's
>> >> whitespace shenanigans as-is instead of seeing that diff every time we
>> >> update. I guess we could also send them a pull request...
>> >
>> > I would suggest the pull request.
>>
>> Looking at this again it's not a bug, just upstream choosing to indent
>> a comment with spaces, not a bug.
>>
>> So it makes sense to just apply as-is so we don't have that diff with
>> them / different sha1s on the files etc.
>
> Agreed. Maybe we'd also want this patch:
Great, that makes perfect sense for prepending to the series.
> -- >8 --
> Subject: sha1dc: ignore indent-with-non-tab whitespace violations
>
> The upstream sha1dc code indents some lines with spaces.
> While this doesn't match Git's coding guidelines, it's better
> to leave this imported code untouched than to try to make it
> match our style. However, we can use .gitattributes to tell
> "diff --check" and "git am" not to bother us about it.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> sha1dc/.gitattributes | 1 +
> 1 file changed, 1 insertion(+)
> create mode 100644 sha1dc/.gitattributes
>
> diff --git a/sha1dc/.gitattributes b/sha1dc/.gitattributes
> new file mode 100644
> index 000000000..da53f4054
> --- /dev/null
> +++ b/sha1dc/.gitattributes
> @@ -0,0 +1 @@
> +* whitespace=-indent-with-non-tab
> --
> 2.13.1.664.g1b5a21ec3
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations
2017-06-06 19:01 ` [PATCH] sha1dc: ignore indent-with-non-tab whitespace violations Jeff King
2017-06-06 19:04 ` Ævar Arnfjörð Bjarmason
@ 2017-06-06 19:05 ` Stefan Beller
1 sibling, 0 replies; 26+ messages in thread
From: Stefan Beller @ 2017-06-06 19:05 UTC (permalink / raw)
To: Jeff King
Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
Adam Dinwoodie, Ramsay Jones, Liam R . Howlett, Michael Kebe
> Subject: sha1dc: ignore indent-with-non-tab whitespace violations
>
> The upstream sha1dc code indents some lines with spaces.
> While this doesn't match Git's coding guidelines, it's better
> to leave this imported code untouched than to try to make it
> match our style. However, we can use .gitattributes to tell
> "diff --check" and "git am" not to bother us about it.
>
> Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Stefan Beller <sbeller@google.com>
> ---
> sha1dc/.gitattributes | 1 +
> 1 file changed, 1 insertion(+)
> create mode 100644 sha1dc/.gitattributes
>
> diff --git a/sha1dc/.gitattributes b/sha1dc/.gitattributes
> new file mode 100644
> index 000000000..da53f4054
> --- /dev/null
> +++ b/sha1dc/.gitattributes
> @@ -0,0 +1 @@
> +* whitespace=-indent-with-non-tab
> --
> 2.13.1.664.g1b5a21ec3
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] update sha1dc
2017-06-06 15:12 ` [PATCH 0/3] update sha1dc Ævar Arnfjörð Bjarmason
` (3 preceding siblings ...)
2017-06-06 18:23 ` [PATCH 0/3] update sha1dc Stefan Beller
@ 2017-06-13 2:09 ` Liam R. Howlett
4 siblings, 0 replies; 26+ messages in thread
From: Liam R. Howlett @ 2017-06-13 2:09 UTC (permalink / raw)
To: ?var Arnfj?r? Bjarmason
Cc: git, Junio C Hamano, Adam Dinwoodie, Ramsay Jones, Michael Kebe
* ?var Arnfj?r? Bjarmason <avarab@gmail.com> [170606 11:12]:
> This updates sha1dc fixing the issue on Cygwin introduced in 2.13.1,
> and hopefully not regressing elsewhere. Liam, it would be much
> appreciated if you could test this on SPARC.
Tested and confirmed this works for SPARC with no build flags.
Sorry for the delay, I was away last week.
Thanks,
Liam
^ permalink raw reply [flat|nested] 26+ messages in thread