[PATCH] t1410: Fix for case insensitive filesystems

2014-11-09 Thread Brian Gernhardt
A pair of recently added tests used branches a and a/b, but earlier
tests created files A and A/B.  On case insensitive filesystems (such
as HFS+), that causes git to complain about the name being ambiguous
between branch and file.  Resolve by renaming the branches to aa and
aa/bb.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t1410-reflog.sh | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 976c1d4..ac31e19 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -254,36 +254,36 @@ test_expect_success 'checkout should not delete log for 
packed ref' '
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
-   test_when_finished git branch -d a || git branch -d a/b 
+   test_when_finished git branch -d aa || git branch -d aa/bb 
 
-   git branch a/b master 
-   echo a/b@{0} branch: Created from master expect 
-   git log -g --format=%gd %gs a/b actual 
+   git branch aa/bb master 
+   echo aa/bb@{0} branch: Created from master expect 
+   git log -g --format=%gd %gs aa/bb actual 
test_cmp expect actual 
-   git branch -d a/b 
+   git branch -d aa/bb 
 
-   # now logs/refs/heads/a is a stale directory, but
-   # we should move it out of the way to create a reflog
-   git branch a master 
-   echo a@{0} branch: Created from master expect 
-   git log -g --format=%gd %gs a actual 
+   # now logs/refs/heads/aa is a stale directory, but
+   # we should move it out of the way to create aa reflog
+   git branch aa master 
+   echo aa@{0} branch: Created from master expect 
+   git log -g --format=%gd %gs aa actual 
test_cmp expect actual
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
-   test_when_finished git branch -d a || git branch -d a/b 
+   test_when_finished git branch -d aa || git branch -d aa/bb 
 
-   git branch a/b master 
-   echo a/b@{0} branch: Created from master expect 
-   git log -g --format=%gd %gs a/b actual 
+   git branch aa/bb master 
+   echo aa/bb@{0} branch: Created from master expect 
+   git log -g --format=%gd %gs aa/bb actual 
test_cmp expect actual 
-   git branch -d a/b 
+   git branch -d aa/bb 
 
-   # same as before, but we only create a reflog for a if
+   # same as before, but we only create a reflog for aa if
# it already exists, which it does not
-   git -c core.logallrefupdates=false branch a master 
+   git -c core.logallrefupdates=false branch aa master 
: expect 
-   git log -g --format=%gd %gs a actual 
+   git log -g --format=%gd %gs aa actual 
test_cmp expect actual
 '
 
-- 
2.2.0.rc0.209.g31b9a22

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Receive-pack: include entire SHA1 in nonce

2014-09-25 Thread Brian Gernhardt
clang gives the following warning:

builtin/receive-pack.c:327:35: error: sizeof on array function
parameter will return size of 'unsigned char *' instead of 'unsigned
char [20]' [-Werror,-Wsizeof-array-argument]
git_SHA1_Update(ctx, out, sizeof(out));
 ^
builtin/receive-pack.c:292:37: note: declared here
static void hmac_sha1(unsigned char out[20],
^
---

 I dislike changing sizeof to a magic constant, but clang informs me that
 sizeof is doing the wrong thing.  Perhaps there's an appropriate constant
 #defined in the code somewhere?

 builtin/receive-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index aab3df7..92388e5 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -324,7 +324,7 @@ static void hmac_sha1(unsigned char out[20],
/* RFC 2104 2. (6)  (7) */
git_SHA1_Init(ctx);
git_SHA1_Update(ctx, k_opad, sizeof(k_opad));
-   git_SHA1_Update(ctx, out, sizeof(out));
+   git_SHA1_Update(ctx, out, 20);
git_SHA1_Final(out, ctx);
 }
 
-- 
2.1.1.445.gb8dfbef.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Receive-pack: include entire SHA1 in nonce

2014-09-25 Thread Brian Gernhardt
On Sep 25, 2014, at 1:54 PM, Junio C Hamano gits...@pobox.com wrote:

 Junio C Hamano gits...@pobox.com writes:
 
 I am not happy with this version, either, though, because now we
 have an uninitialized piece of memory at the end of sha1[20] of the
 caller, which is given to sha1_to_hex() to produce garbage.  It is
 discarded by %.*s format so there is no negative net effect, but I
 suspect that the compiler would not see that through.
 
 ... and if we want to fix that, we would end up with a set of
 changes, somewhat ugly like this.
 
 Which might be an improvement, but let's start with your sizeof(arg)
 is the size of a pointer, even when the definition of arg[] is
 spelled with bra-ket, a dummy maintainer! fix.
 
 I'd like to have your sign-off.  I'd also prefer to retitle it as
 something like hmac_sha1: copy the entire SHA-1 hash out, as it is
 deliberate that we do not include the entire SHA-1 in nonce.

It's been long enough since I've done any crypto, so I didn't really know what 
the algorithm should look like.  Mostly I remember doing it right is hard, so 
don't feel too bad.  Making the commit message accurate is perfectly fine, and 
all the patches you've posted look right at first glance (and to make test as 
well), so I'm fine with a 

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com

