summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-04-18Update docs on behaviour of 'core.sharedRepository' and 'git init --shared'Libravatar Johan Herland2-7/+15
This documentation update is needed to reflect the recent changes where "core.sharedRepository = 0mode" was changed to set, not loosen, the repository permissions. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12t1301-shared-repo: fix forced modes testLibravatar Johannes Sixt1-4/+8
This test was added recently (5a688fe, "core.sharedrepository = 0mode" should set, not loosen; 2009-03-28). It checked the result of a sed invocation for emptyness, but in some cases it forgot to print anything at all, so that those checks would never be false. Due to this mistake, it went unnoticed that the files in objects/info are not necessarily 0440, but can also be 0660. Because the 0mode setting tries to guarantee that the files are accessible only to the people they are meant to be used by, we should only make sure that they are readable by the user and the group when the configuration is set to 0660. It is a separate matter from the core.shredrepository settings that w-bit from immutable object files under objects/[0-9a-f][0-9a-f] directories should be dropped. COMMIT_EDITMSG is still world-readable, but it (and any transient files that are meant for repositories with a work tree) does not matter. If you are working on a shared machine and on a sekrit stuff, the root of the work tree would be with mode 0700 (or 0750 to allow peeking by other people in the group), and that would mean that .git/COMMIT_EDITMSG in such a repository would not be readable by the strangers anyway. Also, in the real-world use case, .git/COMMIT_EDITMSG will be given to an arbitrary editor the user happens to use, and we have no guarantee what it does (e.g. it may create a new file with umask and replace, it may rewrite in place, it may leave an editor backup file but use umask to create it, etc.), and the protection of the file lies majorly on the protection of the root of the work tree. This test cannot be run on Windows; it requires POSIXPERM when merged to 'master'. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-01t1301: loosen test for forced modesLibravatar Jeff King1-2/+2
One of the aspects of the test checked explicitly for the g+s bit to be set on created directories. However, this is only the means to an end (the "end" being having the correct group set). And in fact, on systems where DIR_HAS_BSD_GROUP_SEMANTICS is set, we do not even need to use this "means" at all, causing the test to fail. This patch removes that part of the test. In an ideal world it would be replaced by a test to check that the group was properly assigned, but that is difficult to automate because it requires the user running the test suite be a member of multiple groups. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28set_shared_perm(): sometimes we know what the final mode bits should look likeLibravatar Junio C Hamano3-11/+19
adjust_shared_perm() first obtains the mode bits from lstat(2), expecting to find what the result of applying user's umask is, and then tweaks it as necessary. When the file to be adjusted is created with mkstemp(3), however, the mode thusly obtained does not have anything to do with user's umask, and we would need to start from 0444 in such a case and there is no point running lstat(2) for such a path. This introduces a new API set_shared_perm() to bypass the lstat(2) and instead force setting the mode bits to the desired value directly. adjust_shared_perm() becomes a thin wrapper to the function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28move_temp_to_file(): do not forget to chmod() in "Coda hack" codepathLibravatar Junio C Hamano1-2/+3
Now move_temp_to_file() is responsible for doing everything that is necessary to turn a tempfile in $GIT_DIR into its final form, it must make sure "Coda hack" codepath correctly makes the file read-only. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27Move chmod(foo, 0444) into move_temp_to_file()Libravatar Johan Herland5-11/+4
When writing out a loose object or a pack (index), move_temp_to_file() is called to finalize the resulting file. These files (loose files and packs) should all have permission mode 0444 (modulo adjust_shared_perm()). Therefore, instead of doing chmod(foo, 0444) explicitly from each callsite (or even forgetting to chmod() at all), do the chmod() call from within move_temp_to_file(). Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27"core.sharedrepository = 0mode" should set, not loosenLibravatar Junio C Hamano5-20/+77
This fixes the behaviour of octal notation to how it is defined in the documentation, while keeping the traditional "loosen only" semantics intact for "group" and "everybody". Three main points of this patch are: - For an explicit octal notation, the internal shared_repository variable is set to a negative value, so that we can tell "group" (which is to "OR" in 0660) and 0660 (which is to "SET" to 0660); - git-init did not set shared_repository variable early enough to affect the initial creation of many files, notably copied templates and the configuration. We set it very early when a command-line option specifies a custom value. - Many codepaths create files inside $GIT_DIR by various ways that all involve mkstemp(), and then call move_temp_to_file() to rename it to its final destination. We can add adjust_shared_perm() call here; for the traditional "loosen-only", this would be a no-op for many codepaths because the mode is already loose enough, but with the new behaviour it makes a difference. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24Increase the size of the die/warning buffer to avoid truncationLibravatar Shawn O. Pearce1-1/+1
Long messages like those from lockfile.c when a lock can't be obtained truncate with only 256 bytes in the message buffer. Bump it to 1024 to give more space for these longer cases. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24Merge branch 'maint-1.6.1' into maintLibravatar Junio C Hamano2-2/+2
* maint-1.6.1: close_sha1_file(): make it easier to diagnose errors avoid possible overflow in delta size filtering computation
2009-03-24Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano2-2/+2
* maint-1.6.0: close_sha1_file(): make it easier to diagnose errors avoid possible overflow in delta size filtering computation
2009-03-24close_sha1_file(): make it easier to diagnose errorsLibravatar Linus Torvalds1-1/+1
A bug report with "unable to write sha1 file" made us realize that we do not have enough information to guess why close() is failing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24avoid possible overflow in delta size filtering computationLibravatar Nicolas Pitre1-1/+1
On a 32-bit system, the maximum possible size for an object is less than 4GB, while 64-bit systems may cope with larger objects. Due to this limitation, variables holding object sizes are using an unsigned long type (32 bits on 32-bit systems, or 64 bits on 64-bit systems). When large objects are encountered, and/or people play with large delta depth values, it is possible for the maximum allowed delta size computation to overflow, especially on a 32-bit system. When this occurs, surviving result bits may represent a value much smaller than what it is supposed to be, or even zero. This prevents some objects from being deltified although they do get deltified when a smaller depth limit is used. Fix this by always performing a 64-bit multiplication. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-22Merge branch 'maint-1.6.1' into maintLibravatar Junio C Hamano1-1/+1
* maint-1.6.1: everyday: use the dashless form of git-init
2009-03-22Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-1/+1
* maint-1.6.0: everyday: use the dashless form of git-init
2009-03-22everyday: use the dashless form of git-initLibravatar David Aguilar1-1/+1
The 'Everyday GIT' guide was using the old dashed form of git-init. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21Update draft release notes to 1.6.2.2Libravatar Junio C Hamano2-1/+36
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21ls-files: require worktree when --deleted is givenLibravatar Jeff King1-0/+1
The code will end up calling lstat() to check whether the file still exists; obviously this doesn't work if we're not in the worktree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21pickaxe: count regex matches only onceLibravatar René Scharfe1-2/+4
When --pickaxe-regex is used, forward past the end of matches instead of advancing to the byte after their start. This way matches count only once, even if the regular expression matches their tail -- like in the fixed-string fork of the code. E.g.: /.*/ used to count the number of bytes instead of the number of lines. /aa/ resulted in a count of two in "aaa" instead of one. Also document the fact that regexec() needs a NUL-terminated string as its second argument by adding an assert(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-21Merge branch 'maint-1.6.1' into maintLibravatar Junio C Hamano0-0/+0
* maint-1.6.1:
2009-03-21Merge branch 'tr/maint-1.6.0-send-email-irt' into maintLibravatar Junio C Hamano2-1/+12
* tr/maint-1.6.0-send-email-irt: send-email: test --no-thread --in-reply-to combination send-email: respect in-reply-to regardless of threading Conflicts: t/t9001-send-email.sh
2009-03-21Merge branch 'mg/maint-submodule-normalize-path' into maintLibravatar Junio C Hamano2-3/+61
* mg/maint-submodule-normalize-path: git submodule: Fix adding of submodules at paths with ./, .. and // git submodule: Add test cases for git submodule add
2009-03-21Merge branch 'rs/memmem' into maintLibravatar Junio C Hamano2-11/+12
* rs/memmem: optimize compat/ memmem() diffcore-pickaxe: use memmem()
2009-03-21Merge branch 'js/rsync-local' into maintLibravatar Junio C Hamano2-27/+35
* js/rsync-local: rsync transport: allow local paths, and fix tests
2009-03-21Merge branch 'db/maint-missing-origin' into maintLibravatar Junio C Hamano3-8/+20
* db/maint-missing-origin: Remove total confusion from git-fetch and git-push Give error when no remote is configured
2009-03-21Merge branch 'jc/maint-1.6.0-read-tree-overlay' into maintLibravatar Junio C Hamano2-3/+34
* jc/maint-1.6.0-read-tree-overlay: read-tree A B C: do not create a bogus index and do not segfault
2009-03-21Merge branch 'js/maint-1.6.0-path-normalize' into maint-1.6.1Libravatar Junio C Hamano6-152/+115
* js/maint-1.6.0-path-normalize: Remove unused normalize_absolute_path() Test and fix normalize_path_copy() Fix GIT_CEILING_DIRECTORIES on Windows Move sanitary_path_copy() to path.c and rename it to normalize_path_copy() Make test-path-utils more robust against incorrect use
2009-03-21Merge branch 'jc/maint-1.6.0-pack-directory' into maint-1.6.1Libravatar Junio C Hamano7-27/+73
* jc/maint-1.6.0-pack-directory: Fix odb_mkstemp() on AIX Make sure objects/pack exists before creating a new pack Conflicts: wrapper.c
2009-03-21format-patch: --numbered-files and --stdout aren't mutually exclusiveLibravatar Stephen Boyd2-3/+0
For example: git format-patch --numbered-files --stdout --attach HEAD~~ will create two messages with files 1 and 2 attached respectively. Without --attach/--inline but with --stdout, --numbered-files option can be simply ignored, because we are not creating any file ourselves. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-19doc: clarify how -S worksLibravatar Jeff King1-1/+4
The existing text was very vague about what exactly it means for difference to "contain" a change. This seems to cause confusion on the mailing list every month or two. To fix it we: 1. use "introduce or remove an instance of" instead of "contain" 2. point the user to gitdiffcore(7), which contains a more complete explanation Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-16Remove total confusion from git-fetch and git-pushLibravatar Junio C Hamano1-18/+3
The config file is not the only place remotes are defined, and without consulting .git/remotes and .git/branches, you won't know if "origin" is configured by the user. Don't give up too early and insult the user with a wisecrack "Where do you want to fetch from today?" The only thing the previous patch seems to want to prevent from happening is a lazy "git fetch/push" that does not say where-from/to to produce an error message 'origin not found', and we can do that by not letting add_url_alias() to turn a nickname "origin" literally into a pathname "origin" without changing the rest of the logic. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-15GIT 1.6.2.1Libravatar Junio C Hamano2-7/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-12Merge branch 'maint-1.6.1' into maintLibravatar Junio C Hamano0-0/+0
* maint-1.6.1:
2009-03-12Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano4-38/+82
* maint-1.6.0: bisect: fix another instance of eval'ed string bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped Support "\" in non-wildcard exclusion entries Conflicts: git-bisect.sh
2009-03-12Merge branch 'en/maint-1.6.1-hash-object' into maint-1.6.1Libravatar Junio C Hamano1-2/+2
* en/maint-1.6.1-hash-object: Ensure proper setup of git_dir for git-hash-object
2009-03-12Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.0Libravatar Junio C Hamano22-10/+229
* ks/maint-1.6.0-mailinfo-folded: mailinfo: tests for RFC2047 examples mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)' mailinfo: 'From:' header should be unfold as well mailinfo: correctly handle multiline 'Subject:' header
2009-03-12Merge branch 'cc/maint-1.6.0-bisect-fix' into maint-1.6.0Libravatar Junio C Hamano2-36/+73
* cc/maint-1.6.0-bisect-fix: bisect: fix another instance of eval'ed string bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped
2009-03-12Merge branch 'fg/maint-1.6.0-exclude-bq' into maint-1.6.0Libravatar Junio C Hamano2-2/+9
* fg/maint-1.6.0-exclude-bq: Support "\" in non-wildcard exclusion entries
2009-03-12Merge branch 'js/maint-1.6.1-filter-branch-submodule' into maint-1.6.1Libravatar Junio C Hamano1-1/+1
* js/maint-1.6.1-filter-branch-submodule: filter-branch: do not consider diverging submodules a 'dirty worktree'
2009-03-12Merge branch 'gt/maint-1.6.1-utf8-width' into maint-1.6.1Libravatar Junio C Hamano3-5/+27
* gt/maint-1.6.1-utf8-width: builtin-blame.c: Use utf8_strwidth for author's names utf8: add utf8_strwidth()
2009-03-12Merge branch 'js/maint-1.6.1-remote-remove-mirror' into maint-1.6.1Libravatar Junio C Hamano2-7/+58
* js/maint-1.6.1-remote-remove-mirror: builtin-remote: make rm operation safer in mirrored repository builtin-remote: make rm() use properly named variable to hold return value
2009-03-12Merge branch 'ek/maint-1.6.1-filter-branch-bare' into maint-1.6.1Libravatar Junio C Hamano2-13/+16
* ek/maint-1.6.1-filter-branch-bare: filter-branch: Fix fatal error on bare repositories
2009-03-12Merge branch 'jc/maint-1.6.1-add-u-remove-conflicted' into maint-1.6.1Libravatar Junio C Hamano2-1/+69
* jc/maint-1.6.1-add-u-remove-conflicted: add -u: do not fail to resolve a path as deleted
2009-03-12Merge branch 'js/maint-1.6.1-rebase-i-submodule' into maint-1.6.1Libravatar Junio C Hamano2-5/+30
* js/maint-1.6.1-rebase-i-submodule: Fix submodule squashing into unrelated commit rebase -i squashes submodule changes into unrelated commit
2009-03-12Merge branch 'jc/maint-1.6.1-allow-uninteresting-missing' into maint-1.6.1Libravatar Junio C Hamano2-3/+44
* jc/maint-1.6.1-allow-uninteresting-missing: revision traversal: allow UNINTERESTING objects to be missing
2009-03-12Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.1Libravatar Junio C Hamano22-10/+229
* ks/maint-1.6.0-mailinfo-folded: mailinfo: tests for RFC2047 examples mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)' mailinfo: 'From:' header should be unfold as well mailinfo: correctly handle multiline 'Subject:' header
2009-03-12Merge branch 'jk/maint-1.6.1-cleanup-after-exec-failure' into maint-1.6.1Libravatar Junio C Hamano3-10/+30
* jk/maint-1.6.1-cleanup-after-exec-failure: git: use run_command() to execute dashed externals run_command(): help callers distinguish errors run_command(): handle missing command errors more gracefully git: s/run_command/run_builtin/
2009-03-12Merge branch 'jc/maint-1.6.0-split-diff-metainfo' into maint-1.6.0Libravatar Junio C Hamano2-66/+98
* jc/maint-1.6.0-split-diff-metainfo: diff.c: output correct index lines for a split diff
2009-03-12read-tree A B C: do not create a bogus index and do not segfaultLibravatar Junio C Hamano2-3/+34
"git read-tree A B C..." without the "-m" (merge) option is a way to read these trees on top of each other to get an overlay of them. An ancient commit ee6566e (Rewrite read-tree, 2005-09-05) passed the ADD_CACHE_SKIP_DFCHECK flag when calling add_index_entry() to add the paths obtained from these trees to the index, but it is an incorrect use of the flag. The flag is meant to be used by callers who know the addition of the entry does not introduce a D/F conflict to the index in order to avoid the overhead of checking. This bug resulted in a bogus index that records both "x" and "x/z" as a blob after reading three trees that have paths ("x"), ("x", "y"), and ("x/z", "y") respectively. 34110cd (Make 'unpack_trees()' have a separate source and destination index, 2008-03-06) refactored the callsites of add_index_entry() incorrectly and added more codepaths that use this flag when it shouldn't be used. Also, 0190457 (Move 'unpack_trees()' over to 'traverse_trees()' interface, 2008-03-05) introduced a bug to call add_index_entry() for the tree that does not have the path in it, passing NULL as a cache entry. This caused reading multiple trees, one of which has path "x" but another doesn't, to segfault. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-11send-email: test --no-thread --in-reply-to combinationLibravatar Thomas Rast1-0/+11
3e0c4ff (send-email: respect in-reply-to regardless of threading, 2009-03-01) fixed the handling of the In-Reply-To header when both --no-thread and --in-reply-to are in effect. Add a test for it. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-11Update draft release notes for 1.6.2.1Libravatar Junio C Hamano1-0/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>