summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-14 15:25:53 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-14 15:25:53 -0800
commit78e90f89e39b112af2670516f80586163dcd56ca (patch)
tree700de0cc6c28079dddf50c70d3c9d0afaada659e
parent9a894e8e7c85794d39745eb83462a2001816ac3b (diff)
parent204d409247e7bbc7848569462aa11a87e373c8d6 (diff)
downloadgit-78e90f89e39b112af2670516f80586163dcd56ca.tar.gz
Merge branch 'maint'
* maint: GIT-VERSION-FILE: check ./version first. sha1_file.c: Round the mmap offset to half the window size. Make sure packedgitwindowsize is multiple of (pagesize * 2) Add RelNotes 1.5.0.1 Still updating 1.5.0 release notes. git-daemon: Avoid leaking the listening sockets into child processes. Clarify two backward incompatible repository options.
-rw-r--r--Documentation/RelNotes-1.5.0.1.txt20
-rw-r--r--Documentation/RelNotes-1.5.0.txt15
-rwxr-xr-xGIT-VERSION-GEN21
-rw-r--r--config.c12
-rw-r--r--daemon.c10
-rw-r--r--git-compat-util.h3
-rw-r--r--sha1_file.c8
7 files changed, 63 insertions, 26 deletions
diff --git a/Documentation/RelNotes-1.5.0.1.txt b/Documentation/RelNotes-1.5.0.1.txt
new file mode 100644
index 0000000000..982282a899
--- /dev/null
+++ b/Documentation/RelNotes-1.5.0.1.txt
@@ -0,0 +1,20 @@
+GIT v1.5.0.1 Release Notes
+==========================
+
+Fixes since v1.5.0
+------------------
+
+* Documentation updates
+
+ - Clarifications and corrections to 1.5.0 release notes.
+ - The main documentation did not link to git-remote documentation.
+
+* Bugfixes
+
+ - git-daemon marks the listening sockets with FD_CLOEXEC so
+ that it won't be leaked into the children.
+
+--
+O=v1.5.0-7-g37b73cf
+echo O=`git describe maint`
+git shortlog --no-merges $O..
diff --git a/Documentation/RelNotes-1.5.0.txt b/Documentation/RelNotes-1.5.0.txt
index f0120e1f5a..599efb8c90 100644
--- a/Documentation/RelNotes-1.5.0.txt
+++ b/Documentation/RelNotes-1.5.0.txt
@@ -25,12 +25,18 @@ Specifically, the available options are:
older clients over dumb transports (e.g. http) using older
versions of git will also be affected.
+ To let git use the new loose object format, you have to
+ set core.legacyheaders to false.
+
- Since v1.4.3, configuration repack.usedeltabaseoffset allows
packfile to be created in more space efficient format, which
cannot be read by git older than that version.
-The above two are not enabled by default and you explicitly have
-to ask for them, because these two features make repositories
+ To let git use the new format for packfiles, you have to
+ set repack.usedeltabaseoffset to true.
+
+The above two new features are not enabled by default and you
+have to explicitly ask for them, because they make repositories
unreadable by older versions of git, and in v1.5.0 we still do
not enable them by default for the same reason. We will change
this default probably 1 year after 1.4.2's release, when it is
@@ -217,7 +223,7 @@ Updates in v1.5.0 since v1.4.4 series
"branch@{Nth}" notation.
- "git show-branch" learned showing the reflog data with the
- new -g option. "git log" has -s option to view reflog
+ new -g option. "git log" has -g option to view reflog
entries in a more verbose manner.
- git-branch knows how to rename branches and moves existing
@@ -253,9 +259,6 @@ Updates in v1.5.0 since v1.4.4 series
above sentence, as git-prune does not remove things reachable
from reflog entries.
- - 'git-prune' by default does not remove _everything_
- unreachable, as there is a one-day grace period built-in.
-
- There is a toplevel garbage collector script, 'git-gc', that
runs periodic cleanup functions, including 'git-repack -a -d',
'git-reflog expire', 'git-pack-refs --prune', and 'git-rerere
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index febacd2dc9..6abde8d7b3 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -6,18 +6,19 @@ DEF_VER=v1.5.0.GIT
LF='
'
-# First try git-describe, then see if there is a version file
-# (included in release tarballs), then default
-if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
- case "$VN" in
- *$LF*) (exit 1) ;;
- v[0-9]*) : happy ;;
- esac
-then
- VN=$(echo "$VN" | sed -e 's/-/./g');
-elif test -f version
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
+elif test -d .git &&
+ VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ v[0-9]*) : happy ;;
+ esac
+then
+ VN=$(echo "$VN" | sed -e 's/-/./g');
else
VN="$DEF_VER"
fi
diff --git a/config.c b/config.c
index d82107124a..c938aa0b15 100644
--- a/config.c
+++ b/config.c
@@ -310,12 +310,14 @@ int git_default_config(const char *var, const char *value)
}
if (!strcmp(var, "core.packedgitwindowsize")) {
- int pgsz = getpagesize();
+ int pgsz_x2 = getpagesize() * 2;
packed_git_window_size = git_config_int(var, value);
- packed_git_window_size /= pgsz;
- if (packed_git_window_size < 2)
- packed_git_window_size = 2;
- packed_git_window_size *= pgsz;
+
+ /* This value must be multiple of (pagesize * 2) */
+ packed_git_window_size /= pgsz_x2;
+ if (packed_git_window_size < 1)
+ packed_git_window_size = 1;
+ packed_git_window_size *= pgsz_x2;
return 0;
}
diff --git a/daemon.c b/daemon.c
index 2a20ca55cb..66f8d6f03d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -773,6 +773,7 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
char pbuf[NI_MAXSERV];
struct addrinfo hints, *ai0, *ai;
int gai;
+ long flags;
sprintf(pbuf, "%d", listen_port);
memset(&hints, 0, sizeof(hints));
@@ -820,6 +821,10 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
continue; /* not fatal */
}
+ flags = fcntl(sockfd, F_GETFD, 0);
+ if (flags >= 0)
+ fcntl(sockfd, F_SETFD, flags | FD_CLOEXEC);
+
socklist = xrealloc(socklist, sizeof(int) * (socknum + 1));
socklist[socknum++] = sockfd;
@@ -839,6 +844,7 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
{
struct sockaddr_in sin;
int sockfd;
+ long flags;
memset(&sin, 0, sizeof sin);
sin.sin_family = AF_INET;
@@ -871,6 +877,10 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
return 0;
}
+ flags = fcntl(sockfd, F_GETFD, 0);
+ if (flags >= 0)
+ fcntl(sockfd, F_SETFD, flags | FD_CLOEXEC);
+
*socklist_p = xmalloc(sizeof(int));
**socklist_p = sockfd;
return 1;
diff --git a/git-compat-util.h b/git-compat-util.h
index c1bcb001a5..105ac28f97 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -96,11 +96,14 @@ extern void set_warn_routine(void (*routine)(const char *warn, va_list params));
extern void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
extern int git_munmap(void *start, size_t length);
+/* This value must be multiple of (pagesize * 2) */
#define DEFAULT_PACKED_GIT_WINDOW_SIZE (1 * 1024 * 1024)
#else /* NO_MMAP */
#include <sys/mman.h>
+
+/* This value must be multiple of (pagesize * 2) */
#define DEFAULT_PACKED_GIT_WINDOW_SIZE \
(sizeof(void*) >= 8 \
? 1 * 1024 * 1024 * 1024 \
diff --git a/sha1_file.c b/sha1_file.c
index 8ad7fad825..b83f59f383 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -407,7 +407,6 @@ static unsigned int peak_pack_open_windows;
static unsigned int pack_open_windows;
static size_t peak_pack_mapped;
static size_t pack_mapped;
-static size_t page_size;
struct packed_git *packed_git;
void pack_report()
@@ -416,7 +415,7 @@ void pack_report()
"pack_report: getpagesize() = %10" SZ_FMT "\n"
"pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
"pack_report: core.packedGitLimit = %10" SZ_FMT "\n",
- page_size,
+ (size_t) getpagesize(),
packed_git_window_size,
packed_git_limit);
fprintf(stderr,
@@ -662,10 +661,9 @@ unsigned char* use_pack(struct packed_git *p,
break;
}
if (!win) {
- if (!page_size)
- page_size = getpagesize();
+ size_t window_align = packed_git_window_size / 2;
win = xcalloc(1, sizeof(*win));
- win->offset = (offset / page_size) * page_size;
+ win->offset = (offset / window_align) * window_align;
win->len = p->pack_size - win->offset;
if (win->len > packed_git_window_size)
win->len = packed_git_window_size;