From 8c6202d8696d2e3ae016042acd05f6a82763a5e3 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 12 Jul 2008 03:15:03 +0200 Subject: Fix backwards-incompatible handling of core.sharedRepository 06cbe85 (Make core.sharedRepository more generic, 2008-04-16) broke the traditional setting of core.sharedRepository to true, which was to make the repository group writable: with umask 022, it would clear the permission bits for 'other'. (umask 002 did not exhibit this behaviour since pre-chmod() check in adjust_shared_perm() fails in that case.) The call to adjust_shared_perm() should only loosen the permission. If the user has umask like 022 or 002 that allow others to read, the resulting files should be made readable and writable by group, without restricting the readability by others. This patch fixes the adjust_shared_perm() mode tweak based on Junio's suggestion and adds the appropriate tests to t/t1301-shared-repo.sh. Cc: Heikki Orsila Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano diff --git a/path.c b/path.c index 6e3df18..c1d5679 100644 --- a/path.c +++ b/path.c @@ -272,7 +272,7 @@ int adjust_shared_perm(const char *path) int tweak = shared_repository; if (!(mode & S_IWUSR)) tweak &= ~0222; - mode = (mode & ~0777) | tweak; + mode |= tweak; } else { /* Preserve old PERM_UMASK behaviour */ if (mode & S_IWUSR) diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index 6c78c8b..dc85e8b 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -17,6 +17,29 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' ' test $ret != "0" ' +for u in 002 022 +do + test_expect_success "shared=1 does not clear bits preset by umask $u" ' + mkdir sub && ( + cd sub && + umask $u && + git init --shared=1 && + test 1 = "$(git config core.sharedrepository)" + ) && + actual=$(ls -l sub/.git/HEAD) + case "$actual" in + -rw-rw-r--*) + : happy + ;; + *) + echo Oops, .git/HEAD is not 0664 but $actual + false + ;; + esac + ' + rm -rf sub +done + test_expect_success 'shared=all' ' mkdir sub && cd sub && -- cgit v0.10.2-6-g49f6 From b4958181a9afd0a7a2622d18416f88f9222123f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= Date: Thu, 10 Jul 2008 23:36:28 +0200 Subject: git-mailinfo: document the -n option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Sandström Signed-off-by: Junio C Hamano diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt index 183dc1d..1e126f4 100644 --- a/Documentation/git-mailinfo.txt +++ b/Documentation/git-mailinfo.txt @@ -8,7 +8,7 @@ git-mailinfo - Extracts patch and authorship from a single e-mail message SYNOPSIS -------- -'git-mailinfo' [-k] [-u | --encoding=] +'git-mailinfo' [-k] [-u | --encoding= | -n] DESCRIPTION @@ -46,6 +46,9 @@ conversion, even with this flag. from what is specified by i18n.commitencoding, this flag can be used to override it. +-n:: + Disable all charset re-coding of the metadata. + :: The commit log message extracted from e-mail, usually except the title line which comes from e-mail Subject. diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index fa6e8f9..962aa34 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -960,7 +960,7 @@ static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding, } static const char mailinfo_usage[] = - "git-mailinfo [-k] [-u | --encoding=] msg patch info"; + "git-mailinfo [-k] [-u | --encoding= | -n] msg patch info"; int cmd_mailinfo(int argc, const char **argv, const char *prefix) { -- cgit v0.10.2-6-g49f6 From 329636b435a792cb10df8d49b791cdafd6d8189b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 12 Jul 2008 04:15:56 -0700 Subject: t0004: fix timing bug The test created an initial commit, made .git/objects unwritable and then exercised various codepaths to create loose commit, tree and blob objects to make sure the commands notice failures from these attempts. However, the initial commit was not preceded with test_tick, which made its object name depend on the timestamp. The names of all the later tree and blob objects the test tried to create were static. If the initial commit's object name happened to begin with the same two hexdigits as the tree or blob objects the test later attempted to create, the fan-out directory in which these tree or blob would be created is already created when the initial commit was made, and the object creation succeeds, and commands being tested should not notice any failure --- in short, the test was bogus. This makes the fan-out directories also unwritable, and adds test_tick before the commit object creation to make the test repeatable. The contents of the file to create a blob from "a" to "60" is to force the name of the blob object to begin with "1b", which shares the fan-out directory with the initial commit that is created with the test. This was useful when diagnosing the breakage of this test. Signed-off-by: Junio C Hamano diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh index 9255c63..63e1217 100755 --- a/t/t0004-unwritable.sh +++ b/t/t0004-unwritable.sh @@ -8,6 +8,7 @@ test_expect_success setup ' >file && git add file && + test_tick && git commit -m initial && echo >file && git add file @@ -17,11 +18,11 @@ test_expect_success setup ' test_expect_success 'write-tree should notice unwritable repository' ' ( - chmod a-w .git/objects + chmod a-w .git/objects .git/objects/?? && test_must_fail git write-tree ) status=$? - chmod 775 .git/objects + chmod 775 .git/objects .git/objects/?? (exit $status) ' @@ -29,11 +30,11 @@ test_expect_success 'write-tree should notice unwritable repository' ' test_expect_success 'commit should notice unwritable repository' ' ( - chmod a-w .git/objects + chmod a-w .git/objects .git/objects/?? && test_must_fail git commit -m second ) status=$? - chmod 775 .git/objects + chmod 775 .git/objects .git/objects/?? (exit $status) ' @@ -41,12 +42,12 @@ test_expect_success 'commit should notice unwritable repository' ' test_expect_success 'update-index should notice unwritable repository' ' ( - echo a >file && - chmod a-w .git/objects + echo 6O >file && + chmod a-w .git/objects .git/objects/?? && test_must_fail git update-index file ) status=$? - chmod 775 .git/objects + chmod 775 .git/objects .git/objects/?? (exit $status) ' @@ -55,11 +56,11 @@ test_expect_success 'add should notice unwritable repository' ' ( echo b >file && - chmod a-w .git/objects + chmod a-w .git/objects .git/objects/?? && test_must_fail git add file ) status=$? - chmod 775 .git/objects + chmod 775 .git/objects .git/objects/?? (exit $status) ' -- cgit v0.10.2-6-g49f6 From 460abee5cd7d0cb06e5f424b1dae793af4e66cbb Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sat, 12 Jul 2008 17:46:59 +0200 Subject: git-am: Do not exit silently if committer is unset Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano diff --git a/git-am.sh b/git-am.sh index 2c517ed..83b277a 100755 --- a/git-am.sh +++ b/git-am.sh @@ -30,7 +30,8 @@ set_reflog_action am require_work_tree cd_to_toplevel -git var GIT_COMMITTER_IDENT >/dev/null || exit +git var GIT_COMMITTER_IDENT >/dev/null || + die "You need to set your committer info first" stop_here () { echo "$1" >"$dotest/next" -- cgit v0.10.2-6-g49f6 From 191a8e32b38c7ff0dd884df7bd323b7a5bd4336c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 13 Jul 2008 15:23:43 -0700 Subject: GIT 1.5.6.3 Signed-off-by: Junio C Hamano diff --git a/Documentation/RelNotes-1.5.6.3.txt b/Documentation/RelNotes-1.5.6.3.txt index dd0559b..9426112 100644 --- a/Documentation/RelNotes-1.5.6.3.txt +++ b/Documentation/RelNotes-1.5.6.3.txt @@ -4,8 +4,16 @@ GIT v1.5.6.3 Release Notes Fixes since v1.5.6.2 -------------------- +* Setting core.sharerepository to traditional "true" value was supposed to make + the repository group writable but should not affect permission for others. + However, since 1.5.6, it was broken to drop permission for others when umask is + 022, making the repository unreadable by others. + * Setting GIT_TRACE will report spawning of external process via run_command(). +* Using an object with very deep delta chain pinned memory needed for extracting + intermediate base objects unnecessarily long, leading to excess memory usage. + * Bash completion script did not notice '--' marker on the command line and tried the relatively slow "ref completion" even when completing arguments after one. @@ -14,6 +22,12 @@ Fixes since v1.5.6.2 tree file for it confused "racy-git avoidance" logic into thinking that the path is now unchanged. +* The section that describes attributes related to git-archive were placed + in a wrong place in the gitattributes(5) manual page. + +* "git am" was not helpful to the users when it detected that the committer + information is not set up properly yet. + * "git clone" had a leftover debugging fprintf(). * "git clone -q" was not quiet enough as it used to and gave object count @@ -23,8 +37,10 @@ Fixes since v1.5.6.2 good thing if the remote side is well packed but otherwise not, especially for a project that is not really big. -* The section that describes attributes related to git-archive were placed - in a wrong place in the gitattributes(5) manual page. +* "git daemon" used to call syslog() from a signal handler, which + could raise signals of its own but generally is not reentrant. This + was fixed by restructuring the code to report syslog() after the handler + returns. * When "git push" tries to remove a remote ref, and corresponding tracking ref is missing, we used to report error (i.e. failure to @@ -34,9 +50,3 @@ Fixes since v1.5.6.2 MIME multipart mail correctly. Contains other various documentation fixes. - --- -exec >/var/tmp/1 -O=v1.5.6.2-23-ge965647 -echo O=$(git describe maint) -git shortlog --no-merges $O..maint diff --git a/Documentation/git.txt b/Documentation/git.txt index 0d6fe9c..33ae79b 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.5.6.2/git.html[documentation for release 1.5.6.2] +* link:v1.5.6.3/git.html[documentation for release 1.5.6.3] * release notes for + link:RelNotes-1.5.6.3.txt[1.5.6.3]. link:RelNotes-1.5.6.2.txt[1.5.6.2]. link:RelNotes-1.5.6.1.txt[1.5.6.1]. link:RelNotes-1.5.6.txt[1.5.6]. -- cgit v0.10.2-6-g49f6