aboutsummaryrefslogtreecommitdiff
path: root/setup.c
Commit message (Collapse)AuthorAge
* Introduce core.sharedrepositoryJohannes Schindelin2005-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the config variable 'core.sharedrepository' is set, the directories $GIT_DIR/objects/ $GIT_DIR/objects/?? $GIT_DIR/objects/pack $GIT_DIR/refs $GIT_DIR/refs/heads $GIT_DIR/refs/heads/tags are set group writable (and g+s, since the git group may be not the primary group of all users). Since all files are written as lock files first, and then moved to their destination, they do not have to be group writable. Indeed, if this leads to problems you found a bug. Note that -- as in my first attempt -- the config variable is set in the function which checks the repository format. If this were done in git_default_config instead, a lot of programs would need to be modified to call git_config(git_default_config) first. [jc: git variables should be in environment.c unless there is a compelling reason to do otherwise.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/subdir'Junio C Hamano2005-11-30
|\
| * working from subdirectory: preparationJunio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | - prefix_filename() is like prefix_path() but can be used to name any file on the filesystem, not the files that might go into the index file. - setup_git_directory_gently() tries to find the GIT_DIR, but does not die() if called outside a git repository. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Do not attempt to access literal dirname "GIT_OBJECT_DIRECTORY".Tommi Virtanen2005-11-30
|/ | | | | | | Dereference the environment variable before using it. Signed-off-by: Tommi Virtanen <tv@inoi.fi> Signed-off-by: Junio C Hamano <junkio@cox.net>
* setup_git_directory(): check repository format version.Junio C Hamano2005-11-27
| | | | | | | | After figuring out the GIT_DIR location, make sure the repository is of the right vintage, by calling check_repository_format(). . Signed-off-by: Junio C Hamano <junkio@cox.net>
* Repository format version check.Junio C Hamano2005-11-27
| | | | | | | This adds the repository format version code, first done by Martin Atukunda. Signed-off-by: Junio C Hamano <junkio@cox.net>
* setup_git_directory: make sure GIT_DIR is a valid repository.Junio C Hamano2005-11-25
| | | | | | | | | | | setup_git_directory() always trusted what the user told where GIT_DIR was, and assumed that is a valid .git/ directory. This commit changes it to at least do the same level validation as is_toplevel_directory() does -- has refs/, has objects/ unless GIT_OBJECT_DIRECTORY is set, and has valid HEAD symlink or symref. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add git-symbolic-refJunio C Hamano2005-10-01
| | | | | | | | | | | | | This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
* Diff clean-up.Junio C Hamano2005-09-24
| | | | | | | This is a long overdue clean-up to the code for parsing and passing diff options. It also tightens some constness issues. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Retire support for old environment variables.Junio C Hamano2005-09-09
| | | | | | | | | | We have deprecated the old environment variable names for quite a while and now it's time to remove them. Gone are: SHA1_FILE_DIRECTORIES AUTHOR_DATE AUTHOR_EMAIL AUTHOR_NAME COMMIT_AUTHOR_EMAIL COMMIT_AUTHOR_NAME SHA1_FILE_DIRECTORY Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Make .git directory validation code test HEADLinus Torvalds2005-08-27
| | | | | | | | | | | | | | | | | | | | | | | Inspired by a report by Kalle Valo, this changes git-sh-setup-script and the "setup_git_directory()" function to test that $GIT_DIR/HEAD is a symlink, since a number of core git features depend on that these days. We used to allow a regular file there, but git-fsck-cache has been complaining about that for a while, and anything that uses branches depends on the HEAD file being a symlink, so let's just encode that as a fundamental requirement. Before, a non-symlink HEAD file would appear to work, but have subtle bugs like not having the HEAD show up as a valid reference (because it wasn't under "refs"). Now, we will complain loudly, and the user can fix it up trivially instead of getting strange behaviour. This also removes the tests for "$GIT_DIR" and "$GIT_OBJECT_DIRECTORY" being directories, since the other tests will implicitly test for that anyway (ie the tests for HEAD, refs and 00 would fail). Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Export relative path handling "prefix_path()" functionLinus Torvalds2005-08-17
| | | | | | | | | Not all programs necessarily have a pathspec array of pathnames, some of them (like git-update-cache) want to do things one file at a time. So export the single-path interface too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Improve handling of "." and ".." in git-diff-*Linus Torvalds2005-08-16
| | | | | | | | | | | | | This fixes up usage of ".." (without an ending slash) and "." (with or without the ending slash) in the git diff family. It also fixes pathspec matching for the case of an empty pathspec, since a "." in the top-level directory (or enough ".." under subdirectories) will result in an empty pathspec. We used to not match it against anything, but it should in fact match everything. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Fix test failure due to overly strict .git directory testsLinus Torvalds2005-08-16
| | | | | | | | We may not actually have a valid HEAD at all times, so relax the validity tests for a .git subdirectory accordingly. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Make "git diff" work inside relative subdirectoriesLinus Torvalds2005-08-16
We always show the diff as an absolute path, but pathnames to diff are taken relative to the current working directory (and if no pathnames are given, the default ends up being all of the current working directory). Note that "../xyz" also works, so you can do cd linux/drivers/char git diff ../block and it will generate a diff of the linux/drivers/block changes. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>