attached to whatever commit is actually appropriate instead of the minimum to 
make my compiler happy.  :-)

~~ Brian

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] t7510: Skip all if GPG isn't installed

2014-06-23 Thread Brian Gernhardt
Since the setup requires the GPG prerequisite, it doesn't make much
sense to try and run any tests without it.  So rather than using a
prereq on each individual test and possibly forgetting it on new ones
(as just happened), skip the entire file if GPG isn't found.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t7510-signed-commit.sh | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 9810242..414f9d1 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -4,7 +4,13 @@ test_description='signed commit tests'
 . ./test-lib.sh
 . $TEST_DIRECTORY/lib-gpg.sh
 
-test_expect_success GPG 'create signed commits' '
+if ! test_have_prereq GPG
+then
+   skip_all='skipping signed commit tests; gpg not available'
+   test_done
+fi
+
+test_expect_success 'create signed commits' '
test_when_finished test_unconfig commit.gpgsign 
 
echo 1 file  git add file 
@@ -48,7 +54,7 @@ test_expect_success GPG 'create signed commits' '
git tag eighth-signed-alt
 '
 
-test_expect_success GPG 'show signatures' '
+test_expect_success 'show signatures' '
(
for commit in initial second merge fourth-signed fifth-signed 
sixth-signed seventh-signed
do
@@ -79,7 +85,7 @@ test_expect_success GPG 'show signatures' '
)
 '
 
-test_expect_success GPG 'detect fudged signature' '
+test_expect_success 'detect fudged signature' '
git cat-file commit seventh-signed raw 
 
sed -e s/seventh/7th forged/ raw forged1 
@@ -89,7 +95,7 @@ test_expect_success GPG 'detect fudged signature' '
! grep Good signature from actual1
 '
 
-test_expect_success GPG 'detect fudged signature with NUL' '
+test_expect_success 'detect fudged signature with NUL' '
git cat-file commit seventh-signed raw 
cat raw forged2 
echo Qwik | tr Q \000 forged2 
@@ -99,7 +105,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
! grep Good signature from actual2
 '
 
-test_expect_success GPG 'amending already signed commit' '
+test_expect_success 'amending already signed commit' '
git checkout fourth-signed^0 
git commit --amend -S --no-edit 
git show -s --show-signature HEAD actual 
@@ -107,7 +113,7 @@ test_expect_success GPG 'amending already signed commit' '
! grep BAD signature from actual
 '
 
-test_expect_success GPG 'show good signature with custom format' '
+test_expect_success 'show good signature with custom format' '
cat expect -\EOF 
G
13B6F51ECDDE430D
@@ -117,7 +123,7 @@ test_expect_success GPG 'show good signature with custom 
format' '
test_cmp expect actual
 '
 
-test_expect_success GPG 'show bad signature with custom format' '
+test_expect_success 'show bad signature with custom format' '
cat expect -\EOF 
B
13B6F51ECDDE430D
@@ -127,7 +133,7 @@ test_expect_success GPG 'show bad signature with custom 
format' '
test_cmp expect actual
 '
 
-test_expect_success GPG 'show unknown signature with custom format' '
+test_expect_success 'show unknown signature with custom format' '
cat expect -\EOF 
U
61092E85B7227189
@@ -137,7 +143,7 @@ test_expect_success GPG 'show unknown signature with custom 
format' '
test_cmp expect actual
 '
 
-test_expect_success GPG 'show lack of signature with custom format' '
+test_expect_success 'show lack of signature with custom format' '
cat expect -\EOF 
N
 
-- 
2.0.0.495.gf681aa8

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Use long for timezone in pretty.c:show_ident_date()

