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.
This commit is contained in:
commit
78e90f89e3
20
Documentation/RelNotes-1.5.0.1.txt
Normal file
20
Documentation/RelNotes-1.5.0.1.txt
Normal file
@ -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..
|
@ -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
|
||||
|
@ -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
|
||||
|
12
config.c
12
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;
|
||||
}
|
||||
|
||||
|
10
daemon.c
10
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;
|
||||
|
@ -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 \
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user