From 958545c5a11e5d6745e34df28abdd4a03a1f40fa Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Feb 2007 01:50:28 -0800 Subject: [PATCH 1/7] Clarify two backward incompatible repository options. It was unclear if the backward compatible features were disabled or the configuration variables that controls them were set to false by default from the description. Obviously we meant the former, but the problem was made worse by the fact that one configuration variable breaks compatibility when set to true and the other one breaks it when set to false. Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.0.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/RelNotes-1.5.0.txt b/Documentation/RelNotes-1.5.0.txt index f0120e1f5a..0989ded497 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 explicitly to 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 From 20276889d6610d87c17b058ac0c49601ed950e61 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 14 Feb 2007 18:10:26 +0100 Subject: [PATCH 2/7] git-daemon: Avoid leaking the listening sockets into child processes. This makes it possible to restart git-daemon even if some children are still running. Signed-off-by: Alexandre Julliard Signed-off-by: Junio C Hamano --- daemon.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; From 37b73cf97c0480878c4eff576295deae19bad506 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Feb 2007 10:54:25 -0800 Subject: [PATCH 3/7] Still updating 1.5.0 release notes. In cruft removal section we had a cruft we needed to remove. Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.0.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Documentation/RelNotes-1.5.0.txt b/Documentation/RelNotes-1.5.0.txt index 0989ded497..599efb8c90 100644 --- a/Documentation/RelNotes-1.5.0.txt +++ b/Documentation/RelNotes-1.5.0.txt @@ -36,7 +36,7 @@ Specifically, the available options are: set repack.usedeltabaseoffset to true. The above two new features are not enabled by default and you -have explicitly to ask for them, because they make repositories +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 @@ -223,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 @@ -259,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 From bd07326dcd46196c14be81c68800ce2d1f4144c4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Feb 2007 11:01:41 -0800 Subject: [PATCH 4/7] Add RelNotes 1.5.0.1 In the same spirit as commit 6fc66686, let's keep notes as we fix things. Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.0.1.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Documentation/RelNotes-1.5.0.1.txt 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.. From 5faaf24634a4d3a630bd3655cc85fa96f8bc1903 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Feb 2007 13:20:41 -0800 Subject: [PATCH 5/7] Make sure packedgitwindowsize is multiple of (pagesize * 2) The next patch depends on this. Signed-off-by: Junio C Hamano --- config.c | 12 +++++++----- git-compat-util.h | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) 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/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 + +/* This value must be multiple of (pagesize * 2) */ #define DEFAULT_PACKED_GIT_WINDOW_SIZE \ (sizeof(void*) >= 8 \ ? 1 * 1024 * 1024 * 1024 \ From 78a28df9388cccb1ec85aa5642808f0d3392155f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 14 Feb 2007 18:11:40 +0100 Subject: [PATCH 6/7] sha1_file.c: Round the mmap offset to half the window size. This ensures that a given area is mapped at most twice, and greatly reduces the virtual address space usage. Signed-off-by: Alexandre Julliard Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- sha1_file.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; From 204d409247e7bbc7848569462aa11a87e373c8d6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Feb 2007 11:33:04 -0800 Subject: [PATCH 7/7] GIT-VERSION-FILE: check ./version first. When somebody else extracts git tarball inside a larger project, 'git describe' would reported the version number of that upper level project. Sometimes, using the consistent versioning across subdirectories of a larger project is useful, but it may not always be the right thing to do. This changes the script to check ./vertion file first, and then fall back to "git describe". This way, by default, tarball distribution will get our own version. If the upper level wants to use consistent versioning across its subdirectories, its Makefile can overwrite ./version file to force whatever version number they want to give us before descending into us. Signed-off-by: Junio C Hamano --- GIT-VERSION-GEN | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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