2014-03-07 Thread Brian Gernhardt
The value is parsed with strtol and compared against LONG_MIN and
LONG_MAX, which doesn't make much sense for an int.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 pretty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pretty.c b/pretty.c
index 3b811ed..29ebc4f 100644
--- a/pretty.c
+++ b/pretty.c
@@ -397,7 +397,7 @@ static const char *show_ident_date(const struct ident_split 
*ident,
   enum date_mode mode)
 {
unsigned long date = 0;
-   int tz = 0;
+   long tz = 0;
 
if (ident-date_begin  ident-date_end)
date = strtoul(ident-date_begin, NULL, 10);
-- 
1.9.0.281.gfc51f0a.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Ensure __BYTE_ORDER is always set

2014-01-30 Thread Brian Gernhardt
a201c20 (ewah: support platforms that require aligned reads) added a
reliance on the existence of __BYTE_ORDER and __BIG_ENDIAN.  However,
these macros are spelled without the leading __ on some platforms (OS
X at least).  In this case, the endian-swapping code was added even
when unnecessary, which caused assertion failures in
t5310-pack-bitmaps.sh as the code that used the bitmap would read past
the end.

We already had code to handle this case in compat/bswap.h, but it was
only used if we couldn't already find a reasonable version of bswap64.
Move the macro-defining and checking code out of a conditional so that
either __BYTE_ORDER is defined or we get a compilation error instead
of a runtime error in the bitmap code.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 compat/bswap.h | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/compat/bswap.h b/compat/bswap.h
index 120c6c1..7db09d6 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -80,6 +80,18 @@ static inline uint64_t git_bswap64(uint64_t x)
 
 #endif
 
+#if !defined(__BYTE_ORDER)
+# if defined(BYTE_ORDER)  defined(LITTLE_ENDIAN)  defined(BIG_ENDIAN)
+#  define __BYTE_ORDER BYTE_ORDER
+#  define __LITTLE_ENDIAN LITTLE_ENDIAN
+#  define __BIG_ENDIAN BIG_ENDIAN
+# endif
+#endif
+
+#if !defined(__BYTE_ORDER)
+# error Cannot determine endianness
+#endif
+
 #if defined(bswap32)
 
 #undef ntohl
@@ -101,18 +113,6 @@ static inline uint64_t git_bswap64(uint64_t x)
 #undef ntohll
 #undef htonll
 
-#if !defined(__BYTE_ORDER)
-# if defined(BYTE_ORDER)  defined(LITTLE_ENDIAN)  defined(BIG_ENDIAN)
-#  define __BYTE_ORDER BYTE_ORDER
-#  define __LITTLE_ENDIAN LITTLE_ENDIAN
-#  define __BIG_ENDIAN BIG_ENDIAN
-# endif
-#endif
-
-#if !defined(__BYTE_ORDER)
-# error Cannot determine endianness
-#endif
-
 #if __BYTE_ORDER == __BIG_ENDIAN
 # define ntohll(n) (n)
 # define htonll(n) (n)
-- 
1.9.rc0.256.gbc3fa69

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Ensure __BYTE_ORDER is always set

2014-01-30 Thread Brian Gernhardt
[Re-send to include the list. Meant to hit reply all, not just reply.]

 On Jan 30, 2014, at 3:45 PM, Jeff King p...@peff.net wrote:
 
 I do find the failure mode interesting. The endian-swapping code kicked
 in when it did not, meaning your are on a big-endian system. Is this on
 an ancient PPC Mac? Or is the problem that the code did not kick in when
 it should?

Erm.  I was perhaps writing my analysis too quickly.  I was running on a x86_64 
Mac, so it wasn't included when it was supposed to be.  Or whichever you said 
that I didn't.  ;-)

 Either way, we should perhaps be more careful in the bitmap code, too,
 that the values we get are sensible. It's better to die(your bitmap is
 broken) than to read off the end of the array. I can't seem to trigger
 the same failure mode, though. On my x86 system, turning off the
 endian-swap (i.e., the opposite of what should happen) makes t5310 fail,
 but it is because we end up trying to set the bit very far into a
 dynamic bitfield, and die allocating memory.

To be more specific, I hit an assertion failure at in ewah_iterator_next() 
(ewah/ewah_bitmap.c:355) when running `git rev-list --test-bitmap HEAD` (and 
others if I don't have it die immediately).  That seems to me that there is a 
check to ensure it doesn't run off the end.  Perhaps you have assertions 
disabled so hit an error somewhere else?

~~ Brian Gernhardt

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] t5570: Update for symref capability

2013-10-21 Thread Brian Gernhardt
git-daemon now uses the symref capability to send the correct HEAD
reference, so the test for that in t5570 now passes.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t5570-git-daemon.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index f01edff..dc55e51 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -37,7 +37,7 @@ test_expect_success 'fetch changes via git protocol' '
test_cmp file clone/file
 '
 
