* Re: [PATCH 10/11] Add MSVC Project file
From: Pau Garcia i Quiles @ 2009-08-17 22:44 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Erik Faye-Lund, Paolo Bonzini, Frank Li, git, msysgit
In-Reply-To: <alpine.DEB.1.00.0908172306080.8306@pacific.mpi-cbg.de>
(Sorry for answering some parts now, I didn't realize this text was
there before)
> But here's a clue: you will probably _never_ succeed in getting a
> replacement of the make-based build in git.git by the maintainer. Make is
> just too ubiquitous and well-established for that.
CMake does not replace Make, it runs a step before CMake
CMakeLists.txt
|
|
|
v
Makefile/.vcproj/Eclipse/XCode project/NMakefile
|
|
|
v
gcc/VC++/SunCC/whatever
|
|
v
ld/link.exe/whatever
(see page 10 in my slides for a nicer version :-) )
> If you succeed, I will ask you to do the same for Python, as you clearly
> proved by that point that you are a magician.
I can't do any Python whatsoever, sorry :-)
--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
^ permalink raw reply
* Re: [PATCH 10/11] Add MSVC Project file
From: Thiago Farina @ 2009-08-17 22:50 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Frank Li, git, msysgit
In-Reply-To: <alpine.DEB.1.00.0908180036260.8306@pacific.mpi-cbg.de>
On Mon, Aug 17, 2009 at 7:39 PM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 17 Aug 2009, Thiago Farina wrote:
>
>> What about the common-cmds.h that is included in builtin-help.c? How it will
>> be generated?
>> I followed the instructions in ReadMe, then I can't compile because of this
>> "missing" file.
>
> Thiago, you do not want to top-post in both of the mailing-lists you sent
> to. And you certainly do _not_ want to send 200K of unanswered, quoted
> text:
>
I tried to don't do this(top-post), but things goes bad again .
>> On Mon, Aug 17, 2009 at 1:05 PM, Frank Li <lznuaa@gmail.com> wrote:
>>
>> [200K that were not needed for Thiago's question]
>
> Sorry, but I do not feel inclined to respond to your question if you do
> not want to adher to netiquette that you must have seen when you first
> posted to the msysGit mailing list.
>
> Ciao,
> Dscho
>
>
^ permalink raw reply
* Re: [PATCH 10/11] Add MSVC Project file
From: Pau Garcia i Quiles @ 2009-08-17 23:00 UTC (permalink / raw)
To: Johan 't Hart
Cc: Johannes Schindelin, Erik Faye-Lund, Paolo Bonzini, Frank Li, git,
msysgit
In-Reply-To: <4A89D909.9050700@gmail.com>
On Tue, Aug 18, 2009 at 12:26 AM, Johan 't Hart<johanthart@gmail.com> wrote:
> Johannes Schindelin schreef:
>
>> Having said that, a CMake-based system _in addition_ to what is
>> tried-and-tested to be able to support all those different kinds of
>> Microsoft Visual Studio (took me 3 attempts to write that without a
>> Freudian) would be welcome, _if_ you succeed in making it compile out of the
>> box on msysGit.
>
> That would require (I think) that CMake is build by the msysgit gcc tools
> available in msysgit, since CMake can't be build by VS right? Pau do you
> think that is possible?
CMake can certainly be built by VC++ but you need CMake to do that,
VC++-CMake cannot be bootstrapped.
Would it be OK to download a binary version of CMake instead of / in
addition to the source? (I'm not familiar with the 'release.sh' stuff
yet)
> It would be fun. Download the msysgit netinstaller, set it up, install it,
> and after that, CMake is bootstrapped, and the visual studio .vcproj files
> are generated and everyone (VS developers and msys developers) are ready to
> go!
That'd be right, if I have understood what the netinstaller does (I've
never used it yet).
--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
^ permalink raw reply
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: skillzero @ 2009-08-17 23:02 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Junio C Hamano, Jakub Narebski, Nguyen Thai Ngoc Duy, git
In-Reply-To: <alpine.DEB.1.00.0908172347220.8306@pacific.mpi-cbg.de>
On Mon, Aug 17, 2009 at 3:02 PM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> And here comes the problem: if something is treated untracked because it
> was outside of the sparse checkout, then I want it to be treated as
> untracked _even if_ I happened to broaden the checkout by editing
> .git/info/sparse. The file did not just magically become subject to
> overwriting just because I edited .git/info/sparse (which could be a
> simple mistake).
Maybe I'm misunderstanding what you're saying, but why would you want
a file that's become part of the checkout by editing .git/info/sparse
to still be treated as untracked?
If I have a file on that's excluded via .git/info/sparse then I edit
.git/info/sparse to include it and switch to a branch that doesn't
have that file, I'd expect that file to be deleted from the working
copy if the content matches what's in the repository. If it's modified
then I'd expect the branch switch to fail (like it would without a
sparse checkout).
^ permalink raw reply
* [PATCH][resend] git-svn: Respect GIT_SSH setting
From: Karthik R @ 2009-08-17 23:02 UTC (permalink / raw)
To: git
Setting GIT_SSH when using "git svn clone svn+ssh://..." does not
override the default ssh; SVN_SSH needed to be set instead. Fixed
this.
Also, on Windows, SVN_SSH needs to be set with \ escaped
e.g., "C:\\PuTTY\\plink.exe"
See http://code.google.com/p/msysgit/issues/detail?id=305
Signed-off-by: Karthik R <karthikr@fastmail.fm>
---
Originally sent as [PATCH] GIT_SSH does not override ssh in git-svn
git-svn.perl | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index b0bfb74..9bc1e71 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -21,6 +21,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} ||
'git-svn';
$Git::SVN::Ra::_log_window_size = 100;
$Git::SVN::_minimize_url = 'unset';
+# If GIT_SSH is set, also set SVN_SSH...
+$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};
+# ... and escape \s in shell-variable on Windows
+if ($^O eq 'MSWin32' || $^O eq 'msys') {
+ $ENV{SVN_SSH} =~ s/\\/\\\\/g if defined $ENV{SVN_SSH};
+}
+
$Git::SVN::Log::TZ = $ENV{TZ};
$ENV{TZ} = 'UTC';
$| = 1; # unbuffer STDOUT
-- 1.5.4.3
^ permalink raw reply related
* Re: Linus' sha1 is much faster!
From: George Spelvin @ 2009-08-17 23:12 UTC (permalink / raw)
To: linux, nico; +Cc: art.08.09, bdonlan, git, johnflux, P, torvalds
In-Reply-To: <alpine.LFD.2.00.0908171513230.6044@xanadu.home>
>> The purpose of the rewrite is to avoid having to make
>> pessimistic assumptions about people who don't respond.
>>
>> I suppose I should have made that request clearer:
>> Is there anyone who claims copyright on anything here?
>> Or would just like credit?
>> If so, are you willing to donate it to the public domain?
> I think this is much nicer to everyone involved.
>
> As far as I'm concerned, I'm OK with giving any small copyright I might
> have in this SHA1 implementation, if any, to the public domain.
> Credits are always nice.
My apologies. I read a lot of people talking about wanting the code
under different licenses, and thought I'd just cut through it by
providing some PD code.
I didn't turn around and look at it from the point of view of the
people who'd put the work into developing it. I don't mean to deny
anyone credit for their work. In fact, providing more detail is on
the to-do list, but I haven't waded through the mail archives and
tracked down who contributed what yet.
I'll work on those polish details once I have it producing the same
assembly code as Linus'.
There are a lot of possible highly-permissive licenses if one is wanted
(zlib, MIT, CC-by), but public domain seems simpler.
^ permalink raw reply
* Re: [PATCH] filter-branch: add an example how to add ACKs to a range of commits
From: Junio C Hamano @ 2009-08-17 23:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <34cc046b42b5a67bb1c926709bcd1163d1d2faf6.1250541493u.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> When you have to add certain lines like ACKs (or for that matter,
> Signed-off-by:s) to a range of commits starting with HEAD, you might
> be tempted to use 'git rebase -i -10', but that is a waste of your
> time.
Cute.
In a case like this, I tend to just do:
git checkout $(git merge-base master js/series)
git format-patch --stdout master..js/series | git am -s
git diff js/series
git branch --with js/series
git branch -f js/series
as the first step (checking out the base, detaching HEAD) and the last
group of steps (verifying what improvements I made while on detached HEAD,
checking what _other_ branches may need to be rebuilt, and actually
updating the branch) are very common for my every-day branch whipping
workflow, and the second case being the full "format-patch | am" is just a
special case of what I do regularly, e.g. cherry-picking, manually
fixing-up, etc.
Rebase -i is very nice if you need to dig deep but the change you make is
actually very limited. Filter-branch is too automated and requires an
enormous amount of effort to do anything flexible. Often I find myself
wanting to do something in the middle, and I end up doing the "detach at
the base and rebuild" procedure.
Will apply. The hint is useful nevertheless.
^ permalink raw reply
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Johannes Schindelin @ 2009-08-17 23:16 UTC (permalink / raw)
To: skillzero; +Cc: Junio C Hamano, Jakub Narebski, Nguyen Thai Ngoc Duy, git
In-Reply-To: <2729632a0908171602m3c05c97bx9ce31e8960df9198@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2023 bytes --]
Hi,
On Mon, 17 Aug 2009, skillzero@gmail.com wrote:
> On Mon, Aug 17, 2009 at 3:02 PM, Johannes
> Schindelin<Johannes.Schindelin@gmx.de> wrote:
>
> > And here comes the problem: if something is treated untracked because
> > it was outside of the sparse checkout, then I want it to be treated as
> > untracked _even if_ I happened to broaden the checkout by editing
> > .git/info/sparse. The file did not just magically become subject to
> > overwriting just because I edited .git/info/sparse (which could be a
> > simple mistake).
>
> Maybe I'm misunderstanding what you're saying, but why would you want a
> file that's become part of the checkout by editing .git/info/sparse to
> still be treated as untracked?
>
> If I have a file on that's excluded via .git/info/sparse then I edit
> .git/info/sparse to include it and switch to a branch that doesn't have
> that file, I'd expect that file to be deleted from the working copy if
> the content matches what's in the repository. If it's modified then I'd
> expect the branch switch to fail (like it would without a sparse
> checkout).
First things first: with sparse checkout, you should not check out
_anything_ outside of the focus of the sparse checkout.
So I contend that you would only end up with a sparse'd-out file
that was formerly tracked if you did something wrong. That should not
happen.
Even if: all the more reason to have a flag that indicated that this file
is not sparsed'd-out -- contradicting .git/info/sparse.
The thing is: we need a way to determine quickly and without any
ambiguity whether a file is tracked, assumed unchanged, or sparse'd-out
(which Nguyễn calls no-checkout).
And if we change .git/info/sparse, that state _must not_ change. We did
not touch the file by editing .git/info/sparse, so the state must be
unchanged.
Whether "git checkout" should realize that a checked out file (which has
no changes, mind you!) needs to be deleted and marked no-checkout is a
different question.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH][resend] git-svn: Respect GIT_SSH setting
From: Johannes Schindelin @ 2009-08-17 23:20 UTC (permalink / raw)
To: Karthik R; +Cc: git
In-Reply-To: <4A89E185.2010307@fastmail.fm>
Hi,
On Mon, 17 Aug 2009, Karthik R wrote:
> Setting GIT_SSH when using "git svn clone svn+ssh://..." does not
> override the default ssh; SVN_SSH needed to be set instead.
This is now in past tense, no?
> diff --git a/git-svn.perl b/git-svn.perl
> index b0bfb74..9bc1e71 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -21,6 +21,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
> $Git::SVN::Ra::_log_window_size = 100;
> $Git::SVN::_minimize_url = 'unset';
>
> +# If GIT_SSH is set, also set SVN_SSH...
> +$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};
> +# ... and escape \s in shell-variable on Windows
> +if ($^O eq 'MSWin32' || $^O eq 'msys') {
> + $ENV{SVN_SSH} =~ s/\\/\\\\/g if defined $ENV{SVN_SSH};
> +}
This is a change from before... I do not know if it is a good one, as
SVN_SSH could be defined differently by the user, no? In that case, the
user was most likely using the correct amount of backslashes...
So maybe it was correct to make this dependent on "if defined
$ENV{GIT_SSH}", and maybe it should be dependent on "&& !defined
$ENV{SVN_SSH}" as well...
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH][resend] git-svn: Respect GIT_SSH setting
From: Junio C Hamano @ 2009-08-17 23:21 UTC (permalink / raw)
To: Karthik R; +Cc: git
In-Reply-To: <4A89E185.2010307@fastmail.fm>
Karthik R <karthikr@fastmail.fm> writes:
> +# If GIT_SSH is set, also set SVN_SSH...
> +$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};
> +# ... and escape \s in shell-variable on Windows
> +if ($^O eq 'MSWin32' || $^O eq 'msys') {
> + $ENV{SVN_SSH} =~ s/\\/\\\\/g if defined $ENV{SVN_SSH};
> +}
> +
Two questions.
- What if a user has SVN_SSH exported _and_ wants to use a different one
from the one s/he uses for git? Naturally such a user would set both
environment variables and differently, but this seems to override the
value in SVN_SSH;
- Can a user have SVN_SSH exported, on MSWin32 or msys, and use svn
outside git? If so, what does the value of SVN_SSH look like? Does it
typically have necessary doubling of backslashes already?
What I am getting at is, if the patch should look something like this
instead:
if (! exists $ENV{SVN_SSH}) {
if (exists $ENV{GIT_SSH}) {
$ENV{SVN_SSH} = $ENV{GIT_SSH};
if ($^O eq 'MSWin32' || $^O eq 'msys') {
$ENV{SVN_SSH} =~ s/\\/\\\\/g;
}
}
}
^ permalink raw reply
* Re: [PATCH 10/11] Add MSVC Project file
From: Johannes Schindelin @ 2009-08-17 23:40 UTC (permalink / raw)
To: Pau Garcia i Quiles
Cc: Johan 't Hart, Erik Faye-Lund, Paolo Bonzini, Frank Li, git,
msysgit
In-Reply-To: <3af572ac0908171600s7aa7b21ftf95fde92246bf75f@mail.gmail.com>
Hi,
On Tue, 18 Aug 2009, Pau Garcia i Quiles wrote:
> On Tue, Aug 18, 2009 at 12:26 AM, Johan 't Hart<johanthart@gmail.com> wrote:
> > Johannes Schindelin schreef:
> >
> >> Having said that, a CMake-based system _in addition_ to what is
> >> tried-and-tested to be able to support all those different kinds of
> >> Microsoft Visual Studio (took me 3 attempts to write that without a
> >> Freudian) would be welcome, _if_ you succeed in making it compile out
> >> of the box on msysGit.
> >
> > That would require (I think) that CMake is build by the msysgit gcc
> > tools available in msysgit, since CMake can't be build by VS right?
> > Pau do you think that is possible?
>
> CMake can certainly be built by VC++ but you need CMake to do that,
> VC++-CMake cannot be bootstrapped.
>
> Would it be OK to download a binary version of CMake instead of / in
> addition to the source? (I'm not familiar with the 'release.sh' stuff
> yet)
Well, as I tried to establish msysGit as _the_ Git for Windows, I would be
willing to created download bundles for Microsoft Visual C++ users, but
only if the hassle is not big enough.
Read: if the procedure is a script that does not need to be supervised
until it created a .zip or .7z file, I'm all for it.
> > It would be fun. Download the msysgit netinstaller, set it up, install
> > it, and after that, CMake is bootstrapped, and the visual studio
> > .vcproj files are generated and everyone (VS developers and msys
> > developers) are ready to go!
>
> That'd be right, if I have understood what the netinstaller does (I've
> never used it yet).
Or that.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH][resend] git-svn: Respect GIT_SSH setting
From: Karthik R @ 2009-08-17 23:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vzl9ykovh.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Karthik R <karthikr@fastmail.fm> writes:
>
>
>> +# If GIT_SSH is set, also set SVN_SSH...
>> +$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};
>> +# ... and escape \s in shell-variable on Windows
>> +if ($^O eq 'MSWin32' || $^O eq 'msys') {
>> + $ENV{SVN_SSH} =~ s/\\/\\\\/g if defined $ENV{SVN_SSH};
>> +}
>> +
>>
>
> Two questions.
>
> - What if a user has SVN_SSH exported _and_ wants to use a different one
> from the one s/he uses for git? Naturally such a user would set both
> environment variables and differently, but this seems to override the
> value in SVN_SSH;
>
Do you mean user wants to use a different one with "git svn ...
svn+ssh://" (than the one with "git clone ssh://") ?
In this case
- defining SVN_SSH, but not GIT_SSH will still work (with this patch,
GIT_SSH overrides)
- but SVN_SSH needs to have \\s.
So unless the user already knew of this quirk, we'll only see unescaped
\s - so it *does* make sense to escape the \s (if the user knew, then
too many escaped \s still work).
> - Can a user have SVN_SSH exported, on MSWin32 or msys, and use svn
> outside git? If so, what does the value of SVN_SSH look like? Does it
> typically have necessary doubling of backslashes already?
>
With subversion for Windows, these \\s are not needed (but doesn't cause
any break). The doubling is something to do with the bash (in msys) I think.
> What I am getting at is, if the patch should look something like this
> instead:
>
> if (! exists $ENV{SVN_SSH}) {
> if (exists $ENV{GIT_SSH}) {
> $ENV{SVN_SSH} = $ENV{GIT_SSH};
> if ($^O eq 'MSWin32' || $^O eq 'msys') {
> $ENV{SVN_SSH} =~ s/\\/\\\\/g;
> }
> }
> }
>
>
^ permalink raw reply
* [PATCH] remove ARM and Mozilla SHA1 implementations
From: Nicolas Pitre @ 2009-08-17 23:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
They are both slower than the new BLK_SHA1 implementation, so it is
pointless to keep them around.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
Someone else would need to make the call for the PPC version. IMHO it
probably should go too, as no Makefile rule ever included it by default
even on PPC platforms. Some reports indicate that the BLK_SHA1 version
is faster on PPC as well.
And because the BLK_SHA1 is faster than the openssl version, then the
BLK_SHA1 could become the default (and only) choice. But one thing
at a time.
Makefile | 26 +------
arm/sha1.c | 82 --------------------
arm/sha1.h | 23 ------
arm/sha1_arm.S | 183 ---------------------------------------------
block-sha1/sha1.c | 6 +-
configure.ac | 10 +--
mozilla-sha1/sha1.c | 151 -------------------------------------
mozilla-sha1/sha1.h | 50 ------------
8 files changed, 7 insertions(+), 524 deletions(-)
diff --git a/Makefile b/Makefile
index f94fe05..4190a5d 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ all::
# when attempting to read from an fopen'ed directory.
#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies MOZILLA_SHA1.
+# This also implies BLK_SHA1.
#
# Define NO_CURL if you do not have libcurl installed. git-http-pull and
# git-http-push are not built, and you cannot use http:// and https://
@@ -91,14 +91,6 @@ all::
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
-# Define ARM_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for ARM.
-#
-# Define MOZILLA_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
-# choice) has very fast version optimized for i586.
-#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
@@ -930,10 +922,6 @@ else
NO_PTHREADS = YesPlease
endif
endif
-ifneq (,$(findstring arm,$(uname_M)))
- ARM_SHA1 = YesPlease
- NO_MKSTEMPS = YesPlease
-endif
-include config.mak.autogen
-include config.mak
@@ -1025,7 +1013,7 @@ ifndef NO_OPENSSL
endif
else
BASIC_CFLAGS += -DNO_OPENSSL
- MOZILLA_SHA1 = 1
+ BLK_SHA1 = 1
OPENSSL_LIBSSL =
endif
ifdef NEEDS_SSL_WITH_CRYPTO
@@ -1182,20 +1170,10 @@ ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
else
-ifdef ARM_SHA1
- SHA1_HEADER = "arm/sha1.h"
- LIB_OBJS += arm/sha1.o arm/sha1_arm.o
-else
-ifdef MOZILLA_SHA1
- SHA1_HEADER = "mozilla-sha1/sha1.h"
- LIB_OBJS += mozilla-sha1/sha1.o
-else
SHA1_HEADER = <openssl/sha.h>
EXTLIBS += $(LIB_4_CRYPTO)
endif
endif
-endif
-endif
ifdef NO_PERL_MAKEMAKER
export NO_PERL_MAKEMAKER
endif
diff --git a/arm/sha1.c b/arm/sha1.c
deleted file mode 100644
index c61ad4a..0000000
--- a/arm/sha1.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SHA-1 implementation optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- */
-
-#include <string.h>
-#include "sha1.h"
-
-extern void arm_sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
-
-void arm_SHA1_Init(arm_SHA_CTX *c)
-{
- c->len = 0;
- c->hash[0] = 0x67452301;
- c->hash[1] = 0xefcdab89;
- c->hash[2] = 0x98badcfe;
- c->hash[3] = 0x10325476;
- c->hash[4] = 0xc3d2e1f0;
-}
-
-void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n)
-{
- uint32_t workspace[80];
- unsigned int partial;
- unsigned long done;
-
- partial = c->len & 0x3f;
- c->len += n;
- if ((partial + n) >= 64) {
- if (partial) {
- done = 64 - partial;
- memcpy(c->buffer + partial, p, done);
- arm_sha_transform(c->hash, c->buffer, workspace);
- partial = 0;
- } else
- done = 0;
- while (n >= done + 64) {
- arm_sha_transform(c->hash, p + done, workspace);
- done += 64;
- }
- } else
- done = 0;
- if (n - done)
- memcpy(c->buffer + partial, p + done, n - done);
-}
-
-void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c)
-{
- uint64_t bitlen;
- uint32_t bitlen_hi, bitlen_lo;
- unsigned int i, offset, padlen;
- unsigned char bits[8];
- static const unsigned char padding[64] = { 0x80, };
-
- bitlen = c->len << 3;
- offset = c->len & 0x3f;
- padlen = ((offset < 56) ? 56 : (64 + 56)) - offset;
- arm_SHA1_Update(c, padding, padlen);
-
- bitlen_hi = bitlen >> 32;
- bitlen_lo = bitlen & 0xffffffff;
- bits[0] = bitlen_hi >> 24;
- bits[1] = bitlen_hi >> 16;
- bits[2] = bitlen_hi >> 8;
- bits[3] = bitlen_hi;
- bits[4] = bitlen_lo >> 24;
- bits[5] = bitlen_lo >> 16;
- bits[6] = bitlen_lo >> 8;
- bits[7] = bitlen_lo;
- arm_SHA1_Update(c, bits, 8);
-
- for (i = 0; i < 5; i++) {
- uint32_t v = c->hash[i];
- hash[0] = v >> 24;
- hash[1] = v >> 16;
- hash[2] = v >> 8;
- hash[3] = v;
- hash += 4;
- }
-}
diff --git a/arm/sha1.h b/arm/sha1.h
deleted file mode 100644
index b61b618..0000000
--- a/arm/sha1.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SHA-1 implementation optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- */
-
-#include <stdint.h>
-
-typedef struct {
- uint64_t len;
- uint32_t hash[5];
- unsigned char buffer[64];
-} arm_SHA_CTX;
-
-void arm_SHA1_Init(arm_SHA_CTX *c);
-void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n);
-void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c);
-
-#define git_SHA_CTX arm_SHA_CTX
-#define git_SHA1_Init arm_SHA1_Init
-#define git_SHA1_Update arm_SHA1_Update
-#define git_SHA1_Final arm_SHA1_Final
diff --git a/arm/sha1_arm.S b/arm/sha1_arm.S
deleted file mode 100644
index 41e9263..0000000
--- a/arm/sha1_arm.S
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * SHA transform optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
- .text
- .globl arm_sha_transform
-
-/*
- * void sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
- *
- * note: the "data" pointer may be unaligned.
- */
-
-arm_sha_transform:
-
- stmfd sp!, {r4 - r8, lr}
-
- @ for (i = 0; i < 16; i++)
- @ W[i] = ntohl(((uint32_t *)data)[i]);
-
-#ifdef __ARMEB__
- mov r4, r0
- mov r0, r2
- mov r2, #64
- bl memcpy
- mov r2, r0
- mov r0, r4
-#else
- mov r3, r2
- mov lr, #16
-1: ldrb r4, [r1], #1
- ldrb r5, [r1], #1
- ldrb r6, [r1], #1
- ldrb r7, [r1], #1
- subs lr, lr, #1
- orr r5, r5, r4, lsl #8
- orr r6, r6, r5, lsl #8
- orr r7, r7, r6, lsl #8
- str r7, [r3], #4
- bne 1b
-#endif
-
- @ for (i = 0; i < 64; i++)
- @ W[i+16] = ror(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 31);
-
- sub r3, r2, #4
- mov lr, #64
-2: ldr r4, [r3, #4]!
- subs lr, lr, #1
- ldr r5, [r3, #8]
- ldr r6, [r3, #32]
- ldr r7, [r3, #52]
- eor r4, r4, r5
- eor r4, r4, r6
- eor r4, r4, r7
- mov r4, r4, ror #31
- str r4, [r3, #64]
- bne 2b
-
- /*
- * The SHA functions are:
- *
- * f1(B,C,D) = (D ^ (B & (C ^ D)))
- * f2(B,C,D) = (B ^ C ^ D)
- * f3(B,C,D) = ((B & C) | (D & (B | C)))
- *
- * Then the sub-blocks are processed as follows:
- *
- * A' = ror(A, 27) + f(B,C,D) + E + K + *W++
- * B' = A
- * C' = ror(B, 2)
- * D' = C
- * E' = D
- *
- * We therefore unroll each loop 5 times to avoid register shuffling.
- * Also the ror for C (and also D and E which are successivelyderived
- * from it) is applied in place to cut on an additional mov insn for
- * each round.
- */
-
- .macro sha_f1, A, B, C, D, E
- ldr r3, [r2], #4
- eor ip, \C, \D
- add \E, r1, \E, ror #2
- and ip, \B, ip, ror #2
- add \E, \E, \A, ror #27
- eor ip, ip, \D, ror #2
- add \E, \E, r3
- add \E, \E, ip
- .endm
-
- .macro sha_f2, A, B, C, D, E
- ldr r3, [r2], #4
- add \E, r1, \E, ror #2
- eor ip, \B, \C, ror #2
- add \E, \E, \A, ror #27
- eor ip, ip, \D, ror #2
- add \E, \E, r3
- add \E, \E, ip
- .endm
-
- .macro sha_f3, A, B, C, D, E
- ldr r3, [r2], #4
- add \E, r1, \E, ror #2
- orr ip, \B, \C, ror #2
- add \E, \E, \A, ror #27
- and ip, ip, \D, ror #2
- add \E, \E, r3
- and r3, \B, \C, ror #2
- orr ip, ip, r3
- add \E, \E, ip
- .endm
-
- ldmia r0, {r4 - r8}
-
- mov lr, #4
- ldr r1, .L_sha_K + 0
-
- /* adjust initial values */
- mov r6, r6, ror #30
- mov r7, r7, ror #30
- mov r8, r8, ror #30
-
-3: subs lr, lr, #1
- sha_f1 r4, r5, r6, r7, r8
- sha_f1 r8, r4, r5, r6, r7
- sha_f1 r7, r8, r4, r5, r6
- sha_f1 r6, r7, r8, r4, r5
- sha_f1 r5, r6, r7, r8, r4
- bne 3b
-
- ldr r1, .L_sha_K + 4
- mov lr, #4
-
-4: subs lr, lr, #1
- sha_f2 r4, r5, r6, r7, r8
- sha_f2 r8, r4, r5, r6, r7
- sha_f2 r7, r8, r4, r5, r6
- sha_f2 r6, r7, r8, r4, r5
- sha_f2 r5, r6, r7, r8, r4
- bne 4b
-
- ldr r1, .L_sha_K + 8
- mov lr, #4
-
-5: subs lr, lr, #1
- sha_f3 r4, r5, r6, r7, r8
- sha_f3 r8, r4, r5, r6, r7
- sha_f3 r7, r8, r4, r5, r6
- sha_f3 r6, r7, r8, r4, r5
- sha_f3 r5, r6, r7, r8, r4
- bne 5b
-
- ldr r1, .L_sha_K + 12
- mov lr, #4
-
-6: subs lr, lr, #1
- sha_f2 r4, r5, r6, r7, r8
- sha_f2 r8, r4, r5, r6, r7
- sha_f2 r7, r8, r4, r5, r6
- sha_f2 r6, r7, r8, r4, r5
- sha_f2 r5, r6, r7, r8, r4
- bne 6b
-
- ldmia r0, {r1, r2, r3, ip, lr}
- add r4, r1, r4
- add r5, r2, r5
- add r6, r3, r6, ror #2
- add r7, ip, r7, ror #2
- add r8, lr, r8, ror #2
- stmia r0, {r4 - r8}
-
- ldmfd sp!, {r4 - r8, pc}
-
-.L_sha_K:
- .word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index 464cb25..a1228cf 100644
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
@@ -1,7 +1,9 @@
/*
- * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.c),
- * optimized to do word accesses rather than byte accesses,
+ * SHA1 routine optimized to do word accesses rather than byte accesses,
* and to avoid unnecessary copies into the context array.
+ *
+ * This was initially based on the Mozilla SHA1 implementation, although
+ * none of the original Mozilla code remains.
*/
#include <string.h>
diff --git a/configure.ac b/configure.ac
index 3f1922d..b09b8e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,19 +156,11 @@ AC_MSG_NOTICE([CHECKS for site configuration])
# tests. These tests take up a significant amount of the total test time
# but are not needed unless you plan to talk to SVN repos.
#
-# Define MOZILLA_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
-# choice) has very fast version optimized for i586.
-#
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
-# Define ARM_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for ARM.
-#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies MOZILLA_SHA1.
+# This also implies BLK_SHA1.
#
# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
diff --git a/mozilla-sha1/sha1.c b/mozilla-sha1/sha1.c
deleted file mode 100644
index 95a4ebf..0000000
--- a/mozilla-sha1/sha1.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is SHA 180-1 Reference Implementation (Compact version)
- *
- * The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
- * Copyright (C) 1995-9 by Cryptography Research, Inc. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- * Paul Kocher
- *
- * Alternatively, the contents of this file may be used under the
- * terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
- * version of this file only under the terms of the GPL and not to
- * allow others to use your version of this file under the MPL,
- * indicate your decision by deleting the provisions above and
- * replace them with the notice and other provisions required by
- * the GPL. If you do not delete the provisions above, a recipient
- * may use your version of this file under either the MPL or the
- * GPL.
- */
-
-#include "sha1.h"
-
-static void shaHashBlock(moz_SHA_CTX *ctx);
-
-void moz_SHA1_Init(moz_SHA_CTX *ctx) {
- int i;
-
- ctx->lenW = 0;
- ctx->sizeHi = ctx->sizeLo = 0;
-
- /* Initialize H with the magic constants (see FIPS180 for constants)
- */
- ctx->H[0] = 0x67452301;
- ctx->H[1] = 0xefcdab89;
- ctx->H[2] = 0x98badcfe;
- ctx->H[3] = 0x10325476;
- ctx->H[4] = 0xc3d2e1f0;
-
- for (i = 0; i < 80; i++)
- ctx->W[i] = 0;
-}
-
-
-void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *_dataIn, int len) {
- const unsigned char *dataIn = _dataIn;
- int i;
-
- /* Read the data into W and process blocks as they get full
- */
- for (i = 0; i < len; i++) {
- ctx->W[ctx->lenW / 4] <<= 8;
- ctx->W[ctx->lenW / 4] |= (unsigned int)dataIn[i];
- if ((++ctx->lenW) % 64 == 0) {
- shaHashBlock(ctx);
- ctx->lenW = 0;
- }
- ctx->sizeLo += 8;
- ctx->sizeHi += (ctx->sizeLo < 8);
- }
-}
-
-
-void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx) {
- unsigned char pad0x80 = 0x80;
- unsigned char pad0x00 = 0x00;
- unsigned char padlen[8];
- int i;
-
- /* Pad with a binary 1 (e.g. 0x80), then zeroes, then length
- */
- padlen[0] = (unsigned char)((ctx->sizeHi >> 24) & 255);
- padlen[1] = (unsigned char)((ctx->sizeHi >> 16) & 255);
- padlen[2] = (unsigned char)((ctx->sizeHi >> 8) & 255);
- padlen[3] = (unsigned char)((ctx->sizeHi >> 0) & 255);
- padlen[4] = (unsigned char)((ctx->sizeLo >> 24) & 255);
- padlen[5] = (unsigned char)((ctx->sizeLo >> 16) & 255);
- padlen[6] = (unsigned char)((ctx->sizeLo >> 8) & 255);
- padlen[7] = (unsigned char)((ctx->sizeLo >> 0) & 255);
- moz_SHA1_Update(ctx, &pad0x80, 1);
- while (ctx->lenW != 56)
- moz_SHA1_Update(ctx, &pad0x00, 1);
- moz_SHA1_Update(ctx, padlen, 8);
-
- /* Output hash
- */
- for (i = 0; i < 20; i++) {
- hashout[i] = (unsigned char)(ctx->H[i / 4] >> 24);
- ctx->H[i / 4] <<= 8;
- }
-
- /*
- * Re-initialize the context (also zeroizes contents)
- */
- moz_SHA1_Init(ctx);
-}
-
-
-#define SHA_ROT(X,n) (((X) << (n)) | ((X) >> (32-(n))))
-
-static void shaHashBlock(moz_SHA_CTX *ctx) {
- int t;
- unsigned int A,B,C,D,E,TEMP;
-
- for (t = 16; t <= 79; t++)
- ctx->W[t] =
- SHA_ROT(ctx->W[t-3] ^ ctx->W[t-8] ^ ctx->W[t-14] ^ ctx->W[t-16], 1);
-
- A = ctx->H[0];
- B = ctx->H[1];
- C = ctx->H[2];
- D = ctx->H[3];
- E = ctx->H[4];
-
- for (t = 0; t <= 19; t++) {
- TEMP = SHA_ROT(A,5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 20; t <= 39; t++) {
- TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 40; t <= 59; t++) {
- TEMP = SHA_ROT(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdc;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 60; t <= 79; t++) {
- TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
-
- ctx->H[0] += A;
- ctx->H[1] += B;
- ctx->H[2] += C;
- ctx->H[3] += D;
- ctx->H[4] += E;
-}
diff --git a/mozilla-sha1/sha1.h b/mozilla-sha1/sha1.h
deleted file mode 100644
index aa48a46..0000000
--- a/mozilla-sha1/sha1.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is SHA 180-1 Header File
- *
- * The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
- * Copyright (C) 1995-9 by Cryptography Research, Inc. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- * Paul Kocher
- *
- * Alternatively, the contents of this file may be used under the
- * terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
- * version of this file only under the terms of the GPL and not to
- * allow others to use your version of this file under the MPL,
- * indicate your decision by deleting the provisions above and
- * replace them with the notice and other provisions required by
- * the GPL. If you do not delete the provisions above, a recipient
- * may use your version of this file under either the MPL or the
- * GPL.
- */
-
-typedef struct {
- unsigned int H[5];
- unsigned int W[80];
- int lenW;
- unsigned int sizeHi,sizeLo;
-} moz_SHA_CTX;
-
-void moz_SHA1_Init(moz_SHA_CTX *ctx);
-void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *dataIn, int len);
-void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx);
-
-#define git_SHA_CTX moz_SHA_CTX
-#define git_SHA1_Init moz_SHA1_Init
-#define git_SHA1_Update moz_SHA1_Update
-#define git_SHA1_Final moz_SHA1_Final
^ permalink raw reply related
* Re: [PATCH] remove ARM and Mozilla SHA1 implementations
From: Johannes Schindelin @ 2009-08-18 0:09 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LFD.2.00.0908171940540.6044@xanadu.home>
Hi,
On Mon, 17 Aug 2009, Nicolas Pitre wrote:
> They are both slower than the new BLK_SHA1 implementation, so it is
> pointless to keep them around.
>
> Signed-off-by: Nicolas Pitre <nico@cam.org>
> ---
>
> Someone else would need to make the call for the PPC version.
If I don't forget, I can test tomorrow on 2 different 32-bit PPCs and
possibly one 64-bit PPC.
Ciao,
Dscho
^ permalink raw reply
* [PATCH v2] remove ARM and Mozilla SHA1 implementations
From: Nicolas Pitre @ 2009-08-18 0:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <alpine.LFD.2.00.0908171940540.6044@xanadu.home>
They are both slower than the new BLK_SHA1 implementation, so it is
pointless to keep them around.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
One reference to mozilla/sha1.c was missing in the initial patch.
Makefile | 26 +------
arm/sha1.c | 82 --------------------
arm/sha1.h | 23 ------
arm/sha1_arm.S | 183 ---------------------------------------------
block-sha1/sha1.c | 6 +-
block-sha1/sha1.h | 6 +-
configure.ac | 10 +--
mozilla-sha1/sha1.c | 151 -------------------------------------
mozilla-sha1/sha1.h | 50 ------------
9 files changed, 11 insertions(+), 526 deletions(-)
diff --git a/Makefile b/Makefile
index f94fe05..4190a5d 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ all::
# when attempting to read from an fopen'ed directory.
#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies MOZILLA_SHA1.
+# This also implies BLK_SHA1.
#
# Define NO_CURL if you do not have libcurl installed. git-http-pull and
# git-http-push are not built, and you cannot use http:// and https://
@@ -91,14 +91,6 @@ all::
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
-# Define ARM_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for ARM.
-#
-# Define MOZILLA_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
-# choice) has very fast version optimized for i586.
-#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
@@ -930,10 +922,6 @@ else
NO_PTHREADS = YesPlease
endif
endif
-ifneq (,$(findstring arm,$(uname_M)))
- ARM_SHA1 = YesPlease
- NO_MKSTEMPS = YesPlease
-endif
-include config.mak.autogen
-include config.mak
@@ -1025,7 +1013,7 @@ ifndef NO_OPENSSL
endif
else
BASIC_CFLAGS += -DNO_OPENSSL
- MOZILLA_SHA1 = 1
+ BLK_SHA1 = 1
OPENSSL_LIBSSL =
endif
ifdef NEEDS_SSL_WITH_CRYPTO
@@ -1182,20 +1170,10 @@ ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
else
-ifdef ARM_SHA1
- SHA1_HEADER = "arm/sha1.h"
- LIB_OBJS += arm/sha1.o arm/sha1_arm.o
-else
-ifdef MOZILLA_SHA1
- SHA1_HEADER = "mozilla-sha1/sha1.h"
- LIB_OBJS += mozilla-sha1/sha1.o
-else
SHA1_HEADER = <openssl/sha.h>
EXTLIBS += $(LIB_4_CRYPTO)
endif
endif
-endif
-endif
ifdef NO_PERL_MAKEMAKER
export NO_PERL_MAKEMAKER
endif
diff --git a/arm/sha1.c b/arm/sha1.c
deleted file mode 100644
index c61ad4a..0000000
--- a/arm/sha1.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SHA-1 implementation optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- */
-
-#include <string.h>
-#include "sha1.h"
-
-extern void arm_sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
-
-void arm_SHA1_Init(arm_SHA_CTX *c)
-{
- c->len = 0;
- c->hash[0] = 0x67452301;
- c->hash[1] = 0xefcdab89;
- c->hash[2] = 0x98badcfe;
- c->hash[3] = 0x10325476;
- c->hash[4] = 0xc3d2e1f0;
-}
-
-void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n)
-{
- uint32_t workspace[80];
- unsigned int partial;
- unsigned long done;
-
- partial = c->len & 0x3f;
- c->len += n;
- if ((partial + n) >= 64) {
- if (partial) {
- done = 64 - partial;
- memcpy(c->buffer + partial, p, done);
- arm_sha_transform(c->hash, c->buffer, workspace);
- partial = 0;
- } else
- done = 0;
- while (n >= done + 64) {
- arm_sha_transform(c->hash, p + done, workspace);
- done += 64;
- }
- } else
- done = 0;
- if (n - done)
- memcpy(c->buffer + partial, p + done, n - done);
-}
-
-void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c)
-{
- uint64_t bitlen;
- uint32_t bitlen_hi, bitlen_lo;
- unsigned int i, offset, padlen;
- unsigned char bits[8];
- static const unsigned char padding[64] = { 0x80, };
-
- bitlen = c->len << 3;
- offset = c->len & 0x3f;
- padlen = ((offset < 56) ? 56 : (64 + 56)) - offset;
- arm_SHA1_Update(c, padding, padlen);
-
- bitlen_hi = bitlen >> 32;
- bitlen_lo = bitlen & 0xffffffff;
- bits[0] = bitlen_hi >> 24;
- bits[1] = bitlen_hi >> 16;
- bits[2] = bitlen_hi >> 8;
- bits[3] = bitlen_hi;
- bits[4] = bitlen_lo >> 24;
- bits[5] = bitlen_lo >> 16;
- bits[6] = bitlen_lo >> 8;
- bits[7] = bitlen_lo;
- arm_SHA1_Update(c, bits, 8);
-
- for (i = 0; i < 5; i++) {
- uint32_t v = c->hash[i];
- hash[0] = v >> 24;
- hash[1] = v >> 16;
- hash[2] = v >> 8;
- hash[3] = v;
- hash += 4;
- }
-}
diff --git a/arm/sha1.h b/arm/sha1.h
deleted file mode 100644
index b61b618..0000000
--- a/arm/sha1.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SHA-1 implementation optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- */
-
-#include <stdint.h>
-
-typedef struct {
- uint64_t len;
- uint32_t hash[5];
- unsigned char buffer[64];
-} arm_SHA_CTX;
-
-void arm_SHA1_Init(arm_SHA_CTX *c);
-void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n);
-void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c);
-
-#define git_SHA_CTX arm_SHA_CTX
-#define git_SHA1_Init arm_SHA1_Init
-#define git_SHA1_Update arm_SHA1_Update
-#define git_SHA1_Final arm_SHA1_Final
diff --git a/arm/sha1_arm.S b/arm/sha1_arm.S
deleted file mode 100644
index 41e9263..0000000
--- a/arm/sha1_arm.S
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * SHA transform optimized for ARM
- *
- * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
- * Created: September 17, 2005
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
- .text
- .globl arm_sha_transform
-
-/*
- * void sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
- *
- * note: the "data" pointer may be unaligned.
- */
-
-arm_sha_transform:
-
- stmfd sp!, {r4 - r8, lr}
-
- @ for (i = 0; i < 16; i++)
- @ W[i] = ntohl(((uint32_t *)data)[i]);
-
-#ifdef __ARMEB__
- mov r4, r0
- mov r0, r2
- mov r2, #64
- bl memcpy
- mov r2, r0
- mov r0, r4
-#else
- mov r3, r2
- mov lr, #16
-1: ldrb r4, [r1], #1
- ldrb r5, [r1], #1
- ldrb r6, [r1], #1
- ldrb r7, [r1], #1
- subs lr, lr, #1
- orr r5, r5, r4, lsl #8
- orr r6, r6, r5, lsl #8
- orr r7, r7, r6, lsl #8
- str r7, [r3], #4
- bne 1b
-#endif
-
- @ for (i = 0; i < 64; i++)
- @ W[i+16] = ror(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 31);
-
- sub r3, r2, #4
- mov lr, #64
-2: ldr r4, [r3, #4]!
- subs lr, lr, #1
- ldr r5, [r3, #8]
- ldr r6, [r3, #32]
- ldr r7, [r3, #52]
- eor r4, r4, r5
- eor r4, r4, r6
- eor r4, r4, r7
- mov r4, r4, ror #31
- str r4, [r3, #64]
- bne 2b
-
- /*
- * The SHA functions are:
- *
- * f1(B,C,D) = (D ^ (B & (C ^ D)))
- * f2(B,C,D) = (B ^ C ^ D)
- * f3(B,C,D) = ((B & C) | (D & (B | C)))
- *
- * Then the sub-blocks are processed as follows:
- *
- * A' = ror(A, 27) + f(B,C,D) + E + K + *W++
- * B' = A
- * C' = ror(B, 2)
- * D' = C
- * E' = D
- *
- * We therefore unroll each loop 5 times to avoid register shuffling.
- * Also the ror for C (and also D and E which are successivelyderived
- * from it) is applied in place to cut on an additional mov insn for
- * each round.
- */
-
- .macro sha_f1, A, B, C, D, E
- ldr r3, [r2], #4
- eor ip, \C, \D
- add \E, r1, \E, ror #2
- and ip, \B, ip, ror #2
- add \E, \E, \A, ror #27
- eor ip, ip, \D, ror #2
- add \E, \E, r3
- add \E, \E, ip
- .endm
-
- .macro sha_f2, A, B, C, D, E
- ldr r3, [r2], #4
- add \E, r1, \E, ror #2
- eor ip, \B, \C, ror #2
- add \E, \E, \A, ror #27
- eor ip, ip, \D, ror #2
- add \E, \E, r3
- add \E, \E, ip
- .endm
-
- .macro sha_f3, A, B, C, D, E
- ldr r3, [r2], #4
- add \E, r1, \E, ror #2
- orr ip, \B, \C, ror #2
- add \E, \E, \A, ror #27
- and ip, ip, \D, ror #2
- add \E, \E, r3
- and r3, \B, \C, ror #2
- orr ip, ip, r3
- add \E, \E, ip
- .endm
-
- ldmia r0, {r4 - r8}
-
- mov lr, #4
- ldr r1, .L_sha_K + 0
-
- /* adjust initial values */
- mov r6, r6, ror #30
- mov r7, r7, ror #30
- mov r8, r8, ror #30
-
-3: subs lr, lr, #1
- sha_f1 r4, r5, r6, r7, r8
- sha_f1 r8, r4, r5, r6, r7
- sha_f1 r7, r8, r4, r5, r6
- sha_f1 r6, r7, r8, r4, r5
- sha_f1 r5, r6, r7, r8, r4
- bne 3b
-
- ldr r1, .L_sha_K + 4
- mov lr, #4
-
-4: subs lr, lr, #1
- sha_f2 r4, r5, r6, r7, r8
- sha_f2 r8, r4, r5, r6, r7
- sha_f2 r7, r8, r4, r5, r6
- sha_f2 r6, r7, r8, r4, r5
- sha_f2 r5, r6, r7, r8, r4
- bne 4b
-
- ldr r1, .L_sha_K + 8
- mov lr, #4
-
-5: subs lr, lr, #1
- sha_f3 r4, r5, r6, r7, r8
- sha_f3 r8, r4, r5, r6, r7
- sha_f3 r7, r8, r4, r5, r6
- sha_f3 r6, r7, r8, r4, r5
- sha_f3 r5, r6, r7, r8, r4
- bne 5b
-
- ldr r1, .L_sha_K + 12
- mov lr, #4
-
-6: subs lr, lr, #1
- sha_f2 r4, r5, r6, r7, r8
- sha_f2 r8, r4, r5, r6, r7
- sha_f2 r7, r8, r4, r5, r6
- sha_f2 r6, r7, r8, r4, r5
- sha_f2 r5, r6, r7, r8, r4
- bne 6b
-
- ldmia r0, {r1, r2, r3, ip, lr}
- add r4, r1, r4
- add r5, r2, r5
- add r6, r3, r6, ror #2
- add r7, ip, r7, ror #2
- add r8, lr, r8, ror #2
- stmia r0, {r4 - r8}
-
- ldmfd sp!, {r4 - r8, pc}
-
-.L_sha_K:
- .word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c
index 464cb25..a1228cf 100644
--- a/block-sha1/sha1.c
+++ b/block-sha1/sha1.c
@@ -1,7 +1,9 @@
/*
- * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.c),
- * optimized to do word accesses rather than byte accesses,
+ * SHA1 routine optimized to do word accesses rather than byte accesses,
* and to avoid unnecessary copies into the context array.
+ *
+ * This was initially based on the Mozilla SHA1 implementation, although
+ * none of the original Mozilla code remains.
*/
#include <string.h>
diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
index c1ae74d..6ff59b2 100644
--- a/block-sha1/sha1.h
+++ b/block-sha1/sha1.h
@@ -1,7 +1,9 @@
/*
- * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.h),
- * optimized to do word accesses rather than byte accesses,
+ * SHA1 routine optimized to do word accesses rather than byte accesses,
* and to avoid unnecessary copies into the context array.
+ *
+ * This was initially based on the Mozilla SHA1 implementation, although
+ * none of the original Mozilla code remains.
*/
typedef struct {
diff --git a/configure.ac b/configure.ac
index 3f1922d..b09b8e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,19 +156,11 @@ AC_MSG_NOTICE([CHECKS for site configuration])
# tests. These tests take up a significant amount of the total test time
# but are not needed unless you plan to talk to SVN repos.
#
-# Define MOZILLA_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
-# choice) has very fast version optimized for i586.
-#
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
-# Define ARM_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for ARM.
-#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies MOZILLA_SHA1.
+# This also implies BLK_SHA1.
#
# Define OPENSSLDIR=/foo/bar if your openssl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
diff --git a/mozilla-sha1/sha1.c b/mozilla-sha1/sha1.c
deleted file mode 100644
index 95a4ebf..0000000
--- a/mozilla-sha1/sha1.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is SHA 180-1 Reference Implementation (Compact version)
- *
- * The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
- * Copyright (C) 1995-9 by Cryptography Research, Inc. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- * Paul Kocher
- *
- * Alternatively, the contents of this file may be used under the
- * terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
- * version of this file only under the terms of the GPL and not to
- * allow others to use your version of this file under the MPL,
- * indicate your decision by deleting the provisions above and
- * replace them with the notice and other provisions required by
- * the GPL. If you do not delete the provisions above, a recipient
- * may use your version of this file under either the MPL or the
- * GPL.
- */
-
-#include "sha1.h"
-
-static void shaHashBlock(moz_SHA_CTX *ctx);
-
-void moz_SHA1_Init(moz_SHA_CTX *ctx) {
- int i;
-
- ctx->lenW = 0;
- ctx->sizeHi = ctx->sizeLo = 0;
-
- /* Initialize H with the magic constants (see FIPS180 for constants)
- */
- ctx->H[0] = 0x67452301;
- ctx->H[1] = 0xefcdab89;
- ctx->H[2] = 0x98badcfe;
- ctx->H[3] = 0x10325476;
- ctx->H[4] = 0xc3d2e1f0;
-
- for (i = 0; i < 80; i++)
- ctx->W[i] = 0;
-}
-
-
-void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *_dataIn, int len) {
- const unsigned char *dataIn = _dataIn;
- int i;
-
- /* Read the data into W and process blocks as they get full
- */
- for (i = 0; i < len; i++) {
- ctx->W[ctx->lenW / 4] <<= 8;
- ctx->W[ctx->lenW / 4] |= (unsigned int)dataIn[i];
- if ((++ctx->lenW) % 64 == 0) {
- shaHashBlock(ctx);
- ctx->lenW = 0;
- }
- ctx->sizeLo += 8;
- ctx->sizeHi += (ctx->sizeLo < 8);
- }
-}
-
-
-void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx) {
- unsigned char pad0x80 = 0x80;
- unsigned char pad0x00 = 0x00;
- unsigned char padlen[8];
- int i;
-
- /* Pad with a binary 1 (e.g. 0x80), then zeroes, then length
- */
- padlen[0] = (unsigned char)((ctx->sizeHi >> 24) & 255);
- padlen[1] = (unsigned char)((ctx->sizeHi >> 16) & 255);
- padlen[2] = (unsigned char)((ctx->sizeHi >> 8) & 255);
- padlen[3] = (unsigned char)((ctx->sizeHi >> 0) & 255);
- padlen[4] = (unsigned char)((ctx->sizeLo >> 24) & 255);
- padlen[5] = (unsigned char)((ctx->sizeLo >> 16) & 255);
- padlen[6] = (unsigned char)((ctx->sizeLo >> 8) & 255);
- padlen[7] = (unsigned char)((ctx->sizeLo >> 0) & 255);
- moz_SHA1_Update(ctx, &pad0x80, 1);
- while (ctx->lenW != 56)
- moz_SHA1_Update(ctx, &pad0x00, 1);
- moz_SHA1_Update(ctx, padlen, 8);
-
- /* Output hash
- */
- for (i = 0; i < 20; i++) {
- hashout[i] = (unsigned char)(ctx->H[i / 4] >> 24);
- ctx->H[i / 4] <<= 8;
- }
-
- /*
- * Re-initialize the context (also zeroizes contents)
- */
- moz_SHA1_Init(ctx);
-}
-
-
-#define SHA_ROT(X,n) (((X) << (n)) | ((X) >> (32-(n))))
-
-static void shaHashBlock(moz_SHA_CTX *ctx) {
- int t;
- unsigned int A,B,C,D,E,TEMP;
-
- for (t = 16; t <= 79; t++)
- ctx->W[t] =
- SHA_ROT(ctx->W[t-3] ^ ctx->W[t-8] ^ ctx->W[t-14] ^ ctx->W[t-16], 1);
-
- A = ctx->H[0];
- B = ctx->H[1];
- C = ctx->H[2];
- D = ctx->H[3];
- E = ctx->H[4];
-
- for (t = 0; t <= 19; t++) {
- TEMP = SHA_ROT(A,5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 20; t <= 39; t++) {
- TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 40; t <= 59; t++) {
- TEMP = SHA_ROT(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdc;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
- for (t = 60; t <= 79; t++) {
- TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6;
- E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
- }
-
- ctx->H[0] += A;
- ctx->H[1] += B;
- ctx->H[2] += C;
- ctx->H[3] += D;
- ctx->H[4] += E;
-}
diff --git a/mozilla-sha1/sha1.h b/mozilla-sha1/sha1.h
deleted file mode 100644
index aa48a46..0000000
--- a/mozilla-sha1/sha1.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is SHA 180-1 Header File
- *
- * The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
- * Copyright (C) 1995-9 by Cryptography Research, Inc. All
- * Rights Reserved.
- *
- * Contributor(s):
- *
- * Paul Kocher
- *
- * Alternatively, the contents of this file may be used under the
- * terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
- * version of this file only under the terms of the GPL and not to
- * allow others to use your version of this file under the MPL,
- * indicate your decision by deleting the provisions above and
- * replace them with the notice and other provisions required by
- * the GPL. If you do not delete the provisions above, a recipient
- * may use your version of this file under either the MPL or the
- * GPL.
- */
-
-typedef struct {
- unsigned int H[5];
- unsigned int W[80];
- int lenW;
- unsigned int sizeHi,sizeLo;
-} moz_SHA_CTX;
-
-void moz_SHA1_Init(moz_SHA_CTX *ctx);
-void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *dataIn, int len);
-void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx);
-
-#define git_SHA_CTX moz_SHA_CTX
-#define git_SHA1_Init moz_SHA1_Init
-#define git_SHA1_Update moz_SHA1_Update
-#define git_SHA1_Final moz_SHA1_Final
^ permalink raw reply related
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Jakub Narebski @ 2009-08-18 0:17 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: skillzero, Junio C Hamano, Nguyen Thai Ngoc Duy, git
In-Reply-To: <alpine.DEB.1.00.0908180111340.8306@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
> The thing is: we need a way to determine quickly and without any
> ambiguity whether a file is tracked, assumed unchanged, or sparse'd-out
> (which Nguyễn calls no-checkout).
Let's reiterate: "assume-unchanged" is about telling git that it should
assume for performance reasons that state of file in working directory
is the same as state of file in the index. But, from what was said in
this thread, there are situations where git for correctness reasons
ignores performance hack.
"no-checkout" bit is about telling git that the file is not present
in working directory, and it has to use version from the index. Then
there is a question if there is file in working area (e.g. from applying
patch) which corresponds to a "no-checkout" file in index (corresponds
because of rename detection).
> And if we change .git/info/sparse, that state _must not_ change. We did
> not touch the file by editing .git/info/sparse, so the state must be
> unchanged.
I think this situation (and the issue of correctness vs "assume-unchanged"
mentioned above) hints that "no-checkout" and "assume-unchanged" should
be separate bits, even if both tell git to use version from index.
There is e.g. question if "git grep" should search "no-checkout" files;
in the "assume-unchanged" case it should, I think, search index version.
P.S. I wonder if it would be worth resurrecting series adding support
for directories in index (which can help performance and 'empty
directories' issue)... It would help, I think, with sparse checkout.
--
Jakub Narebski
Poland
^ permalink raw reply
* [PATCH] block-sha1: make the size member first in the context struct
From: Nicolas Pitre @ 2009-08-18 0:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This is a 64-bit value, hence having it first provides a better
alignment.
Signed-off-by: Nicolas Pitre <nico@cam.org>
diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
index 6ff59b2..b864df6 100644
--- a/block-sha1/sha1.h
+++ b/block-sha1/sha1.h
@@ -7,9 +7,9 @@
*/
typedef struct {
+ unsigned long long size;
unsigned int H[5];
unsigned int W[16];
- unsigned long long size;
} blk_SHA_CTX;
void blk_SHA1_Init(blk_SHA_CTX *ctx);
^ permalink raw reply related
* Re: [PATCH] block-sha1: make the size member first in the context struct
From: Johannes Schindelin @ 2009-08-18 0:24 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LFD.2.00.0908172012591.6044@xanadu.home>
Hi,
On Mon, 17 Aug 2009, Nicolas Pitre wrote:
> This is a 64-bit value, hence having it first provides a better
> alignment.
>
> Signed-off-by: Nicolas Pitre <nico@cam.org>
>
> diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
> index 6ff59b2..b864df6 100644
> --- a/block-sha1/sha1.h
> +++ b/block-sha1/sha1.h
> @@ -7,9 +7,9 @@
> */
>
> typedef struct {
> + unsigned long long size;
> unsigned int H[5];
> unsigned int W[16];
> - unsigned long long size;
> } blk_SHA_CTX;
By the reasoning suggested in the commit message, should H[5] not go to
the end?
Ciao,
Dscho
^ permalink raw reply
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: skillzero @ 2009-08-18 0:23 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Junio C Hamano, Jakub Narebski, Nguyen Thai Ngoc Duy, git
In-Reply-To: <alpine.DEB.1.00.0908180111340.8306@pacific.mpi-cbg.de>
On Mon, Aug 17, 2009 at 4:16 PM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 17 Aug 2009, skillzero@gmail.com wrote:
>
>> On Mon, Aug 17, 2009 at 3:02 PM, Johannes
>> Schindelin<Johannes.Schindelin@gmx.de> wrote:
>>
>> > And here comes the problem: if something is treated untracked because
>> > it was outside of the sparse checkout, then I want it to be treated as
>> > untracked _even if_ I happened to broaden the checkout by editing
>> > .git/info/sparse. The file did not just magically become subject to
>> > overwriting just because I edited .git/info/sparse (which could be a
>> > simple mistake).
>>
>> Maybe I'm misunderstanding what you're saying, but why would you want a
>> file that's become part of the checkout by editing .git/info/sparse to
>> still be treated as untracked?
>>
>> If I have a file on that's excluded via .git/info/sparse then I edit
>> .git/info/sparse to include it and switch to a branch that doesn't have
>> that file, I'd expect that file to be deleted from the working copy if
>> the content matches what's in the repository. If it's modified then I'd
>> expect the branch switch to fail (like it would without a sparse
>> checkout).
>
> First things first: with sparse checkout, you should not check out
> _anything_ outside of the focus of the sparse checkout.
>
> So I contend that you would only end up with a sparse'd-out file
> that was formerly tracked if you did something wrong. That should not
> happen.
I was thinking if you copied the file there manually and changed
.git/info/sparse to include it. I would expect git checkout, git
status, etc. to act as just as if I had never excluded it via
.git/info/sparse, similar to .gitignore and .git/info/exclude.
> The thing is: we need a way to determine quickly and without any
> ambiguity whether a file is tracked, assumed unchanged, or sparse'd-out
> (which Nguyễn calls no-checkout).
>
> And if we change .git/info/sparse, that state _must not_ change. We did
> not touch the file by editing .git/info/sparse, so the state must be
> unchanged.
I don't know enough to have an opinion on assume-unchanged vs
no-checkout, but if you edit .git/info/sparse it seems like it should
affect whether git cares about a file or not. If a file previously had
the no-checkout bit and you change .git/info/sparse to include the
file, the next time you do something with git, I would expect it to
start caring about that path. For example, I can edit .gitignore and
.git/info/exclude and it notices the next time I use git without
having to do anything special.
^ permalink raw reply
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: skillzero @ 2009-08-18 0:34 UTC (permalink / raw)
To: Jakub Narebski
Cc: Johannes Schindelin, Junio C Hamano, Nguyen Thai Ngoc Duy, git
In-Reply-To: <200908180217.35963.jnareb@gmail.com>
On Mon, Aug 17, 2009 at 5:17 PM, Jakub Narebski<jnareb@gmail.com> wrote:
> There is e.g. question if "git grep" should search "no-checkout" files;
> in the "assume-unchanged" case it should, I think, search index version.
I would like it to git grep to not search paths outside the sparse
area (although --no-sparse would be nice for git grep in case you did
want to search everything). The main reason I want sparse checkouts is
for performance reasons. For example, git grep can take 10 minutes on
my full repository so excluding paths outside the sparse area would
reduce that to a few seconds.
^ permalink raw reply
* Re: [PATCH] block-sha1: make the size member first in the context struct
From: Nicolas Pitre @ 2009-08-18 0:39 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0908180223280.8306@pacific.mpi-cbg.de>
On Tue, 18 Aug 2009, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 17 Aug 2009, Nicolas Pitre wrote:
>
> > This is a 64-bit value, hence having it first provides a better
> > alignment.
> >
> > Signed-off-by: Nicolas Pitre <nico@cam.org>
> >
> > diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h
> > index 6ff59b2..b864df6 100644
> > --- a/block-sha1/sha1.h
> > +++ b/block-sha1/sha1.h
> > @@ -7,9 +7,9 @@
> > */
> >
> > typedef struct {
> > + unsigned long long size;
> > unsigned int H[5];
> > unsigned int W[16];
> > - unsigned long long size;
> > } blk_SHA_CTX;
>
> By the reasoning suggested in the commit message, should H[5] not go to
> the end?
Both arrays are based of unsigned ints which have the same alignment
rules. Furthermore the size and H members are much more used than the W
member, and keeping them close should help with CPU cache locality.
Nicolas
^ permalink raw reply
* [RFCv4 7/5] More fixes to the git-remote-cvs installation procedure
From: Johan Herland @ 2009-08-18 0:41 UTC (permalink / raw)
To: gitster; +Cc: git, Johannes.Schindelin, barkalow, davvid
In-Reply-To: <1250480161-21933-1-git-send-email-johan@herland.net>
- Makefile: Make sure git-remote-cvs is rebuilt when 'prefix' changes
(by adding a dependency on GIT-CFLAGS). This prevents a regular 'make'
followed by a 'make prefix=/somewhere/else install' from installing a
non-working git-remote-cvs.
- Makefile: When mangling git-remote-cvs to add the git_remote_cvs install
location to the Python search path, _replace_ the initial 'current dir'
entry in sys.path (instead of merely prepending the install location).
Hence, if the git_remote_cvs package is not installed at the correct
location (and also not present in any of Python's default package dirs),
then git-remote-cvs will fail loudly instead of silently falling back on
the git_remote_cvs subdir in git.git.
- Allow for the git_remote_cvs install path to be overridden by the
$GITPYTHONLIB environment variable.
- t/test-lib.sh: Set $GITPYTHONLIB (unless $GIT_TEST_INSTALLED is enabled)
so that we test the currently built version of git_remote_cvs (the one
that is built in git_remote_cvs/build/lib) instead of a previously
installed version.
- Another minor check and a line length fix.
Found-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
---
On Monday 17 August 2009, Junio C Hamano wrote:
> With your Makefile patch the test still failed. It turns out that I had
> a broken version from the previous round installed in my PATH, and the
> test failed until I removed the faulty ones manually from the installed
> location. This is not good.
>
> While running tests, we really should import from the build directory,
> preferrably ignoring the installed directory but at least giving
> precedence to the build directory over the installed directory, to avoid
> problems like this.
Agreed. This patch puts the build directory first in Python's search path
when running the testsuite (unless $GIT_TEST_INSTALLED is enabled). The
install directory is ignored (unless the install dir happens to be in
Python's default search path, in which case the build dir will still have
precedence).
> In my case, it was a "bad installed version masking the version we are
> testing", but a more problematic would be the other way around. If you
> have a good version installed, and if somebody breaks it in the updated
> source, "make test" won't catch the breakage and then you "make install"
> a broken version without noticing.
Yes. This is also taken care of in this patch ('make test' sets
$GITPYTHONLIB, which forces git-remote-cvs to look for its package
in the build dir instead of the install dir).
This patch (and the previous 6/5) will be folded into the next iteration
of the jh/cvs-helper patch series.
...Johan
Makefile | 11 +++++++++--
t/test-lib.sh | 9 +++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b9a7f25..1d7bf80 100644
--- a/Makefile
+++ b/Makefile
@@ -1477,13 +1477,20 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
endif # NO_PERL
ifndef NO_PYTHON
+$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
$(QUIET_GEN)$(RM) $@ $@+ && \
- INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_cvs -s --no-print-directory prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' instlibdir` && \
+ INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_cvs -s \
+ --no-print-directory prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' \
+ instlibdir` && \
sed -e '1{' \
-e ' s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
-e '}' \
- -e 's|^import sys.*|&; sys.path.insert(0, "@@INSTLIBDIR@@")|' \
+ -e 's|^import sys.*|&; \\\
+ import os; \\\
+ sys.path[0] = os.environ.has_key("GITPYTHONLIB") and \\\
+ os.environ["GITPYTHONLIB"] or \\\
+ "@@INSTLIBDIR@@"|' \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
$@.py >$@+ && \
chmod +x $@+ && \
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 01ea386..a7fbfef 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -638,6 +638,15 @@ test -d ../templates/blt || {
error "You haven't built things yet, have you?"
}
+if test -z "$GIT_TEST_INSTALLED"
+then
+ GITPYTHONLIB="$(pwd)/../git_remote_cvs/build/lib"
+ export GITPYTHONLIB
+ test -d ../git_remote_cvs/build || {
+ error "You haven't built git_remote_cvs yet, have you?"
+ }
+fi
+
if ! test -x ../test-chmtime; then
echo >&2 'You need to build test-chmtime:'
echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
--
1.6.4.304.g1365c.dirty
^ permalink raw reply related
* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Jakub Narebski @ 2009-08-18 0:49 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: skillzero, Junio C Hamano, Nguyen Thai Ngoc Duy, git
In-Reply-To: <200908180217.35963.jnareb@gmail.com>
Jakub Narebski wrote:
> Johannes Schindelin wrote:
>
> > The thing is: we need a way to determine quickly and without any
> > ambiguity whether a file is tracked, assumed unchanged, or sparse'd-out
> > (which Nguyễn calls no-checkout).
>
> Let's reiterate: "assume-unchanged" is about telling git that it should
> assume for performance reasons that state of file in working directory
> is the same as state of file in the index. But, from what was said in
> this thread, there are situations where git for correctness reasons
> ignores performance hack.
>
> "no-checkout" bit is about telling git that the file is not present
> in working directory, and it has to use version from the index. Then
> there is a question if there is file in working area (e.g. from applying
> patch) which corresponds to a "no-checkout" file in index (corresponds
> because of rename detection).
Also there is a question if one might want to use them together. I think
it is not inconceivable ;-) One might want for example to limit checkout
to some subdirectory, but within that directory one might want to use
assume-unchanged bit, because filesystem performance sucks (FAT, NFS).
Now couple that with changing in sparse patterns...
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] git submodule foreach: Provide access to submodule name, as '$name'
From: Mark Levedahl @ 2009-08-18 0:54 UTC (permalink / raw)
To: Johan Herland; +Cc: Junio C Hamano, Git Mailing List, Lars Hjemli
In-Reply-To: <200908160310.08459.johan@herland.net>
Johan Herland wrote:
> The argument to 'git submodule foreach' already has access to the variables
> '$path' (the path to the submodule, relative to the superproject) and '$sha1'
> (the submodule commit recorded by the superproject).
>
> This patch adds another variable -- '$name' -- which contains the name of the
> submodule, as recorded in the superproject's .gitmodules file.
>
> Signed-off-by: Johan Herland <johan@herland.net>
> ---
>
This patch *looks* ok to me, but I'm out of the office for most of
August so I cannot actually test this code for another couple of weeks.
Mark
^ permalink raw reply
* Re: [msysGit] Re: Using VC build git (split patch)
From: Frank Li @ 2009-08-18 1:07 UTC (permalink / raw)
To: Marius Storm-Olsen; +Cc: git, msysGit, Johannes Schindelin
In-Reply-To: <4A899FDB.8080308@gmail.com>
> Hi Frank,
>
> Could you please also update your repo at repo.or.cz, then it'll be
> easier if anyone wants to help you in the process of streamlining the
> patch series?
>
It seems network problem yesterday, I can't push anything to
repo.or.cz. I will try today.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox