From 1c1f79a1e44547d039e7bf94d9aaadd3fae007d1 Mon Sep 17 00:00:00 2001 From: Aurelien Bompard Date: Sun, 28 Oct 2007 18:47:30 +0100 Subject: [PATCH 1/5] honor the http.sslVerify option in shell scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard Signed-off-by: Junio C Hamano --- git-clone.sh | 3 ++- git-ls-remote.sh | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index 5e582fe247..0ea3c24f59 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -28,7 +28,8 @@ get_repo_base() { ) 2>/dev/null } -if [ -n "$GIT_SSL_NO_VERIFY" ]; then +if [ -n "$GIT_SSL_NO_VERIFY" -o \ + "`git config --bool http.sslVerify`" = false ]; then curl_extra_args="-k" fi diff --git a/git-ls-remote.sh b/git-ls-remote.sh index d56cf92ebf..fec70bbf88 100755 --- a/git-ls-remote.sh +++ b/git-ls-remote.sh @@ -54,9 +54,10 @@ tmpdir=$tmp-d case "$peek_repo" in http://* | https://* | ftp://* ) - if [ -n "$GIT_SSL_NO_VERIFY" ]; then - curl_extra_args="-k" - fi + if [ -n "$GIT_SSL_NO_VERIFY" -o \ + "`git config --bool http.sslVerify`" = false ]; then + curl_extra_args="-k" + fi if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ "`git config --bool http.noEPSV`" = true ]; then curl_extra_args="${curl_extra_args} --disable-epsv" From 399f0a8eedeec209c2eb97be6285331087234644 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Mon, 29 Oct 2007 08:00:33 +0100 Subject: [PATCH 2/5] Fix a small memory leak in builtin-add prune_directory and fill_directory allocated one byte per pathspec and never freed it. Signed-off-by: Benoit Sigoure Signed-off-by: Junio C Hamano --- builtin-add.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-add.c b/builtin-add.c index 3d8b8b4f89..373f87f9f2 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -44,6 +44,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p die("pathspec '%s' did not match any files", pathspec[i]); } + free(seen); } static void fill_directory(struct dir_struct *dir, const char **pathspec, @@ -140,6 +141,7 @@ static void refresh(int verbose, const char **pathspec) if (!seen[i]) die("pathspec '%s' did not match any files", pathspec[i]); } + free(seen); } static int git_add_config(const char *var, const char *value) From 7109c889f11b39a2c5a5122e3726be7ffce09faf Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Oct 2007 11:53:55 -0700 Subject: [PATCH 3/5] sha1_file.c: avoid gcc signed overflow warnings With the recent gcc, we get: sha1_file.c: In check_packed_git_: sha1_file.c:527: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false sha1_file.c:527: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false for a piece of code that tries to make sure that off_t is large enough to hold more than 2^32 offset. The test tried to make sure these do not wrap-around: /* make sure we can deal with large pack offsets */ off_t x = 0x7fffffffUL, y = 0xffffffffUL; if (x > (x + 1) || y > (y + 1)) { but gcc assumes it can do whatever optimization it wants for a signed overflow (undefined behaviour) and warns about this construct. Follow Linus's suggestion to check sizeof(off_t) instead to work around the problem. Signed-off-by: Junio C Hamano --- sha1_file.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 9978a58da6..95b5a403d8 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -521,13 +521,15 @@ static int check_packed_git_idx(const char *path, struct packed_git *p) munmap(idx_map, idx_size); return error("wrong index v2 file size in %s", path); } - if (idx_size != min_size) { - /* make sure we can deal with large pack offsets */ - off_t x = 0x7fffffffUL, y = 0xffffffffUL; - if (x > (x + 1) || y > (y + 1)) { - munmap(idx_map, idx_size); - return error("pack too large for current definition of off_t in %s", path); - } + if (idx_size != min_size && + /* + * make sure we can deal with large pack offsets. + * 31-bit signed offset won't be enough, neither + * 32-bit unsigned one will be. + */ + (sizeof(off_t) <= 4)) { + munmap(idx_map, idx_size); + return error("pack too large for current definition of off_t in %s", path); } } From f120ae2a8e8cbe1bcbb2b55ebcd2e1eeb9f03ea2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Oct 2007 12:00:55 -0700 Subject: [PATCH 4/5] merge-recursive.c: mrtree in merge() is not used before set The called function merge_trees() sets its *result, to which the address of the variable mrtree in merge() function is passed, only when index_only is set. But that is Ok as the function uses the value in the variable only under index_only iteration. However, recent gcc does not realize this. Work it around by adding a fake initializer. Signed-off-by: Junio C Hamano --- merge-recursive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merge-recursive.c b/merge-recursive.c index 19d5f3b287..c2e1cb69e3 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1586,7 +1586,7 @@ static int merge(struct commit *h1, { struct commit_list *iter; struct commit *merged_common_ancestors; - struct tree *mrtree; + struct tree *mrtree = mrtree; int clean; if (show(4)) { From e720c4382f6c9317a3b495e80c7dfc609a0db5e6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Oct 2007 12:02:59 -0700 Subject: [PATCH 5/5] RelNotes-1.5.3.5: describe recent fixes Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.3.5.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt index 9581e03c49..e28d92f618 100644 --- a/Documentation/RelNotes-1.5.3.5.txt +++ b/Documentation/RelNotes-1.5.3.5.txt @@ -71,3 +71,24 @@ Fixes since v1.5.3.4 * "make clean" no longer deletes the configure script that ships with the git tarball, making multiple architecture builds easier. + + * "git-remote show origin" spewed a warning message from Perl + when no remote is defined for the current branch via + branch..remote configuration settings. + + * Building with NO_PERL_MAKEMAKER excessively rebuilt contents + of perl/ subdirectory by rewriting perl.mak. + + * http.sslVerify configuration settings were not used in scripted + Porcelains. + + * "git-add" leaked a bit of memory while scanning for files to add. + + * A few workarounds to squelch false warnings from recent gcc have + been added. + +-- +exec >/var/tmp/1 +O=v1.5.3.4-55-gf120ae2 +echo O=`git describe refs/heads/maint` +git shortlog --no-merges $O..refs/heads/maint