-test_expect_failure 'remote detects correct HEAD' '
+test_expect_success 'remote detects correct HEAD' '
git push public master:other 
(cd clone 
 git remote set-head -d origin 
-- 
1.8.3.4 (Apple Git-47)

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] t5570: Update for clone-progress-to-stderr branch

2013-10-21 Thread Brian Gernhardt
git clone now reports its progress to standard error, which throws off
t5570.  Using test_i18ngrep instead of test_cmp allows the test to be
more flexible by only looking for the expected error and ignoring any
other output from the program.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t5570-git-daemon.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index dc55e51..e061468 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -122,8 +122,7 @@ test_remote_error()
fi
 
test_must_fail git $cmd $GIT_DAEMON_URL/$repo $@ 2output 
-   echo fatal: remote error: $msg: /$repo expect 
-   test_cmp expect output
+   test_i18ngrep fatal: remote error: $msg: /$repo output 
ret=$?
chmod +x $GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git
(exit $ret)
-- 
1.8.3.4 (Apple Git-47)

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


t3010 broken by 2eac2a4

2013-08-21 Thread Brian Gernhardt
With 2eac2a4: ls-files -k: a directory only can be killed if the index has a 
non-directory applied, t3010 fails test 3 validate git ls-files -k output.  
It ends up missing the pathx/ju/nk file.

OS X 10.8.4
Xcode 4.6.3
clang Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) 

~~ Brian Gernhardt

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Fixes for OS X

2013-08-05 Thread Brian Gernhardt
A few changes recently broke my build on Mac 10.8, possibly because I have a
more strict set of warnings/errors enabled.  The first two handle minor
problems with the use of APPLE_COMMON_CRYPTO, which was expanded for use in
imap-send but had a couple of problems.

The last is likely due to curl version skew between Dave Borowitz and myself.
(see 912b2ac).

There are a few notes on the patches indicating where I was less than sure
about my solutions.

Brian Gernhardt (3):
  Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1
  OS X: Fix redeclaration of die warning
  t5551: Remove header from curl cookie file

 Makefile  |  4 +++-
 git-compat-util.h | 20 ++--
 t/t5551-http-fetch.sh |  6 ++
 3 files changed, 15 insertions(+), 15 deletions(-)

-- 
1.8.4.rc1.384.g0976a17.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1

2013-08-05 Thread Brian Gernhardt
It used to be that APPLE_COMMON_CRYPTO did nothing when BLK_SHA1 was
set.  But APPLE_COMMON_CRYPTO is now used for more than just SHA1 (see
3ef2bca) so make sure that the appropriate libraries are always set.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 82f2e22..7051956 100644
--- a/Makefile
+++ b/Makefile
@@ -1182,6 +1182,9 @@ ifdef NEEDS_SSL_WITH_CRYPTO
 else
LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
 endif
+ifdef APPLE_COMMON_CRYPTO
+   LIB_4_CRYPTO += -framework Security -framework CoreFoundation
+endif
 endif
 ifdef NEEDS_LIBICONV
ifdef ICONVDIR
@@ -1413,7 +1416,6 @@ ifdef PPC_SHA1
LIB_H += ppc/sha1.h
 else
 ifdef APPLE_COMMON_CRYPTO
-   LIB_4_CRYPTO += -framework Security -framework CoreFoundation
COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
SHA1_HEADER = CommonCrypto/CommonDigest.h
 else
-- 
1.8.4.rc1.384.g0976a17.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] t5551: Remove header from curl cookie file

2013-08-05 Thread Brian Gernhardt
The URL included in the header appears to vary from curl version to
curl version.  Since we only care about the final few lines, only test
them.  However, make sure the blank line after the header is still
included to make sure there are no extra cookie lines.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---

 I suppose a sed invocation to strip out the URL or comments might be better,
 but this seemed simpler.

 t/t5551-http-fetch.sh | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index 287d22b..8196af1 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -191,9 +191,6 @@ cat cookies.txt EOF
 127.0.0.1  FALSE   /smart_cookies/ FALSE   0   othername   
othervalue
 EOF
 cat expect_cookies.txt EOF
-# Netscape HTTP Cookie File
-# http://curl.haxx.se/docs/http-cookies.html
-# This file was generated by libcurl! Edit at your own risk.
 
 127.0.0.1  FALSE   /smart_cookies/ FALSE   0   othername   
othervalue
 127.0.0.1  FALSE   /smart_cookies/repo.git/info/   FALSE   0   name
