From f1ec72ba1e52783179a7da7defaab0458c895617 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Wed, 28 Dec 2005 12:25:38 +0100 Subject: [PATCH 01/27] Fix skipping merge-order test with NO_OPENSSL=1. Move git-rev-list --merge-order usage check for 'OpenSSL not linked' after test 1; we cannot trigger this unless we try to actually use --merge-order by giving some ref, and we do not have any ref until we run the first test to create commits. Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano --- t/t6001-rev-list-merge-order.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t6001-rev-list-merge-order.sh b/t/t6001-rev-list-merge-order.sh index 368b8d9e025..7724e8a8c52 100755 --- a/t/t6001-rev-list-merge-order.sh +++ b/t/t6001-rev-list-merge-order.sh @@ -8,13 +8,6 @@ test_description='Tests git-rev-list --merge-order functionality' . ./test-lib.sh . ../t6000lib.sh # t6xxx specific functions -if git-rev-list --merge-order 2>&1 | grep 'OpenSSL not linked' >/dev/null -then - test_expect_success 'skipping merge-order test' : - test_done - exit -fi - # test-case specific test function check_adjacency() { @@ -114,6 +107,13 @@ test_output_expect_success 'rev-list has correct number of entries' 'git-rev-lis 19 EOF +if git-rev-list --merge-order HEAD 2>&1 | grep 'OpenSSL not linked' >/dev/null +then + test_expect_success 'skipping merge-order test' : + test_done + exit +fi + normal_adjacency_count=$(git-rev-list HEAD | check_adjacency | grep -c "\^" | tr -d ' ') merge_order_adjacency_count=$(git-rev-list --merge-order HEAD | check_adjacency | grep -c "\^" | tr -d ' ') test_expect_success '--merge-order produces as many or fewer discontinuities' '[ $merge_order_adjacency_count -le $normal_adjacency_count ]' From 89438677abaae1a8ffc3c0905f3355a590da7bf4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 Dec 2005 01:20:06 -0800 Subject: [PATCH 02/27] Documentation: spell. Signed-off-by: Junio C Hamano --- Documentation/cvs-migration.txt | 2 +- Documentation/diff-format.txt | 2 +- Documentation/diff-options.txt | 2 +- Documentation/git-add.txt | 2 +- Documentation/git-archimport.txt | 2 +- Documentation/git-diff-index.txt | 4 ++-- Documentation/git-diff-tree.txt | 2 +- Documentation/git-diff.txt | 2 +- Documentation/git-ls-files.txt | 2 +- Documentation/git-pack-objects.txt | 2 +- Documentation/git-repo-config.txt | 4 ++-- Documentation/git-rev-list.txt | 2 +- Documentation/git-show-branch.txt | 2 +- Documentation/git-svnimport.txt | 2 +- Documentation/glossary.txt | 2 +- Documentation/howto/isolate-bugs-with-bisect.txt | 2 +- Documentation/repository-layout.txt | 4 ++-- 17 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt index dc9387b697e..8fd1a33499b 100644 --- a/Documentation/cvs-migration.txt +++ b/Documentation/cvs-migration.txt @@ -138,7 +138,7 @@ mailing list archives for details). git has a couple of alternatives, though, that you may find sufficient or even superior depending on your use. One is called "git-whatchanged" (for obvious reasons) and the other one is called "pickaxe" ("a tool for -the software archeologist"). +the software archaeologist"). The "git-whatchanged" script is a truly trivial script that can give you a good overview of what has changed in a file or a directory (or an diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt index 97756ec0308..0398b408c05 100644 --- a/Documentation/diff-format.txt +++ b/Documentation/diff-format.txt @@ -117,7 +117,7 @@ git specific extension to diff format What -p option produces is slightly different from the traditional diff format. -1. It is preceeded with a "git diff" header, that looks like +1. It is preceded with a "git diff" header, that looks like this: diff --git a/file1 b/file2 diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 9e574a04d39..5c85167ff26 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -21,7 +21,7 @@ --abbrev[=]:: Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header - lines, show only handful dhexigits prefix. This is + lines, show only handful hexdigits prefix. This is independent of --full-index option above, which controls the diff-patch output format. Non default number of digits can be specified with --abbrev=. diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 4cae41267a9..89e461402e6 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -31,7 +31,7 @@ DISCUSSION ---------- The list of given to the command is fed to `git-ls-files` -command to list files that are not registerd in the index and +command to list files that are not registered in the index and are not ignored/excluded by `$GIT_DIR/info/exclude` file or `.gitignore` file in each directory. This means two things: diff --git a/Documentation/git-archimport.txt b/Documentation/git-archimport.txt index a2bd788f379..fe57fe1e92f 100644 --- a/Documentation/git-archimport.txt +++ b/Documentation/git-archimport.txt @@ -16,7 +16,7 @@ DESCRIPTION ----------- Imports a project from one or more Arch repositories. It will follow branches and repositories within the namespaces defined by the -parameters suppplied. If it cannot find the remote branch a merge comes from +parameters supplied. If it cannot find the remote branch a merge comes from it will just import it as a regular commit. If it can find it, it will mark it as a merge whenever possible (see discussion below). diff --git a/Documentation/git-diff-index.txt b/Documentation/git-diff-index.txt index dba6d30fcf6..5d2096a4c67 100644 --- a/Documentation/git-diff-index.txt +++ b/Documentation/git-diff-index.txt @@ -53,7 +53,7 @@ If '--cached' is specified, it allows you to ask: contents (the ones I'd write with a "git-write-tree") For example, let's say that you have worked on your working directory, updated -some files in the index and are ready to commit. You want to see eactly +some files in the index and are ready to commit. You want to see exactly *what* you are going to commit is without having to write a new tree object and compare it that way, and to do that, you just do @@ -110,7 +110,7 @@ NOTE: As with other commands of this type, "git-diff-index" does not actually look at the contents of the file at all. So maybe `kernel/sched.c` hasn't actually changed, and it's just that you touched it. In either case, it's a note that you need to -"git-upate-index" it to make the index be in sync. +"git-update-index" it to make the index be in sync. NOTE: You can have a mixture of files show up as "has been updated" and "is still dirty in the working directory" together. You can always diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index 9a2947e27dc..f2312f4d78a 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -62,7 +62,7 @@ separated with a single space are given. -s:: By default, "git-diff-tree --stdin" shows differences, either in machine-readable form (without '-p') or in patch - form (with '-p'). This output can be supressed. It is + form (with '-p'). This output can be suppressed. It is only useful with '-v' flag. -v:: diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index b04f393bc4a..ca416340226 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -67,7 +67,7 @@ $ git diff HEAD^ HEAD <3> <1> instead of using the tip of the current branch, compare with the tip of "test" branch. <2> instead of comparing with the tip of "test" branch, compare with -the tip of the curren branch, but limit the comparison to the +the tip of the current branch, but limit the comparison to the file "test". <3> compare the version before the last commit and the last commit. ------------ diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index 186f3bb57a6..e42af5ebe20 100644 --- a/Documentation/git-ls-files.txt +++ b/Documentation/git-ls-files.txt @@ -74,7 +74,7 @@ OPTIONS H:: cached M:: unmerged R:: removed/deleted - C:: modifed/changed + C:: modified/changed K:: to be killed ? other diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index 009ec5ab374..2d67d3911ed 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -46,7 +46,7 @@ base-name:: output of the command. --stdout:: - Write the pack contents (what would have been writtin to + Write the pack contents (what would have been written to .pack file) out to the standard output. --window and --depth:: diff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt index 5eefe02437c..306946412fe 100644 --- a/Documentation/git-repo-config.txt +++ b/Documentation/git-repo-config.txt @@ -21,9 +21,9 @@ You can query/set/replace/unset options with this command. The name is actually the section and the key separated by a dot, and the value will be escaped. -If you want to set/unset an option which can occor on multiple lines, you +If you want to set/unset an option which can occur on multiple lines, you should provide a POSIX regex for the value. If you want to handle the lines -*not* matching the regex, just prepend a single exlamation mark in front +*not* matching the regex, just prepend a single exclamation mark in front (see EXAMPLES). This command will fail if diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index 064ccb1f870..75c9968004b 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -129,7 +129,7 @@ the marked commit in the list. + Commits marked with (^) are not parents of the immediately preceding commit. These "breaks" represent necessary discontinuities implied by trying to -represent an arbtirary DAG in a linear form. +represent an arbitrary DAG in a linear form. + `--show-breaks` is only valid if `--merge-order` is also specified. diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt index ffe64d83533..5b76f3b99e2 100644 --- a/Documentation/git-show-branch.txt +++ b/Documentation/git-show-branch.txt @@ -85,7 +85,7 @@ Following these N lines, one-line log for each commit is displayed, indented N places. If a commit is on the I-th branch, the I-th indentation character shows a '+' sign; otherwise it shows a space. Each commit shows a short name that -can be used as an exended SHA1 to name that commit. +can be used as an extended SHA1 to name that commit. The following example shows three branches, "master", "fixes" and "mhf": diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt index f8dbee70961..6e342f581a4 100644 --- a/Documentation/git-svnimport.txt +++ b/Documentation/git-svnimport.txt @@ -40,7 +40,7 @@ OPTIONS -s :: Start importing at this SVN change number. The default is 1. + -When importing incementally, you might need to edit the .git/svn2git file. +When importing incrementally, you might need to edit the .git/svn2git file. -i:: Import-only: don't perform a checkout after importing. This option diff --git a/Documentation/glossary.txt b/Documentation/glossary.txt index 520f4c50fc1..2331be5a716 100644 --- a/Documentation/glossary.txt +++ b/Documentation/glossary.txt @@ -19,7 +19,7 @@ hash:: In git's context, synonym to object name. object database:: - Stores a set of "objects", and an individial object is identified + Stores a set of "objects", and an individual object is identified by its object name. The objects usually live in `$GIT_DIR/objects/`. blob object:: diff --git a/Documentation/howto/isolate-bugs-with-bisect.txt b/Documentation/howto/isolate-bugs-with-bisect.txt index 400949564da..edbcd4c6618 100644 --- a/Documentation/howto/isolate-bugs-with-bisect.txt +++ b/Documentation/howto/isolate-bugs-with-bisect.txt @@ -24,7 +24,7 @@ Then do git bisect bad master <- mark "master" as the bad state git bisect good ORIG_HEAD <- mark ORIG_HEAD as good (or whatever other known-good - thing you booted laste) + thing you booted last) and at this point "git bisect" will churn for a while, and tell you what the mid-point between those two commits are, and check that state out as diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt index 1b5f2282411..0347cabbb33 100644 --- a/Documentation/repository-layout.txt +++ b/Documentation/repository-layout.txt @@ -21,7 +21,7 @@ outside world but sometimes useful for private repository. . You can be using `objects/info/alternates` mechanism, or `$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow' objects from other object stores. A repository with this kind -of incompete object store is not suitable to be published for +of incomplete object store is not suitable to be published for use with dumb transports but otherwise is OK as long as `objects/info/alternates` points at the right object stores it borrows from. @@ -106,7 +106,7 @@ info/refs:: up-to-date if the repository is published for dumb transports. The `git-receive-pack` command, which is run on a remote repository when you `git push` into it, - runs `hooks/update` hook to help you achive this. + runs `hooks/update` hook to help you achieve this. info/grafts:: This file records fake commit ancestry information, to From 82f9d58a397e18e824eb0e16ee141e92fbd8d20b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 Dec 2005 01:30:08 -0800 Subject: [PATCH 03/27] code comments: spell Signed-off-by: Junio C Hamano --- date.c | 2 +- diff-index.c | 2 +- diff.c | 2 +- epoch.c | 2 +- ident.c | 2 +- ls-files.c | 2 +- pack-objects.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/date.c b/date.c index 3e11500eda5..3ede02777b9 100644 --- a/date.c +++ b/date.c @@ -326,7 +326,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt /* * NOTE! We will give precedence to day-of-month over month or - * year numebers in the 1-12 range. So 05 is always "mday 5", + * year numbers in the 1-12 range. So 05 is always "mday 5", * unless we already have a mday.. * * IOW, 01 Apr 05 parses as "April 1st, 2005". diff --git a/diff-index.c b/diff-index.c index 0054883a5e1..87e10619830 100644 --- a/diff-index.c +++ b/diff-index.c @@ -116,7 +116,7 @@ static int diff_cache(struct cache_entry **ac, int entries, const char **pathspe /* We come here with ce pointing at stage 1 * (original tree) and ac[1] pointing at stage * 3 (unmerged). show-modified with - * report-mising set to false does not say the + * report-missing set to false does not say the * file is deleted but reports true if work * tree does not have it, in which case we * fall through to report the unmerged state. diff --git a/diff.c b/diff.c index 66057e5d612..17d68fa699f 100644 --- a/diff.c +++ b/diff.c @@ -787,7 +787,7 @@ int diff_setup_done(struct diff_options *options) * so it is safe for us to do this here. Also * it does not smudge active_cache or active_nr * when it fails, so we do not have to worry about - * cleaning it up oufselves either. + * cleaning it up ourselves either. */ read_cache(); } diff --git a/epoch.c b/epoch.c index db44f5ca9f7..3a767486da3 100644 --- a/epoch.c +++ b/epoch.c @@ -190,7 +190,7 @@ static void free_mass_counter(struct mass_counter *counter) * enqueued, enqueuing the commit in a list of pending commits, in latest * commit date first order. * - * The algorithm then preceeds to visit each commit in the pending queue. + * The algorithm then proceeds to visit each commit in the pending queue. * Upon each visit, the pending mass is added to the mass already seen for that * commit and then divided into N equal portions, where N is the number of * parents of the commit being visited. The divided portions are then injected diff --git a/ident.c b/ident.c index ac1c27f1998..0461b8b2f81 100644 --- a/ident.c +++ b/ident.c @@ -140,7 +140,7 @@ static int copy(char *buf, int size, int offset, const char *src) /* * Copy the rest to the buffer, but avoid the special - * characters '\n' '<' and '>' that act as delimeters on + * characters '\n' '<' and '>' that act as delimiters on * a identification line */ for (i = 0; i < len; i++) { diff --git a/ls-files.c b/ls-files.c index 5e9ac712af0..cd87430127e 100644 --- a/ls-files.c +++ b/ls-files.c @@ -169,7 +169,7 @@ static int excluded_1(const char *pathname, } else { /* match with FNM_PATHNAME: - * exclude has base (baselen long) inplicitly + * exclude has base (baselen long) implicitly * in front of it. */ int baselen = x->baselen; diff --git a/pack-objects.c b/pack-objects.c index caf3b6be5a1..c3f25317bbe 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -119,7 +119,7 @@ static unsigned long write_one(struct sha1file *f, return offset; e->offset = offset; offset += write_object(f, e); - /* if we are delitified, write out its base object. */ + /* if we are deltified, write out its base object. */ if (e->delta) offset = write_one(f, e->delta, offset); return offset; From 4e7a2eccc21c9029180585e43b3b941d0bdf8b3b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 29 Dec 2005 01:31:26 -0800 Subject: [PATCH 04/27] ?alloc: do not return NULL when asked for zero bytes Signed-off-by: Junio C Hamano --- git-compat-util.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 0c98c9937df..c353b276f04 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -63,6 +63,8 @@ extern char *gitstrcasestr(const char *haystack, const char *needle); static inline void *xmalloc(size_t size) { void *ret = malloc(size); + if (!ret && !size) + ret = malloc(1); if (!ret) die("Out of memory, malloc failed"); return ret; @@ -71,6 +73,8 @@ static inline void *xmalloc(size_t size) static inline void *xrealloc(void *ptr, size_t size) { void *ret = realloc(ptr, size); + if (!ret && !size) + ret = realloc(ptr, 1); if (!ret) die("Out of memory, realloc failed"); return ret; @@ -79,6 +83,8 @@ static inline void *xrealloc(void *ptr, size_t size) static inline void *xcalloc(size_t nmemb, size_t size) { void *ret = calloc(nmemb, size); + if (!ret && (!nmemb || !size)) + ret = calloc(1, 1); if (!ret) die("Out of memory, calloc failed"); return ret; From 8b32572c74172dfc1b3c86f2940deb8f384b1bc4 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 31 Dec 2005 18:30:25 +0100 Subject: [PATCH 05/27] git-init-db(1): Describe --shared and the idempotent nature of init-db Based on the recent discussion on the mailing list. Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- Documentation/git-init-db.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt index 6deef925084..ea4d849aa3a 100644 --- a/Documentation/git-init-db.txt +++ b/Documentation/git-init-db.txt @@ -8,7 +8,7 @@ git-init-db - Creates an empty git repository SYNOPSIS -------- -'git-init-db' [--template=] +'git-init-db' [--template=] [--shared] OPTIONS @@ -16,6 +16,9 @@ OPTIONS --template=:: Provide the directory in from which templates will be used. +--shared:: + Specify that the git repository is to be shared amongst several users. + DESCRIPTION ----------- @@ -30,7 +33,16 @@ If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY` environment variable then the sha1 directories are created underneath - otherwise the default `$GIT_DIR/objects` directory is used. -`git-init-db` won't hurt an existing repository. +A shared repository allows users belonging to the same group to push into that +repository. When specifying `--shared` the config variable "core.sharedRepository" +is set to 'true' so that directories under `$GIT_DIR` are made group writable +(and g+sx, since the git group may be not the primary group of all users). + + +Running `git-init-db` in an existing repository is safe. It will not overwrite +things that are already there. The primary reason for rerunning `git-init-db` +is to pick up newly added templates. + EXAMPLES From 0a15217184f20649c0ab19b24363e35112a91beb Mon Sep 17 00:00:00 2001 From: Amos Waterland Date: Wed, 4 Jan 2006 19:31:02 -0500 Subject: [PATCH 06/27] AIX compile fix for repo-config.c AIX 5 has a /usr/include/regex.h containing this code: #ifdef _NO_PROTO extern char *regex(); extern char *regcmp(); #else /* _NO_PROTO */ extern char *regex(const char *, const char *, ...); extern char *regcmp(const char *, ...); #endif /* _NO_PROTO */ This means that repo-config.c is trying to redefine the `regex' symbol. Here is a simple patch that just uses `regexp' as the symbol name instead. Signed-off-by: Amos Waterland Signed-off-by: Junio C Hamano --- repo-config.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/repo-config.c b/repo-config.c index b2569b7901b..c31e441a3dd 100644 --- a/repo-config.c +++ b/repo-config.c @@ -6,7 +6,7 @@ static const char git_config_set_usage[] = static char* key = NULL; static char* value = NULL; -static regex_t* regex = NULL; +static regex_t* regexp = NULL; static int do_all = 0; static int do_not_match = 0; static int seen = 0; @@ -14,9 +14,9 @@ static int seen = 0; static int show_config(const char* key_, const char* value_) { if (!strcmp(key_, key) && - (regex == NULL || + (regexp == NULL || (do_not_match ^ - !regexec(regex, value_, 0, NULL, 0)))) { + !regexec(regexp, value_, 0, NULL, 0)))) { if (do_all) { printf("%s\n", value_); return 0; @@ -46,8 +46,8 @@ static int get_value(const char* key_, const char* regex_) regex_++; } - regex = (regex_t*)malloc(sizeof(regex_t)); - if (regcomp(regex, regex_, REG_EXTENDED)) { + regexp = (regex_t*)malloc(sizeof(regex_t)); + if (regcomp(regexp, regex_, REG_EXTENDED)) { fprintf(stderr, "Invalid pattern: %s\n", regex_); return -1; } @@ -59,9 +59,9 @@ static int get_value(const char* key_, const char* regex_) free(value); } free(key); - if (regex) { - regfree(regex); - free(regex); + if (regexp) { + regfree(regexp); + free(regexp); } if (do_all) From b73cebf437252660cea670c27dcdedc422e1bff9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 4 Jan 2006 19:33:55 -0800 Subject: [PATCH 07/27] Fix nasty approxidate bug Stupid me. If approxidate ends up with a month that is ahead of the current month, it decrements the year to last year. Which is correct, and means that "last december" does the right thing. HOWEVER. It should only do so if the year is the same as the current year. Without this fix, "5 days ago" ends up being in 2004, because it first decrements five days, getting us to December 2005 (correct), but then it also ends up decrementing the year once more to turn that December into "last year" (incorrect, since it already _was_ last year). Duh. Pass me a donut. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/date.c b/date.c index 3ede02777b9..416ea579a3e 100644 --- a/date.c +++ b/date.c @@ -640,7 +640,7 @@ unsigned long approxidate(const char *date) } if (number > 0 && number < 32) tm.tm_mday = number; - if (tm.tm_mon > now.tm_mon) + if (tm.tm_mon > now.tm_mon && tm.tm_year == now.tm_year) tm.tm_year--; return mktime(&tm); } From 7f272ca80c1dbb8157e204a821365448eaec52ea Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 09:56:37 +0100 Subject: [PATCH 08/27] trivial: retval of waitpid is not errno ...but is used as such and passed to strerror. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- fetch-clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch-clone.c b/fetch-clone.c index 2b2aa15ea77..f46fe6ecbb7 100644 --- a/fetch-clone.c +++ b/fetch-clone.c @@ -47,7 +47,7 @@ static int finish_pack(const char *pack_tmp_name, const char *me) if (retval < 0) { if (errno == EINTR) continue; - error("waitpid failed (%s)", strerror(retval)); + error("waitpid failed (%s)", strerror(errno)); goto error_die; } if (WIFSIGNALED(status)) { From 781411ed46400f95c45c5ca103769288025b39d6 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 09:58:06 +0100 Subject: [PATCH 09/27] trivial: O_EXCL makes O_TRUNC redundant Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- apply.c | 2 +- entry.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apply.c b/apply.c index d5e7bfdb4de..9eba034e5d7 100644 --- a/apply.c +++ b/apply.c @@ -1588,7 +1588,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf, if (S_ISLNK(mode)) return symlink(buf, path); - fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, (mode & 0100) ? 0777 : 0666); + fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666); if (fd < 0) return -1; while (size) { diff --git a/entry.c b/entry.c index 15b34eb6f9a..410b758aab7 100644 --- a/entry.c +++ b/entry.c @@ -60,7 +60,7 @@ static void remove_subtree(const char *path) static int create_file(const char *path, unsigned int mode) { mode = (mode & 0100) ? 0777 : 0666; - return open(path, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode); + return open(path, O_WRONLY | O_CREAT | O_EXCL, mode); } static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state) From d9e08be9d5b632aed84d4ee870543babafe6614b Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 10:00:12 +0100 Subject: [PATCH 10/27] fix potential deadlock in create_one_file It can happen if the temporary file already exists (i.e. after a panic and reboot). Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- apply.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apply.c b/apply.c index 9eba034e5d7..c471a82e836 100644 --- a/apply.c +++ b/apply.c @@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un } if (errno != EEXIST) break; - } + ++nr; + } } die("unable to write file %s mode %o", path, mode); } From 88fb958baa1066af23348c44a78b812be2344088 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:43:34 +0100 Subject: [PATCH 11/27] use result of open(2) to check for presence Not that the stat against open race would matter much in this context, but that simplifies the code a bit. Also some diagnostics added (why the open failed) Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- config.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index 992e9884079..8355224bb16 100644 --- a/config.c +++ b/config.c @@ -409,8 +409,7 @@ int git_config_set_multivar(const char* key, const char* value, const char* value_regex, int multi_replace) { int i; - struct stat st; - int fd; + int fd, in_fd; char* config_filename = strdup(git_path("config")); char* lock_file = strdup(git_path("config.lock")); const char* last_dot = strrchr(key, '.'); @@ -457,9 +456,17 @@ int git_config_set_multivar(const char* key, const char* value, /* * If .git/config does not exist yet, write a minimal version. */ - if (stat(config_filename, &st)) { + in_fd = open(config_filename, O_RDONLY); + if ( in_fd < 0 ) { free(store.key); + if ( ENOENT != errno ) { + error("opening %s: %s", config_filename, + strerror(errno)); + close(fd); + unlink(lock_file); + return 3; /* same as "invalid config file" */ + } /* if nothing to unset, error out */ if (value == NULL) { close(fd); @@ -471,7 +478,7 @@ int git_config_set_multivar(const char* key, const char* value, store_write_section(fd, key); store_write_pair(fd, key, value); } else{ - int in_fd; + struct stat st; char* contents; int i, copy_begin, copy_end, new_line = 0; @@ -528,7 +535,7 @@ int git_config_set_multivar(const char* key, const char* value, return 5; } - in_fd = open(config_filename, O_RDONLY, 0666); + fstat(in_fd, &st); contents = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, in_fd, 0); close(in_fd); From b6ae5409ea446365c328561dc17311111058ec26 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:44:59 +0100 Subject: [PATCH 12/27] trivial: typo in git-commit.sh Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- git-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-commit.sh b/git-commit.sh index 7e39c107cff..82d743bd037 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -148,7 +148,7 @@ esac if [ -f "$GIT_DIR/MERGE_HEAD" ]; then echo "#" - echo "# It looks like your may be committing a MERGE." + echo "# It looks like you may be committing a MERGE." echo "# If this is not correct, please remove the file" echo "# $GIT_DIR/MERGE_HEAD" echo "# and try again" From 50b4e0c178777a27164eb67676593255a9cbd035 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:44:18 +0100 Subject: [PATCH 13/27] trivial: clarify, what are the config's user.name and user.email about Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- Documentation/git-commit-tree.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt index a794192d7b5..41d1a1c4b34 100644 --- a/Documentation/git-commit-tree.txt +++ b/Documentation/git-commit-tree.txt @@ -60,7 +60,8 @@ either `.git/config` file, or using the following environment variables. (nb "<", ">" and "\n"s are stripped) -In `.git/config` file, the following items are used: +In `.git/config` file, the following items are used for GIT_AUTHOR_NAME and +GIT_AUTHOR_EMAIL: [user] name = "Your Name" From 31f883d1b8439b36d17ca79cf5eac992fb461f5a Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:46:16 +0100 Subject: [PATCH 14/27] trivial: remove the dots at the end of file names from merge-one-file to make the output more friendly to mouse copy-paste. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- git-merge-one-file.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index 7dee88a7337..5349a1c0fc5 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -82,7 +82,7 @@ case "${1:-.}${2:-.}${3:-.}" in expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig ;; *) - echo "Auto-merging $4." + echo "Auto-merging $4" orig=`git-unpack-file $1` ;; esac @@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in fi if [ $ret -ne 0 ]; then - echo "ERROR: Merge conflict in $4." + echo "ERROR: Merge conflict in $4" exit 1 fi exec git-update-index -- "$4" From e58b97af31779a4db84877082ef619f0e3bd1d6c Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:55:03 +0100 Subject: [PATCH 15/27] trivial: use git-repo-config to detect if the test can be run on the repository Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t4000-diff-format.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh index beb6d8f4877..67b9681d36e 100755 --- a/t/t4000-diff-format.sh +++ b/t/t4000-diff-format.sh @@ -26,6 +26,14 @@ rm -f path1 test_expect_success \ 'git-diff-files -p after editing work tree.' \ 'git-diff-files -p >current' + +# that's as far as it comes +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem' + test_done +fi + cat >expected <<\EOF diff --git a/path0 b/path0 old mode 100644 From b484ef28fbdc3e2ac242c37507eee5ace90f3915 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:55:58 +0100 Subject: [PATCH 16/27] trivial: use git-repo-config to detect how to run tests in the test repository Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t4006-diff-mode.sh | 20 +++++++++++++++----- t/t4102-apply-rename.sh | 9 +++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index e2a67e96338..8ad69d11155 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -15,11 +15,21 @@ test_expect_success \ tree=`git-write-tree` && echo $tree' -test_expect_success \ - 'chmod' \ - 'chmod +x rezrov && - git-update-index rezrov && - git-diff-index $tree >current' +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem, using update-index --chmod=+x' + test_expect_success \ + 'git-update-index --chmod=+x' \ + 'git-update-index rezrov && + git-update-index --chmod=+x rezrov && + git-diff-index $tree >current' +else + test_expect_success \ + 'chmod' \ + 'chmod +x rezrov && + git-update-index rezrov && + git-diff-index $tree >current' +fi _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index 0401d7bbc6e..fbb508d389e 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -31,7 +31,12 @@ test_expect_success setup \ test_expect_success apply \ 'git-apply --index --stat --summary --apply test-patch' -test_expect_success validate \ - 'test -f bar && ls -l bar | grep "^-..x......"' +if [ "$(git repo-config --get core.filemode)" = false ] +then + say 'filemode disabled on the filesystem' +else + test_expect_success validate \ + 'test -f bar && ls -l bar | grep "^-..x......"' +fi test_done From 10ae7d86c170554bc815ec460a83b608715063c1 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 17:38:58 +0100 Subject: [PATCH 17/27] trivial: .gitignore precompiled python modules Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6bd508e4be2..dbbef06c0a3 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,4 @@ git-core.spec *.exe libgit.a *.o +*.py[co] From 2ccd2027b012f481018b9a95929fa8df6ce1d33f Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:57:36 +0100 Subject: [PATCH 18/27] trivial: check, if t/trash directory was successfully created and was successfully entered. Otherwise git-init-db will create it directly in the working directory (t/) which can be dangerous. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index a97d259e26b..7534a762084 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -195,7 +195,7 @@ test -d ../templates/blt || { test=trash rm -fr "$test" mkdir "$test" -cd "$test" +cd "$test" || error "Cannot setup test environment" "$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null || error "cannot run git init-db -- have you built things yet?" From 6ff0b1c56c451445f7dc45b652a4dc60213eac19 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 5 Jan 2006 12:52:07 +0100 Subject: [PATCH 19/27] use GIT_DIR instead of /var/tmp Not every system (will not one microsoft windows system) have /var/tmp, whereas using GIT_DIR for random temporary files is more or less established. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- git-reset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-reset.sh b/git-reset.sh index eb44ee8cc19..6c9e58ad9a7 100755 --- a/git-reset.sh +++ b/git-reset.sh @@ -3,7 +3,7 @@ USAGE='[--mixed | --soft | --hard] []' . git-sh-setup -tmp=/var/tmp/reset.$$ +tmp=${GIT_DIR}/reset.$$ trap 'rm -f $tmp-*' 0 1 2 3 15 reset_type=--mixed From 353ce81597e831969ac37d6991346f8c39c1488e Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 31 Dec 2005 18:37:15 +0100 Subject: [PATCH 20/27] Wrap synopsis lines and use [verse] to keep formatting In addition, also fixes a few synopses to be more consistent and a gitlink. Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- Documentation/git-am.txt | 1 + Documentation/git-apply.txt | 5 ++++- Documentation/git-archimport.txt | 6 +++--- Documentation/git-cat-file.txt | 2 +- Documentation/git-checkout-index.txt | 3 ++- Documentation/git-clone.txt | 4 +++- Documentation/git-commit.txt | 4 +++- Documentation/git-cvsexportcommit.txt | 3 +-- Documentation/git-cvsimport.txt | 8 ++++---- Documentation/git-daemon.txt | 3 ++- Documentation/git-diff-tree.txt | 4 +++- Documentation/git-format-patch.txt | 6 ++++-- Documentation/git-fsck-objects.txt | 4 +++- Documentation/git-grep.txt | 3 +-- Documentation/git-http-fetch.txt | 4 ++-- Documentation/git-rev-list.txt | 23 ++++++++++++----------- 16 files changed, 49 insertions(+), 34 deletions(-) diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index a415fe24c3d..02cabc935e8 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -8,6 +8,7 @@ git-am - Apply a series of patches in a mailbox SYNOPSIS -------- +[verse] 'git-am' [--signoff] [--dotest=] [--utf8] [--binary] [--3way] ... 'git-am' [--skip | --resolved] diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index 626e281596c..51c7d470920 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -8,7 +8,10 @@ git-apply - Apply patch on a git index file and a work tree SYNOPSIS -------- -'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [...] +[verse] +'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] + [--no-add] [--index-info] [--allow-binary-replacement] [-z] + [...] DESCRIPTION ----------- diff --git a/Documentation/git-archimport.txt b/Documentation/git-archimport.txt index fe57fe1e92f..023d3ae7b96 100644 --- a/Documentation/git-archimport.txt +++ b/Documentation/git-archimport.txt @@ -8,9 +8,9 @@ git-archimport - Import an Arch repository into git SYNOPSIS -------- -`git-archimport` [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ] - [ -D depth ] [ -t tempdir ] - [ ] +[verse] +`git-archimport` [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir] + [ ] DESCRIPTION ----------- diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 9a7700fa7fa..504eb1b16a5 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -8,7 +8,7 @@ git-cat-file - Provide content or type information for repository objects SYNOPSIS -------- -'git-cat-file' (-t | -s | -e | ) +'git-cat-file' [-t | -s | -e | ] DESCRIPTION ----------- diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt index 9f32c65aaba..2a1e526c6a1 100644 --- a/Documentation/git-checkout-index.txt +++ b/Documentation/git-checkout-index.txt @@ -8,8 +8,9 @@ git-checkout-index - Copy files from the index to the working directory SYNOPSIS -------- +[verse] 'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=] - [--stage=] [--] ... + [--stage=] [--] ... DESCRIPTION ----------- diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 8410a6d3814..ffa4fb0a03b 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -8,7 +8,9 @@ git-clone - Clones a repository. SYNOPSIS -------- -'git-clone' [-l [-s]] [-q] [-n] [-u ] [] +[verse] +'git-clone' [-l [-s]] [-q] [-n] [-u ] + [] DESCRIPTION ----------- diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 8b91f221fe0..e0ff74f648f 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -7,7 +7,9 @@ git-commit - Record your changes SYNOPSIS -------- -'git-commit' [-a] [-s] [-v] [(-c | -C) | -F | -m ] [-e] [--] ... +[verse] +'git-commit' [-a] [-s] [-v] [(-c | -C) | -F | -m ] + [-e] [--] ... DESCRIPTION ----------- diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt index 91def2b5150..13cbf3ba67c 100644 --- a/Documentation/git-cvsexportcommit.txt +++ b/Documentation/git-cvsexportcommit.txt @@ -8,8 +8,7 @@ git-cvsexportcommit - Export a commit to a CVS checkout SYNOPSIS -------- -git-cvsexportcommmit.perl - [ -h ] [ -v ] [ -c ] [ -p ] [PARENTCOMMIT] COMMITID +'git-cvsexportcommmit' [-h] [-v] [-c] [-p] [PARENTCOMMIT] COMMITID DESCRIPTION diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index f89b251e1ec..01ca7ef96f1 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -8,10 +8,10 @@ git-cvsimport - Import a CVS repository into git SYNOPSIS -------- -'git-cvsimport' [ -o ] [ -h ] [ -v ] - [ -d ] [ -p ] - [ -C ] [ -i ] [ -P ] [ -k ] - [ -s ] [ -m ] [ -M regex ] [ ] +[verse] +'git-cvsimport' [-o ] [-h] [-v] [-d ] [-s ] + [-p ] [-C ] [-i] [-P ] + [-m] [-M regex] [] DESCRIPTION diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index 2a8f371ec95..33f3320e287 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -7,8 +7,9 @@ git-daemon - A really simple server for git repositories. SYNOPSIS -------- +[verse] 'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all] - [--timeout=n] [--init-timeout=n] [--strict-paths] [directory...] + [--timeout=n] [--init-timeout=n] [--strict-paths] [directory...] DESCRIPTION ----------- diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index f2312f4d78a..91fb1304971 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -8,7 +8,9 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object SYNOPSIS -------- -'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [--root] [] [] [...] +[verse] +'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] + [--root] [] [] [...] DESCRIPTION ----------- diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index d7ca2dbb229..47705de4fc4 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -8,7 +8,9 @@ git-format-patch - Prepare patches for e-mail submission. SYNOPSIS -------- -'git-format-patch' [-n | -k] [-o | --stdout] [-s] [-c] [--mbox] [--diff-options] [] +[verse] +'git-format-patch' [-n | -k] [-o | --stdout] [-s] [-c] [--mbox] + [--diff-options] [] DESCRIPTION ----------- @@ -96,7 +98,7 @@ git-format-patch -M -B origin:: See Also -------- -gitlink:git-am[1], gitlink:git-send-email +gitlink:git-am[1], gitlink:git-send-email[1] Author diff --git a/Documentation/git-fsck-objects.txt b/Documentation/git-fsck-objects.txt index bab1f6080c4..387b4354843 100644 --- a/Documentation/git-fsck-objects.txt +++ b/Documentation/git-fsck-objects.txt @@ -8,7 +8,9 @@ git-fsck-objects - Verifies the connectivity and validity of the objects in the SYNOPSIS -------- -'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache] [--standalone | --full] [--strict] [*] +[verse] +'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache] + [--standalone | --full] [--strict] [*] DESCRIPTION ----------- diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 01757934831..2bfd8edbc8e 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -8,7 +8,7 @@ git-grep - print lines matching a pattern SYNOPSIS -------- -'git-grep'