diff options
46 files changed, 259 insertions, 96 deletions
diff --git a/Documentation/RelNotes-1.6.6.2.txt b/Documentation/RelNotes-1.6.6.2.txt new file mode 100644 index 0000000000..4eaddc0106 --- /dev/null +++ b/Documentation/RelNotes-1.6.6.2.txt @@ -0,0 +1,46 @@ +Git v1.6.6.2 Release Notes +========================== + +Fixes since v1.6.6.1 +-------------------- + + * recursive merge didn't correctly diagnose its own programming errors, + and instead caused the caller to segfault. + + * The new "smart http" aware clients probed the web servers to see if + they support smart http, but did not fall back to dumb http transport + correctly with some servers. + + * Time based reflog syntax e.g. "@{yesterday}" didn't diagnose a misspelled + time specification and instead assumed "@{now}". + + * "git archive HEAD -- no-such-directory" produced an empty archive + without complaining. + + * "git blame -L start,end -- file" misbehaved when given a start that is + larger than the number of lines in the file. + + * "git checkout -m" didn't correctly call custom merge backend supplied + by the end user. + + * "git config -f <file>" misbehaved when run from a subdirectory. + + * "git cvsserver" didn't like having regex metacharacters (e.g. '+') in + CVSROOT environment. + + * "git fast-import" did not correctly handle large blobs that may + bust the pack size limit. + + * "git gui" is supposed to work even when launched from inside a .git + directory. + + * "git gui" misbehaved when applying a hunk that ends with deletion. + + * "git imap-send" did not honor imap.preformattedHTML as documented. + + * "git log" family incorrectly showed the commit notes unconditionally by + mistake, which was especially irritating when running "git log --oneline". + + * "git status" shouldn't require an write access to the repository. + +Other minor documentation updates are included. diff --git a/Documentation/RelNotes-1.7.0.1.txt b/Documentation/RelNotes-1.7.0.1.txt new file mode 100644 index 0000000000..312a3f5534 --- /dev/null +++ b/Documentation/RelNotes-1.7.0.1.txt @@ -0,0 +1,31 @@ +Git v1.7.0.1 Release Notes +========================== + +Fixes since v1.7.0 +------------------ + + * In a freshly created repository "rev-parse HEAD^0" complained that + it is dangling symref, even though "rev-parse HEAD" didn't. + + * Message from "git cherry-pick" was harder to read and use than necessary + when it stopped due to conflicting changes. + + * "git diff --output=/path/that/cannot/be/written" did not correctly + error out. + + * "git grep -e -pattern-that-begin-with-dash paths..." could not be + spelled as "git grep -- -pattern-that-begin-with-dash paths..." which + would be a GNU way to use "--" as "end of options". + + * "git grep" compiled with threading support tried to access an + uninitialized mutex on boxes with a single CPU. + + * "git stash pop -q --index" failed because the unnecessary --index + option was propagated to "git stash drop" that is internally run at the + end. + +-- +exec >/var/tmp/1 +echo O=$(git describe) +O=v1.7.0-11-g354d9f8 +git shortlog $O.. diff --git a/Documentation/RelNotes-1.7.0.txt b/Documentation/RelNotes-1.7.0.txt index 0897287979..43e3f33615 100644 --- a/Documentation/RelNotes-1.7.0.txt +++ b/Documentation/RelNotes-1.7.0.txt @@ -4,7 +4,7 @@ Git v1.7.0 Release Notes Notes on behaviour change ------------------------- - * "git push" into a branch that is currently checked out (i.e. pointed by + * "git push" into a branch that is currently checked out (i.e. pointed at by HEAD in a repository that is not bare) is refused by default. Similarly, "git push $there :$killed" to delete the branch $killed @@ -19,7 +19,7 @@ Notes on behaviour change patch series with more than two messages. All messages will be sent as a reply to the first message, i.e. cover letter. - It has been possible to configure send-email to send "shallow thread" + It has been possible already to configure send-email to send "shallow thread" by setting sendemail.chainreplyto configuration variable to false. The only thing this release does is to change the default when you haven't configured that variable. @@ -30,7 +30,7 @@ Notes on behaviour change * "git diff" traditionally treated various "ignore whitespace" options only as a way to filter the patch output. "git diff --exit-code -b" exited with non-zero status even if all changes were about changing the - ammount of whitespace and nothing else. and "git diff -b" showed the + amount of whitespace and nothing else; and "git diff -b" showed the "diff --git" header line for such a change without patch text. In this release, the "ignore whitespaces" options affect the semantics @@ -63,7 +63,7 @@ Updates since v1.6.6 * "git svn" support of subversion "merge tickets" and miscellaneous fixes. - * "gitk" updates. + * "gitk" and "git gui" translation updates. * "gitweb" updates (code clean-up, load checking etc.) @@ -106,7 +106,9 @@ Updates since v1.6.6 defaults to the current branch, so "git fetch && git merge @{upstream}" will be equivalent to "git pull". - * "git branch --set-upstream" can be used to update the (surprise!) upstream + * "git am --resolved" has a synonym "git am --continue". + + * "git branch --set-upstream" can be used to update the (surprise!) upstream, i.e. where the branch is supposed to pull and merge from (or rebase onto). * "git checkout A...B" is a way to detach HEAD at the merge base between @@ -133,7 +135,7 @@ Updates since v1.6.6 * "git fetch --all" can now be used in place of "git remote update". * "git grep" does not rely on external grep anymore. It can use more than - one threads to accelerate the operation. + one thread to accelerate the operation. * "git grep" learned "--quiet" option. @@ -159,13 +161,13 @@ Updates since v1.6.6 * "git rebase --onto A...B" means the history is replayed on top of the merge base between A and B. - * "git rebase -i" learned new action "fixup", that squashes the change + * "git rebase -i" learned new action "fixup" that squashes the change but does not affect existing log message. - * "git rebase -i" also learned --autosquash option, that is useful + * "git rebase -i" also learned --autosquash option that is useful together with the new "fixup" action. - * "git remote" learned set-url subcommand, to update (surprise!) url + * "git remote" learned set-url subcommand that updates (surprise!) url for an existing remote nickname. * "git rerere" learned "forget path" subcommand. Together with "git @@ -200,13 +202,8 @@ release, unless otherwise noted. the branch is fully merged to its upstream branch if it is not merged to the current branch. It now deletes it in such a case. - * "git config -f <relative path>" run from a subdirectory misbehaved. - 65807ee (builtin-config: Fix crash when using "-f <relative path>" - from non-root dir, 2010-01-26) may be merged to older maintenance - branches. - - * "git fast-import" did not correctly handle large blobs that may - bust the pack size limit. + * "fiter-branch" command incorrectly said --prune-empty and --filter-commit + were incompatible; the latter should be read as --commit-filter. * When using "git status" or asking "git diff" to compare the work tree with something, they used to consider that a checked-out submodule with @@ -215,9 +212,3 @@ release, unless otherwise noted. superproject. They now consider such a change as a modification and "git diff" will append a "-dirty" to the work tree side when generating patch output or when used with the --submodule option. - --- -exec >/var/tmp/1 -O=v1.7.0-rc1-42-g3bd8de5 -echo O=$(git describe master) -git shortlog --no-merges $O..master ^maint diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index f74fcf3737..51cbeb7032 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -153,7 +153,7 @@ EXAMPLES and its subdirectories: + ------------ -$ git add Documentation/\\*.txt +$ git add Documentation/\*.txt ------------ + Note that the asterisk `\*` is quoted from the shell in this diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index c3e4f12c44..c66c565bbe 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -15,7 +15,7 @@ SYNOPSIS [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>] [--reject] [-q | --quiet] [--scissors | --no-scissors] [<mbox> | <Maildir>...] -'git am' (--skip | --resolved | --abort) +'git am' (--continue | --skip | --abort) DESCRIPTION ----------- @@ -107,6 +107,7 @@ default. You can use `--no-utf8` to override this. Skip the current patch. This is only meaningful when restarting an aborted patch. +--continue:: -r:: --resolved:: After a patch failure (e.g. attempting to apply diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index 799c8b64bd..8d3e66626f 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -112,6 +112,14 @@ export-subst:: expand several placeholders when adding this file to an archive. See linkgit:gitattributes[5] for details. +Note that attributes are by default taken from the `.gitattributes` files +in the tree that is being archived. If you want to tweak the way the +output is generated after the fact (e.g. you committed without adding an +appropriate export-ignore in its `.gitattributes`), adjust the checked out +`.gitattributes` file as necessary and use `--work-tree-attributes` +option. Alternatively you can keep necessary attributes that should apply +while archiving any tree in your `$GIT_DIR/info/attributes` file. + EXAMPLES -------- git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -):: diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt index d9a3326f58..e1c4320f02 100644 --- a/Documentation/git-check-ref-format.txt +++ b/Documentation/git-check-ref-format.txt @@ -43,7 +43,7 @@ imposes the following rules on how references are named: . They cannot contain a sequence `@{`. -- They cannot contain a `\\`. +. They cannot contain a `\`. These rules make it easy for shell script based tools to parse reference names, pathname expansion by the shell when a reference name is used diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 73a921ca0f..bd79119dd3 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -176,12 +176,17 @@ If --porcelain is used, then each line of the output is of the form: <flag> \t <from>:<to> \t <summary> (<reason>) ------------------------------- +The status of up-to-date refs is shown only if --porcelain or --verbose +option is used. + flag:: - A single character indicating the status of the ref. This is - blank for a successfully pushed ref, `!` for a ref that was - rejected or failed to push, and '=' for a ref that was up to - date and did not need pushing (note that the status of up to - date refs is shown only when `git push` is running verbosely). + A single character indicating the status of the ref: +(space);; for a successfully pushed fast-forward; +`{plus}`;; for a successful forced update; +`-`;; for a successfully deleted ref; +`*`;; for a successfully pushed new ref; +`!`;; for a ref that was rejected or failed to push; and +`=`;; for a ref that was up to date and did not need pushing. summary:: For a successfully pushed ref, the summary shows the old and new diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index fc731525da..d677c72d5e 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -244,7 +244,7 @@ when you run 'git merge'. * The special construct '@\{-<n>\}' means the <n>th branch checked out before the current one. -* The suffix '@{upstream}' to a ref (short form 'ref@{u}') refers to +* The suffix '@\{upstream\}' to a ref (short form 'ref@\{u\}') refers to the branch the ref is set to build on top of. Missing ref defaults to the current branch. diff --git a/Documentation/git.txt b/Documentation/git.txt index 8c5f5b05cb..01c463101b 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,15 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.6.6.1/git.html[documentation for release 1.6.6.1] +* link:v1.7.0/git.html[documentation for release 1.7.0] * release notes for + link:RelNotes-1.7.0.txt[1.7.0]. + +* link:v1.6.6.2/git.html[documentation for release 1.6.6.2] + +* release notes for + link:RelNotes-1.6.6.2.txt[1.6.6.2], link:RelNotes-1.6.6.1.txt[1.6.6.1], link:RelNotes-1.6.6.txt[1.6.6]. diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index a7d8c63427..a668143d7a 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.6.6.GIT +DEF_VER=v1.7.0.GIT LF=' ' @@ -1 +1 @@ -Documentation/RelNotes-1.7.0.txt
\ No newline at end of file +Documentation/RelNotes-1.7.0.1.txt
\ No newline at end of file diff --git a/builtin-apply.c b/builtin-apply.c index 2a1004d025..3af4ae0c26 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2006,7 +2006,7 @@ static int find_pos(struct image *img, return -1; /* - * If match_begining or match_end is specified, there is no + * If match_beginning or match_end is specified, there is no * point starting from a wrong line that will never match and * wander around and wait for a match at the specified end. */ diff --git a/builtin-blame.c b/builtin-blame.c index 6408ec8ee6..10f7eacf6e 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -2433,7 +2433,7 @@ parse_done: if (top < 1) top = lno; bottom--; - if (lno < top) + if (lno < top || lno < bottom) die("file %s has only %lu lines", path, lno); ent = xcalloc(1, sizeof(*ent)); diff --git a/builtin-cat-file.c b/builtin-cat-file.c index 5906842008..a933eaa043 100644 --- a/builtin-cat-file.c +++ b/builtin-cat-file.c @@ -219,9 +219,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix) "exit with zero when there's no error", 'e'), OPT_SET_INT('p', NULL, &opt, "pretty-print object's content", 'p'), OPT_SET_INT(0, "batch", &batch, - "show info and content of objects feeded on stdin", BATCH), + "show info and content of objects fed from the standard input", + BATCH), OPT_SET_INT(0, "batch-check", &batch, - "show info about objects feeded on stdin", + "show info about objects fed from the standard input", BATCH_CHECK), OPT_END() }; diff --git a/builtin-grep.c b/builtin-grep.c index 26d4deb1cc..26979577d3 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -408,15 +408,25 @@ static int pathspec_matches(const char **paths, const char *name, int max_depth) return 0; } +static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size) +{ + void *data; + + if (use_threads) { + read_sha1_lock(); + data = read_sha1_file(sha1, type, size); + read_sha1_unlock(); + } else { + data = read_sha1_file(sha1, type, size); + } + return data; +} + static void *load_sha1(const unsigned char *sha1, unsigned long *size, const char *name) { enum object_type type; - char *data; - - read_sha1_lock(); - data = read_sha1_file(sha1, &type, size); - read_sha1_unlock(); + void *data = lock_and_read_sha1_file(sha1, &type, size); if (!data) error("'%s': unable to read %s", name, sha1_to_hex(sha1)); @@ -605,10 +615,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths, void *data; unsigned long size; - read_sha1_lock(); - data = read_sha1_file(entry.sha1, &type, &size); - read_sha1_unlock(); - + data = lock_and_read_sha1_file(entry.sha1, &type, &size); if (!data) die("unable to read tree (%s)", sha1_to_hex(entry.sha1)); @@ -861,6 +868,16 @@ int cmd_grep(int argc, const char **argv, const char *prefix) PARSE_OPT_STOP_AT_NON_OPTION | PARSE_OPT_NO_INTERNAL_HELP); + /* + * skip a -- separator; we know it cannot be + * separating revisions from pathnames if + * we haven't even had any patterns yet + */ + if (argc > 0 && !opt.pattern_list && !strcmp(argv[0], "--")) { + argv++; + argc--; + } + /* First unrecognized non-option token */ if (argc > 0 && !opt.pattern_list) { append_grep_pattern(&opt, argv[0], "command line", 0, diff --git a/builtin-log.c b/builtin-log.c index 8d16832f7e..e0d5caa61b 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -1089,7 +1089,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) /* * We cannot move this anywhere earlier because we do want to - * know if --root was given explicitly from the comand line. + * know if --root was given explicitly from the command line. */ rev.show_root_diff = 1; diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index dcfe62aa02..e1d3adf405 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -445,13 +445,9 @@ static int write_one(struct sha1file *f, if (e->idx.offset || e->preferred_base) return -1; - /* - * If we are deltified, attempt to write out base object first. - * If that fails due to the pack size limit then the current - * object might still possibly fit undeltified within that limit. - */ - if (e->delta) - write_one(f, e->delta, offset); + /* if we are deltified, write out base object first. */ + if (e->delta && !write_one(f, e->delta, offset)) + return 0; e->idx.offset = *offset; size = write_object(f, e, *offset); @@ -505,9 +501,11 @@ static void write_pack_file(void) sha1write(f, &hdr, sizeof(hdr)); offset = sizeof(hdr); nr_written = 0; - for (i = 0; i < nr_objects; i++) - if (write_one(f, objects + i, &offset) == 1) - display_progress(progress_state, written); + for (; i < nr_objects; i++) { + if (!write_one(f, objects + i, &offset)) + break; + display_progress(progress_state, written); + } /* * Did we write the wrong # entries in the header? @@ -582,7 +580,7 @@ static void write_pack_file(void) written_list[j]->offset = (off_t)-1; } nr_remaining -= nr_written; - } while (nr_remaining); + } while (nr_remaining && i < nr_objects); free(written_list); stop_progress(&progress_state); diff --git a/builtin-prune.c b/builtin-prune.c index 8459aec8e8..4675f6054f 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -106,7 +106,7 @@ static void prune_object_dir(const char *path) /* * Write errors (particularly out of space) can result in * failed temporary packs (and more rarely indexes and other - * files begining with "tmp_") accumulating in the object + * files beginning with "tmp_") accumulating in the object * and the pack directories. */ static void remove_temporary_files(const char *path) diff --git a/builtin-show-branch.c b/builtin-show-branch.c index 9f13caa76d..35a709e630 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -567,7 +567,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb) return config_error_nonbool(var); /* * default_arg is now passed to parse_options(), so we need to - * mimick the real argv a bit better. + * mimic the real argv a bit better. */ if (!default_num) { default_alloc = 20; diff --git a/compat/win32/pthread.c b/compat/win32/pthread.c index 5fc1670bee..0f949fc425 100644 --- a/compat/win32/pthread.c +++ b/compat/win32/pthread.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2009 Andrzej K. Haczewski <ahaczewski@gmail.com> * - * DISCLAMER: The implementation is Git-specific, it is subset of original + * DISCLAIMER: The implementation is Git-specific, it is subset of original * Pthreads API, without lots of other features that Git doesn't use. * Git also makes sure that the passed arguments are valid, so there's * no need for double-checking. @@ -504,7 +504,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig, /* * Don't do destructive transforms with git:// as that - * protocol code does '[]' dewrapping of its own. + * protocol code does '[]' unwrapping of its own. */ if (host[0] == '[') { end = strchr(host + 1, ']'); diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 35acad004e..fe93747c93 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -667,7 +667,7 @@ _git_am () { local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)" if [ -d "$dir"/rebase-apply ]; then - __gitcomp "--skip --resolved --abort" + __gitcomp "--skip --continue --resolved --abort" return fi case "$cur" in diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl index 5782d80e26..3a5da4ab00 100755 --- a/contrib/fast-import/import-directories.perl +++ b/contrib/fast-import/import-directories.perl @@ -344,7 +344,7 @@ sub parsekeyvaluepair Key and value strings may be enclosed in quotes, in which case whitespace inside the quotes is preserved. Additionally, an equal -sign may be included in the key by preceeding it with a backslash. +sign may be included in the key by preceding it with a backslash. For example: "key1 "=value1 @@ -407,7 +407,7 @@ static void parse_host_and_port(char *hostport, char **host, end = strchr(hostport, ']'); if (!end) - die("Invalid reqeuest ('[' without ']')"); + die("Invalid request ('[' without ']')"); *end = '\0'; *host = hostport + 1; if (!end[1]) @@ -2893,6 +2893,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) ; else if (!prefixcmp(arg, "--output=")) { options->file = fopen(arg + strlen("--output="), "w"); + if (!options->file) + die_errno("Could not open '%s'", arg + strlen("--output=")); options->close_file = 1; } else return 0; @@ -3642,7 +3644,7 @@ static void diffcore_skip_stat_unmatch(struct diff_options *diffopt) struct diff_filepair *p = q->queue[i]; /* - * 1. Entries that come from stat info dirtyness + * 1. Entries that come from stat info dirtiness * always have both sides (iow, not create/delete), * one side of the object name is unknown, with * the same mode and size. Keep the ones that @@ -25,7 +25,8 @@ p= pass it through git-apply patch-format= format the patch(es) are in reject pass it through git-apply resolvemsg= override error message when patch failure occurs -r,resolved to be used after a patch failure +continue continue applying patches after resolving a conflict +r,resolved synonyms for --continue skip skip the current patch abort restore the original branch and abort the patching operation. committer-date-is-author-date lie about committer date @@ -318,7 +319,7 @@ do scissors=t ;; --no-scissors) scissors=f ;; - -r|--resolved) + -r|--resolved|--continue) resolved=t ;; --skip) skip=t ;; diff --git a/git-filter-branch.sh b/git-filter-branch.sh index e95845c0d6..88fb0f070e 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -207,7 +207,7 @@ t,) ,*) ;; *) - die "Cannot set --prune-empty and --filter-commit at the same time" + die "Cannot set --prune-empty and --commit-filter at the same time" esac case "$force" in diff --git a/git-stash.sh b/git-stash.sh index 3a0685f189..2d69196393 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -221,6 +221,7 @@ show_stash () { } apply_stash () { + applied_stash= unstash_index= while test $# != 0 @@ -242,6 +243,9 @@ apply_stash () { if test $# = 0 then have_stash || die 'Nothing to apply' + applied_stash="$ref_stash@{0}" + else + applied_stash="$*" fi # stash records the work tree, and is a merge between the @@ -415,8 +419,7 @@ pop) shift if apply_stash "$@" then - test -z "$unstash_index" || shift - drop_stash "$@" + drop_stash "$applied_stash" fi ;; branch) @@ -527,7 +527,7 @@ int main(int argc, const char **argv) break; if (was_alias) { fprintf(stderr, "Expansion of alias '%s' failed; " - "'%s' is not a git-command\n", + "'%s' is not a git command\n", cmd, argv[0]); exit(1); } @@ -350,7 +350,7 @@ const char *help_unknown_cmd(const char *cmd) return assumed; } - fprintf(stderr, "git: '%s' is not a git-command. See 'git --help'.\n", cmd); + fprintf(stderr, "git: '%s' is not a git command. See 'git --help'.\n", cmd); if (SIMILAR_ENOUGH(best_similarity)) { fprintf(stderr, "\nDid you mean %s?\n", diff --git a/imap-send.c b/imap-send.c index 51f371ba9f..ba72fa4b6e 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1331,11 +1331,16 @@ static int git_imap_config(const char *key, const char *val, void *cb) if (strncmp(key, imap_key, sizeof imap_key - 1)) return 0; - if (!val) - return config_error_nonbool(key); - key += sizeof imap_key - 1; + /* check booleans first, and barf on others */ + if (!strcmp("sslverify", key)) + server.ssl_verify = git_config_bool(key, val); + else if (!strcmp("preformattedhtml", key)) + server.use_html = git_config_bool(key, val); + else if (!val) + return config_error_nonbool(key); + if (!strcmp("folder", key)) { imap_folder = xstrdup(val); } else if (!strcmp("host", key)) { @@ -1356,10 +1361,6 @@ static int git_imap_config(const char *key, const char *val, void *cb) server.port = git_config_int(key, val); else if (!strcmp("tunnel", key)) server.tunnel = xstrdup(val); - else if (!strcmp("sslverify", key)) - server.ssl_verify = git_config_bool(key, val); - else if (!strcmp("preformattedHTML", key)) - server.use_html = git_config_bool(key, val); return 0; } diff --git a/levenshtein.h b/levenshtein.h index 0173abeef5..4105bf3549 100644 --- a/levenshtein.h +++ b/levenshtein.h @@ -2,7 +2,7 @@ #define LEVENSHTEIN_H int levenshtein(const char *string1, const char *string2, - int swap_penalty, int substition_penalty, + int swap_penalty, int substitution_penalty, int insertion_penalty, int deletion_penalty); #endif @@ -610,7 +610,7 @@ int daemon_avoid_alias(const char *p) /* * This resurrects the belts and suspenders paranoia check by HPA * done in <435560F7.4080006@zytor.com> thread, now enter_repo() - * does not do getcwd() based path canonicalizations. + * does not do getcwd() based path canonicalization. * * sl becomes true immediately after seeing '/' and continues to * be true as long as dots continue after that without intervening diff --git a/perl/Git.pm b/perl/Git.pm index e8df55d2f2..970fe434ed 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -204,14 +204,14 @@ sub repository { $dir = $opts{Directory}; unless (-d "$dir/refs" and -d "$dir/objects" and -e "$dir/HEAD") { - # Mimick git-rev-parse --git-dir error message: + # Mimic git-rev-parse --git-dir error message: throw Error::Simple("fatal: Not a git repository: $dir"); } my $search = Git->repository(Repository => $dir); try { $search->command('symbolic-ref', 'HEAD'); } catch Git::Error::Command with { - # Mimick git-rev-parse --git-dir error message: + # Mimic git-rev-parse --git-dir error message: throw Error::Simple("fatal: Not a git repository: $dir"); } @@ -706,7 +706,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern, has_glob_specials = strpbrk(pattern, "?*["); if (!has_glob_specials) { - /* Append impiled '/' '*' if not present. */ + /* Append implied '/' '*' if not present. */ if (real_pattern.buf[real_pattern.len - 1] != '/') strbuf_addch(&real_pattern, '/'); /* No need to check for '*', there is none. */ @@ -206,7 +206,7 @@ int is_inside_work_tree(void) } /* - * set_work_tree() is only ever called if you set GIT_DIR explicitely. + * set_work_tree() is only ever called if you set GIT_DIR explicitly. * The old behaviour (which we retain here) is to set the work tree root * to the cwd, unless overridden by the config, the command line, or * GIT_WORK_TREE. diff --git a/sha1_name.c b/sha1_name.c index 77299257bf..43884c69b3 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -280,8 +280,7 @@ int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref) *ref = xstrdup(r); if (!warn_ambiguous_refs) break; - } else if ((flag & REF_ISSYMREF) && - (len != 4 || strcmp(str, "HEAD"))) + } else if ((flag & REF_ISSYMREF) && strcmp(fullref, "HEAD")) warning("ignoring dangling symref %s.", fullref); } free(last_branch); diff --git a/t/t3902-quoted.sh b/t/t3902-quoted.sh index 14da45fe5a..29103f65dc 100755 --- a/t/t3902-quoted.sh +++ b/t/t3902-quoted.sh @@ -25,7 +25,7 @@ for_each_name () { for name in \ Name "Name and a${LF}LF" "Name and an${HT}HT" "Name${DQ}" \ "$FN$HT$GN" "$FN$LF$GN" "$FN $GN" "$FN$GN" "$FN$DQ$GN" \ - "With SP in it" "caractère spécial/file" + "With SP in it" "$FN/file" do eval "$1" done @@ -33,7 +33,7 @@ for_each_name () { test_expect_success setup ' - mkdir "caractère spécial" && + mkdir "$FN" && for_each_name "echo initial >\"\$name\"" git add . && git commit -q -m Initial && @@ -51,11 +51,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -"caract\303\250re sp\303\251cial/file" "\346\277\261\351\207\216\t\347\264\224" "\346\277\261\351\207\216\n\347\264\224" "\346\277\261\351\207\216 \347\264\224" "\346\277\261\351\207\216\"\347\264\224" +"\346\277\261\351\207\216/file" "\346\277\261\351\207\216\347\264\224" EOF @@ -65,11 +65,11 @@ Name "Name and an\tHT" "Name\"" With SP in it -caractère spécial/file "濱野\t純" "濱野\n純" 濱野 純 "濱野\"純" +濱野/file 濱野純 EOF diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 5514f74b30..476e5ec038 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -194,6 +194,15 @@ test_expect_success 'pop -q is quiet' ' test ! -s output.out ' +test_expect_success 'pop -q --index works and is quiet' ' + echo foo > file && + git add file && + git stash save --quiet && + git stash pop -q --index > output.out 2>&1 && + test foo = "$(git show :file)" && + test ! -s output.out +' + test_expect_success 'drop -q is quiet' ' git stash && git stash drop -q > output.out 2>&1 && diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 1058d981dc..7649b810b1 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -389,7 +389,7 @@ test_expect_success 'verify resulting packs' ' test_expect_success 'tolerate packsizelimit smaller than biggest object' ' git config pack.packSizeLimit 1 && packname_11=$(git pack-objects test-11 <obj-list) && - test 3 = $(ls test-11-*.pack | wc -l) + test 5 = $(ls test-11-*.pack | wc -l) ' test_expect_success 'verify resulting packs' ' diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index 7144f815c0..0b583cbfc1 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -434,4 +434,37 @@ test_expect_success 'grep -Fi' ' test_cmp expected actual ' +test_expect_success 'setup double-dash tests' ' +cat >double-dash <<EOF && +-- +-> +other +EOF +git add double-dash +' + +cat >expected <<EOF +double-dash:-> +EOF +test_expect_success 'grep -- pattern' ' + git grep -- "->" >actual && + test_cmp expected actual +' +test_expect_success 'grep -- pattern -- pathspec' ' + git grep -- "->" -- double-dash >actual && + test_cmp expected actual +' +test_expect_success 'grep -e pattern -- path' ' + git grep -e "->" -- double-dash >actual && + test_cmp expected actual +' + +cat >expected <<EOF +double-dash:-- +EOF +test_expect_success 'grep -e -- -- path' ' + git grep -e -- -- double-dash >actual && + test_cmp expected actual +' + test_done diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh index ad834f200a..3bbddd03cb 100755 --- a/t/t8003-blame.sh +++ b/t/t8003-blame.sh @@ -157,4 +157,14 @@ EOF git --no-pager blame $COMMIT -- uno >/dev/null ' +test_expect_success 'blame -L with invalid start' ' + test_must_fail git blame -L5 tres 2>errors && + grep "has only 2 lines" errors +' + +test_expect_success 'blame -L with invalid end' ' + test_must_fail git blame -L1,5 tres 2>errors && + grep "has only 2 lines" errors +' + test_done diff --git a/test-chmtime.c b/test-chmtime.c index fe476cb618..92713d16da 100644 --- a/test-chmtime.c +++ b/test-chmtime.c @@ -1,7 +1,7 @@ /* * This program can either change modification time of the given * file(s) or just print it. The program does not change atime nor - * ctime (their values are explicitely preserved). + * ctime (their values are explicitly preserved). * * The mtime can be changed to an absolute value: * diff --git a/transport-helper.c b/transport-helper.c index 107742891f..f822972020 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -171,7 +171,7 @@ static struct child_process *get_helper(struct transport *transport) } else if (!strcmp(capname, "connect")) { data->connect = 1; } else if (mandatory) { - die("Unknown madatory capability %s. This remote " + die("Unknown mandatory capability %s. This remote " "helper probably needs newer version of Git.\n", capname); } diff --git a/tree-walk.c b/tree-walk.c index 08796c2322..67a9a0c5a5 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -441,6 +441,7 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch if (name[0] == '\0') { hashcpy(sha1, root); + free(tree); return 0; } |