value
@@ -202,7 +199,8 @@ test_expect_success 'cookies stored in http.cookiefile when 
http.savecookies set
git config http.cookiefile cookies.txt 
git config http.savecookies true 
git ls-remote $HTTPD_URL/smart_cookies/repo.git master 
-   test_cmp expect_cookies.txt cookies.txt
+   tail -3 cookies.txt  cookies_tail.txt
+   test_cmp expect_cookies.txt cookies_tail.txt
 '
 
 test -n $GIT_TEST_LONG  test_set_prereq EXPENSIVE
-- 
1.8.4.rc1.384.g0976a17.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] OS X: Fix redeclaration of die warning

2013-08-05 Thread Brian Gernhardt
compat/apple-common-crypto.h uses die() in one of its macros, but was
included in git-compat-util.h before the definition of die.

Fix by simply moving the relevant block after the die/error/warning
declarations.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---

 Not sure if this is the best place to move it to, but it's the earliest it can
 be in the file without causing errors.  (Namely that clang has to guess what
 die() means in apple-common-crypto.h and guesses differently than the actual
 definition.)

 git-compat-util.h | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index af5f6bb..d60e28d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -129,16 +129,6 @@
 #include poll.h
 #endif
 
-#ifndef NO_OPENSSL
-#ifdef APPLE_COMMON_CRYPTO
-#include compat/apple-common-crypto.h
-#else
-#include openssl/evp.h
-#include openssl/hmac.h
-#endif /* APPLE_COMMON_CRYPTO */
-#include openssl/x509v3.h
-#endif /* NO_OPENSSL */
-
 #if defined(__MINGW32__)
 /* pull in Windows compatibility stuff */
 #include compat/mingw.h
@@ -340,6 +330,16 @@ extern NORETURN void die_errno(const char *err, ...) 
__attribute__((format (prin
 extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
 extern void warning(const char *err, ...) __attribute__((format (printf, 1, 
2)));
 
+#ifndef NO_OPENSSL
+#ifdef APPLE_COMMON_CRYPTO
+#include compat/apple-common-crypto.h
+#else
+#include openssl/evp.h
+#include openssl/hmac.h
+#endif /* APPLE_COMMON_CRYPTO */
+#include openssl/x509v3.h
+#endif /* NO_OPENSSL */
+
 /*
  * Let callers be aware of the constant return value; this can help
  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
-- 
1.8.4.rc1.384.g0976a17.dirty

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] t0008: avoid SIGPIPE race condition on fifo

2013-07-12 Thread Brian Gernhardt

On Jul 12, 2013, at 6:35 AM, Jeff King p...@peff.net wrote:

 Subject: [PATCH] t0008: avoid SIGPIPE race condition on fifo

Was able to complete a prove run with this patch.  Many thanks.

~~ Brian
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: t0008 hang on streaming test (OS X)

2013-07-11 Thread Brian Gernhardt

On Jul 11, 2013, at 9:34 AM, Jeff King p...@peff.net wrote:

 On Wed, Jul 10, 2013 at 12:36:40PM -0400, Brian Gernhardt wrote:
 
 The newest test in t0008 streaming support for --stdin,

 Experimentation has led me to find that it is hanging when trying to read 
 the 2nd response from check-ignore.


 Do you know which test it is hanging on? You mentioned that you can
 replicate it outside of prove; what does running with -v say?
 
 The last test in t0008, with the fifos, would make me the most
 suspicious.

The 2nd `read response out` line is where it was hanging, based on a variety 
of echos added to the test.

~~ Brian

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: t0008 hang on streaming test (OS X)

2013-07-11 Thread Brian Gernhardt

On Jul 10, 2013, at 4:35 PM, Antoine Pelisse apeli...@gmail.com wrote:

 On Wed, Jul 10, 2013 at 6:36 PM, Brian Gernhardt
 br...@gernhardtsoftware.com wrote:
 I am somewhat stuck on how to fix it.  Any ideas?
 
 I don't have anything to reproduce here, but usually I start
 investigating this kind of problems by attaching the hung process with
 gdb to see the current state (if it's stuck in a specific state), or
 to investigate the end-less loop.
 That usually help finding a good starting point.

Unfortunately, the hung process is /bin/sh (aka bash).  Using the Sample 
function of Activity Monitor gave me that 100% of the time was spent in libc's 
_open...  Which enlightens me not at all.

~~ Brian Gernhardt

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


t0008 hang on streaming test (OS X)

2013-07-10 Thread Brian Gernhardt
The newest test in t0008 streaming support for --stdin, seems to hang 
sporadically on my MacBook Pro (running 10.8.4).  The hang seems to be related 
to running it in parallel with other tests, as I can only reliably cause it by 
running with prove  and -j 3.  However, once that has hung I am able to 
semi-reliably have it occur by running the test separately (with the test hung 
in the background, using separate trash directories via the --root option).

Experimentation has led me to find that it is hanging when trying to read the 
2nd response from check-ignore.

I am somewhat stuck on how to fix it.  Any ideas?

~~ Brian Gernhardt--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] t4205: replace .\+ with ..* in sed commands

2013-07-01 Thread Brian Gernhardt
OS X's sed only accepts basic regular expressions, which does not
allow the + quantifier.  However '..*' (anything, followed by zero or
more anything) is the same as '.\+' (one or more anything) and valid
in any regular expression language.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t4205-log-pretty-formats.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 719d132..3cfb744 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -192,7 +192,7 @@ test_expect_success 'left alignment formatting with trunc' 
 message ..
 message ..
 add bar  Z
-$(commit_msg  8 .\+$)
+$(commit_msg  8 ..*$)
 EOF
test_cmp expected actual
 
@@ -310,7 +310,7 @@ test_expect_success 'left/right alignment formatting with 
stealing' 
 short long  long long
 message ..   A U Thor
 add bar  A U Thor
-$(commit_msg  8 .\+$)   A U Thor
+$(commit_msg  8 ..*$)   A U Thor
 EOF
test_cmp expected actual
 
-- 
1.8.3.1.636.g893104c

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] git-remote-hg: Fix . at end of ref

2013-06-21 Thread Brian Gernhardt
Any Mercurial tag/branch/bookmark that ended with a period would be
rejected by fast-import.  The repository could be cloned, but any
further fetch would fail.

Use a similar trick to the space handling, but only when the period is
at the end of the ref.

Probably need a more general solution to this problem.

Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 contrib/remote-helpers/git-remote-hg | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/contrib/remote-helpers/git-remote-hg 
b/contrib/remote-helpers/git-remote-hg
index 0194c67..7fa6cd7 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -78,9 +78,11 @@ def hgbin(n):
 return node.bin(n)
 
 def hgref(ref):
+ref = re.sub('_\._$', '.', ref)
 return ref.replace('___', ' ')
 
 def gitref(ref):
+ref = re.sub('\.$', '_._', ref)
 return ref.replace(' ', '___')
 
 def check_version(*check):
-- 
1.8.3.1.636.g893104c

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: HTTP tests fail on OS X

2013-06-21 Thread Brian Gernhardt

On Jun 21, 2013, at 12:49 AM, Jeff King p...@peff.net wrote:

 I'm not sure what else to look at...I guess try ratcheting up the
 debugging/log level on your failing copy and see if it prints anything
 useful.

I found this error in the error.log:

[Fri Jun 21 12:59:59 2013] [emerg] (2)No such file or directory: Couldn't 
create accept lock (/private/var/run/accept.lock.64288) (5)

Annoying that httpd returns before it tries to create the lock.

Without the IfVersion directive, it creates the lock in the ./httpd directory 
instead.  Not sure why apache is doing that, it's very irritating.

~~ Brian

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: HTTP tests fail on OS X

2013-06-21 Thread Brian Gernhardt

On Jun 21, 2013, at 2:03 PM, Jeff King p...@peff.net wrote:

 IfVersion comes from mod_version. I assume that if it were not loaded,
 apache would complain about the directive entirely. But it's true that
 we don't load it until later. Maybe try moving the IfVersion/Lockfile
 stanza down below the mod_version LoadModule line?

Apache is apparently overly accepting.  Moving the IfVersion below all the 
IfModules fixes it.

~~ Brian

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] lib-httpd/apache.conf: check version only after mod_version loads

2013-06-21 Thread Brian Gernhardt

On Jun 21, 2013, at 2:12 PM, Jeff King p...@peff.net wrote:

 On Fri, Jun 21, 2013 at 02:08:49PM -0400, Brian Gernhardt wrote:
 
 On Jun 21, 2013, at 2:03 PM, Jeff King p...@peff.net wrote:
 
 IfVersion comes from mod_version. I assume that if it were not
 loaded, apache would complain about the directive entirely. But it's
 true that we don't load it until later. Maybe try moving the
 IfVersion/Lockfile stanza down below the mod_version LoadModule
 line?
 
 Apache is apparently overly accepting.  Moving the IfVersion below all
 the IfModules fixes it.
 
 Cool. I think the patch should look like the one below, then.

Basically identical to what I've done, you're just faster to the actual patch.  
:-D

+1

 Just to double-check that I have explained the issue correctly, can you
 share the output of apache2 -l? Mine has:
 
  $ apache2 -l
  Compiled in modules:
core.c
mod_log_config.c
mod_logio.c
mod_version.c
prefork.c
http_core.c
mod_so.c
 
 which explains why it works here. I'm assuming you will not have
 mod_version.c compiled in.

Indeed I do not.

 $ httpd -l
 Compiled in modules:
   core.c
   prefork.c
   http_core.c
   mod_so.c

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


HTTP tests fail on OS X

2013-06-20 Thread Brian Gernhardt
I've bisected it to this commit:

 commit 0442743810c6f6c14386a5a9d6bf8e4d69adbc51
 Author: Jeff King p...@peff.net
 Date:   Sun Jun 9 04:07:59 2013 -0400
 
 t/lib-httpd/apache.conf: do not use LockFile in apache = 2.4

OS X 10.8.4, apache 2.2.22

I'll also note that the tests fail the first time they attempt to access the 
server and the cleanup function notes that httpd is not running under the 
expected PID.  Looking at the httpd setup code, I would have expected to see 
errors (with -v) and have the setup fail but neither happens.

It's way too late for me, so I can't look at it again for at least several 
hours.  I figured I'd ping the list in case the problem/solution is obvious to 
someone else.

~~ Brian Gernhardt

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: HTTP tests fail on OS X

2013-06-20 Thread Brian Gernhardt

On Jun 21, 2013, at 12:42 AM, Jeff King p...@peff.net wrote:

 I'm not sure if there is something different between 2.2.16 and 2.2.22,
 or something with the particular build. Here's my -V output, in case it
 helps:
 
$ apache2 -V
Server version: Apache/2.2.16 (Debian)
Server built:   Mar  3 2013 12:12:28
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture:   64-bit
Server MPM: Worker
  threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/worker
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=/etc/apache2
 -D SUEXEC_BIN=/usr/lib/apache2/suexec
 -D DEFAULT_PIDLOG=/var/run/apache2.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=mime.types
 -D SERVER_CONFIG_FILE=apache2.conf

Doesn't look terribly different from mine.

$ apachectl -V
Server version: Apache/2.2.22 (Unix)
Server built:   Dec  9 2012 18:57:18
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture:   64-bit
Server MPM: Prefork
  threaded: no
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/prefork
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=/usr
 -D SUEXEC_BIN=/usr/bin/suexec
 -D DEFAULT_PIDLOG=/private/var/run/httpd.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_LOCKFILE=/private/var/run/accept.lock
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=/private/etc/apache2/mime.types
 -D SERVER_CONFIG_FILE=/private/etc/apache2/httpd.conf


--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] Update HTTPD/daemon tests for new push.default

2013-01-15 Thread Brian Gernhardt
I saw a string of these commits already, but found a few more when running
the test suite.

Brian Gernhardt (3):
  t5550: do not assume the matching push is the default
  t5551: do not assume the matching push is the default
  t5570: do not assume the matching push is the default

 t/t5550-http-fetch.sh | 1 +
 t/t5551-http-fetch.sh | 1 +
 t/t5570-git-daemon.sh | 1 +
 3 files changed, 3 insertions(+)

-- 
1.8.1.rc1.222.gec797b3

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] t5551: do not assume the matching push is the default

2013-01-15 Thread Brian Gernhardt
Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t5551-http-fetch.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index c5cd2e3..1b55086 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -13,6 +13,7 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
 start_httpd
 
 test_expect_success 'setup repository' '
+   git config push.default matching 
echo content file 
git add file 
git commit -m one
-- 
1.8.1.rc1.222.gec797b3

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] t5550: do not assume the matching push is the default

2013-01-15 Thread Brian Gernhardt
Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t5550-http-fetch.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh
index 80d20c8..f7d0f14 100755
--- a/t/t5550-http-fetch.sh
+++ b/t/t5550-http-fetch.sh
@@ -13,6 +13,7 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
 start_httpd
 
 test_expect_success 'setup repository' '
+   git config push.default matching 
echo content1 file 
git add file 
git commit -m one
-- 
1.8.1.rc1.222.gec797b3

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] t5570: do not assume the matching push is the default

2013-01-15 Thread Brian Gernhardt
Signed-off-by: Brian Gernhardt br...@gernhardtsoftware.com
---
 t/t5570-git-daemon.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index a3a4e47..f01edff 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -8,6 +8,7 @@ LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-5570}
 start_git_daemon
 
 test_expect_success 'setup repository' '
+   git config push.default matching 
echo content file 
git add file 
git commit -m one
-- 
1.8.1.rc1.222.gec797b3

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


t9401 fails with OS X sed

2012-10-24 Thread Brian Gernhardt
I seem to write these kinds of e-mails fairly regularly...

When running t9401-git-cvsserver-crlf:

expecting success: 
check_status_options cvswork2 textfile.c  
check_status_options cvswork2 binfile.bin -kb 
check_status_options cvswork2 .gitattributes  
check_status_options cvswork2 mixedUp.c -kb 
check_status_options cvswork2 multiline.c -kb 
check_status_options cvswork2 multilineTxt.c  
check_status_options cvswork2/subdir withCr.bin -kb 
check_status_options cvswork2 subdir/withCr.bin -kb 
check_status_options cvswork2/subdir file.h  
check_status_options cvswork2 subdir/file.h  
check_status_options cvswork2/subdir unspecified.other  
check_status_options cvswork2/subdir newfile.bin  
check_status_options cvswork2/subdir newfile.c 

not ok - 12 cvs status - sticky options

I have tracked it down to a sed expression that is parsing the output of cvs 
status:

49:got=$(sed -n -e 's/^\s*Sticky Options:\s*//p' ${WORKDIR}/status.out)

The problem is that cvs outputs Sticky Options:\t\t(none)\n, but OS X's sed 
doesn't recognize the \s shortcut.  (According to re_format(5), \s is part of 
the enhanced regex format, which sed doesn't use.)  

It works if I change \s to [[:space:]], but I don't know how portable that is.

~~ Brian Gernhardt

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Test failures in t4034

2012-08-18 Thread Brian Gernhardt
I've been getting a couple of test failures and finally had the time to track 
them down.

t4034-diff-words fails tests 22 diff driver 'bibtex' and 26 diff driver 
'html'.  Bisecting shows that the file started giving me errors in commit 
8d96e72 t4034: bulk verify builtin word regex sanity, which appears to 
introduce those tests.  I don't see anything obviously wrong with the tests and 
I'm not familiar with the diff-words code, so I'm not sure what's wrong.

I am running on OS X 10.8, with Xcode 4.4.1 (llvm-gcc 4.2.1).

Test results follow:

-- 8 --

expecting success: 
cp $TEST_DIRECTORY/t4034/bibtex/pre \
$TEST_DIRECTORY/t4034/bibtex/post \
$TEST_DIRECTORY/t4034/bibtex/expect . 
echo * diff=bibtex .gitattributes 
word_diff --color-words

--- expect  2012-08-18 05:54:29.0 +
+++ output.decrypted2012-08-18 05:54:29.0 +
@@ -8,8 +8,8 @@
   author={Aldous, REDD.RESETGREENDavidRESET},
   journal={Information Theory, IEEE Transactions on},RESET
   volume={RED33RESETGREENBogus.RESET},
-  number={RED2RESETGREEN4RESET},
+  number={4},
   pages={219--223},RESET
-  year=GREEN1987,RESET
-GREEN  note={This is in fact a rather funny read since ethernet works well 
in practice. TheRESET {RED1987RESETGREEN\em pre} reference is the right 
one, however.RESET}RED,RESET
+  year=RED{1987},RESETGREEN1987,RESET
+  note={This is in fact a rather funny read since ethernet works well in 
practice. The {\em pre} reference is the right one, however.}
 }RESET
not ok - 22 diff driver 'bibtex'

-- 8 --

expecting success: 
cp $TEST_DIRECTORY/t4034/html/pre \
$TEST_DIRECTORY/t4034/html/post \
$TEST_DIRECTORY/t4034/html/expect . 
echo * diff=html .gitattributes 
word_diff --color-words

--- expect  2012-08-18 05:54:29.0 +
+++ output.decrypted2012-08-18 05:54:29.0 +
@@ -4,5 +4,5 @@
 BOLD+++ b/postRESET
 CYAN@@ -1,3 +1,3 @@RESET
 tag GREENnewattr=newvalueRESETGREENaddedRESET content/tag
-tag 
attr=REDvalueRESETGREENnewvalueRESETREDcontentRESETGREENchangedRESET/tag
-REDtagRESETGREENnewtagRESETcontent 
REDentity;RESETGREENnewentity;RESETRED/tagRESETGREEN/newtagRESET
+tag attr=newvaluechanged/tag
+newtagcontent newentity;/newtag
not ok - 26 diff driver 'html'--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html