From b96524f83aa6ba7bd08fb59bb0aa07453a984a8d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 Dec 2008 17:54:10 -0800 Subject: [PATCH 01/29] builtin-checkout.c: check error return from read_cache() Signed-off-by: Junio C Hamano --- builtin-checkout.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin-checkout.c b/builtin-checkout.c index 7f3bd7bb1c..c2c05613b6 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -228,7 +228,8 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec, struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); newfd = hold_locked_index(lock_file, 1); - read_cache(); + if (read_cache() < 0) + return error("corrupt index file"); if (source_tree) read_tree_some(source_tree, pathspec); @@ -371,7 +372,9 @@ static int merge_working_tree(struct checkout_opts *opts, int ret; struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); int newfd = hold_locked_index(lock_file, 1); - read_cache(); + + if (read_cache() < 0) + return error("corrupt index file"); if (opts->force) { ret = reset_tree(new->commit->tree, opts, 1); From 63e8dc5b14b8b80c1a0138c73c875bd82b8b027d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 Dec 2008 17:54:11 -0800 Subject: [PATCH 02/29] read-cache.c: typofix in comment Signed-off-by: Junio C Hamano --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 8579663ee0..c14b562313 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1527,7 +1527,7 @@ int write_index(const struct index_state *istate, int newfd) /* * Read the index file that is potentially unmerged into given - * index_state, dropping any unmerged entries. Returns true is + * index_state, dropping any unmerged entries. Returns true if * the index is unmerged. Callers who want to refuse to work * from an unmerged state can call this and check its return value, * instead of calling read_cache(). From 5ec11af61d907311e4e1b21e10009b06dc2cf74a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 7 Dec 2008 21:54:17 -0500 Subject: [PATCH 03/29] reorder ALLOW_TEXTCONV option setting Right now for the diff porcelain and the log family, we call: init_revisions(); setup_revisions(); DIFF_OPT_SET(ALLOW_TEXTCONV); However, that means textconv will _always_ be on, instead of being a default that can be manipulated with setup_revisions. Instead, we want: init_revisions(); DIFF_OPT_SET(ALLOW_TEXTCONV); setup_revisions(); which is what this patch does. We'll go ahead and move the callsite in wt-status, also; even though the user can't pass any options here, it is a cleanup that will help avoid any surprise later if the setup_revisions line is changed. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin-diff.c | 4 ++-- builtin-log.c | 2 +- wt-status.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin-diff.c b/builtin-diff.c index dddcf697d7..d75d69bf57 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -290,8 +290,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix) /* Otherwise, we are doing the usual "git" diff */ rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index; - /* Default to let external be used */ + /* Default to let external and textconv be used */ DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL); + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); if (nongit) die("Not a git repository"); @@ -303,7 +304,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix) } DIFF_OPT_SET(&rev.diffopt, RECURSIVE); - DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); /* * If the user asked for our exit code then don't start a diff --git a/builtin-log.c b/builtin-log.c index b164717379..840daf9078 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -37,6 +37,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, DIFF_OPT_SET(&rev->diffopt, RECURSIVE); rev->show_root_diff = default_show_root; rev->subject_prefix = fmt_patch_subject_prefix; + DIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV); if (default_date_mode) rev->date_mode = parse_date_format(default_date_mode); @@ -60,7 +61,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, } else die("unrecognized argument: %s", arg); } - DIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV); } /* diff --git a/wt-status.c b/wt-status.c index 3edae43ce9..96ff2f8f56 100644 --- a/wt-status.c +++ b/wt-status.c @@ -279,11 +279,11 @@ static void wt_status_print_verbose(struct wt_status *s) struct rev_info rev; init_revisions(&rev, NULL); + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); setup_revisions(0, NULL, &rev, s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference); rev.diffopt.output_format |= DIFF_FORMAT_PATCH; rev.diffopt.detect_rename = 1; - DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); rev.diffopt.file = s->fp; rev.diffopt.close_file = 0; /* From e10ea8126c27b079e81932ca487747b4961d0604 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 7 Dec 2008 21:57:01 -0500 Subject: [PATCH 04/29] diff: allow turning on textconv explicitly for plumbing Some history viewers use the diff plumbing to generate diffs rather than going through the "git diff" porcelain. Currently, there is no way for them to specify that they would like to see the text-converted version of the diff. This patch adds a "--textconv" option to allow such a plumbing user to allow text conversion. The user can then tell the viewer whether or not they would like text conversion enabled. While it may be tempting add a configuration option rather than requiring each plumbing user to be configured to pass --textconv, that is somewhat dangerous. Text-converted diffs generally cannot be applied directly, so each plumbing user should "opt in" to generating such a diff, either by explicit request of the user or by confirming that their output will not be fed to patch. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diff.c b/diff.c index f644947c82..e21af3b7ee 100644 --- a/diff.c +++ b/diff.c @@ -2477,6 +2477,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) DIFF_OPT_SET(options, ALLOW_EXTERNAL); else if (!strcmp(arg, "--no-ext-diff")) DIFF_OPT_CLR(options, ALLOW_EXTERNAL); + else if (!strcmp(arg, "--textconv")) + DIFF_OPT_SET(options, ALLOW_TEXTCONV); + else if (!strcmp(arg, "--no-textconv")) + DIFF_OPT_CLR(options, ALLOW_TEXTCONV); else if (!strcmp(arg, "--ignore-submodules")) DIFF_OPT_SET(options, IGNORE_SUBMODULES); From 4586864afee675eb1c617666f806664aef04a02a Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Mon, 8 Dec 2008 14:13:21 +0100 Subject: [PATCH 05/29] gitweb: Fix bug in insert_file() subroutine In insert_file() subroutine (which is used to insert HTML fragments as custom header, footer, hometext (for projects list view), and per project README.html (for summary view)) we used: map(to_utf8, <$fd>); This doesn't work, and other form has to be used: map { to_utf8($_) } <$fd>; Now with test for t9600 added, for $GIT_DIR/README.html. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 2 +- t/t9500-gitweb-standalone-no-errors.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 951739210a..6eb370d8de 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2764,7 +2764,7 @@ sub insert_file { my $filename = shift; open my $fd, '<', $filename; - print map(to_utf8, <$fd>); + print map { to_utf8($_) } <$fd>; close $fd; } diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index 64c4cce58b..43cd6eecba 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -673,4 +673,14 @@ test_expect_success \ gitweb_run "p=.git;a=tree"' test_debug 'cat gitweb.log' +# ---------------------------------------------------------------------- +# non-ASCII in README.html + +test_expect_success \ + 'README.html with non-ASCII characters (utf-8)' \ + 'echo "UTF-8 example:
" > .git/README.html && + cat "$TEST_DIRECTORY"/t3900/1-UTF-8.txt >> .git/README.html && + gitweb_run "p=.git;a=summary"' +test_debug 'cat gitweb.log' + test_done From 553589f7823db530d03b49db42251fbea624041f Mon Sep 17 00:00:00 2001 From: Deskin Miller Date: Mon, 8 Dec 2008 08:31:31 -0500 Subject: [PATCH 06/29] git-svn: Make following parents atomic find_parent_branch generates branch@rev type branches when one has to look back through SVN history to properly get the history for a branch copied from somewhere not already being tracked by git-svn. If in the process of fetching this history, git-svn is interrupted, then when one fetches again, it will use whatever was last fetched as the parent commit and fail to fetch any more history which it didn't get to before being terminated. This is especially troubling in that different git-svn copies of the same SVN repository can end up with different commit sha1s, incorrectly showing the history as divergent and precluding easy collaboration using git push and fetch. To fix this, when we initialise the Git::SVN object $gs to search for and perhaps fetch history, we check if there are any commits in SVN in the range between the current revision $gs is at, and the top revision for which we were asked to fill history. If there are commits we're missing in that range, we continue the fetch from the current revision to the top, properly getting all history before using it as the parent for the branch we're trying to create. Signed-off-by: Deskin Miller Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 16 +++++++++--- t/t9104-git-svn-follow-parent.sh | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index 56238dad08..25ed2f4333 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2318,12 +2318,20 @@ sub find_parent_branch { $gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1); } my ($r0, $parent) = $gs->find_rev_before($r, 1); - if (!defined $r0 || !defined $parent) { - my ($base, $head) = parse_revision_argument(0, $r); - if ($base <= $r) { + { + my ($base, $head); + if (!defined $r0 || !defined $parent) { + ($base, $head) = parse_revision_argument(0, $r); + } else { + if ($r0 < $r) { + $gs->ra->get_log([$gs->{path}], $r0 + 1, $r, 1, + 0, 1, sub { $base = $_[1] - 1 }); + } + } + if (defined $base && $base <= $r) { $gs->fetch($base, $r); } - ($r0, $parent) = $gs->last_rev_commit; + ($r0, $parent) = $gs->find_rev_before($r, 1); } if (defined $r0 && defined $parent) { print STDERR "Found branch parent: ($self->{ref_id}) $parent\n"; diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh index 4d964e2db7..d80ea64e49 100755 --- a/t/t9104-git-svn-follow-parent.sh +++ b/t/t9104-git-svn-follow-parent.sh @@ -149,6 +149,48 @@ test_expect_success "track initial change if it was only made to parent" ' "`git rev-parse r9270-d~1`" ' +test_expect_success "follow-parent is atomic" ' + ( + cd wc && + svn up && + svn mkdir stunk && + echo "trunk stunk" > stunk/readme && + svn add stunk/readme && + svn ci -m "trunk stunk" && + echo "stunk like junk" >> stunk/readme && + svn ci -m "really stunk" && + echo "stink stank stunk" >> stunk/readme && + svn ci -m "even the grinch agrees" + ) && + svn copy -m "stunk flunked" "$svnrepo"/stunk "$svnrepo"/flunk && + { svn cp -m "early stunk flunked too" \ + "$svnrepo"/stunk@17 "$svnrepo"/flunked || + svn cp -m "early stunk flunked too" \ + -r17 "$svnrepo"/stunk "$svnrepo"/flunked; } && + git svn init --minimize-url -i stunk "$svnrepo"/stunk && + git svn fetch -i stunk && + git update-ref refs/remotes/flunk@18 refs/remotes/stunk~2 && + git update-ref -d refs/remotes/stunk && + git config --unset svn-remote.svn.fetch stunk && + mkdir -p "$GIT_DIR"/svn/flunk@18 && + rev_map=$(cd "$GIT_DIR"/svn/stunk && ls .rev_map*) && + dd if="$GIT_DIR"/svn/stunk/$rev_map \ + of="$GIT_DIR"/svn/flunk@18/$rev_map bs=24 count=1 && + rm -rf "$GIT_DIR"/svn/stunk && + git svn init --minimize-url -i flunk "$svnrepo"/flunk && + git svn fetch -i flunk && + git svn init --minimize-url -i stunk "$svnrepo"/stunk && + git svn fetch -i stunk && + git svn init --minimize-url -i flunked "$svnrepo"/flunked && + git svn fetch -i flunked + test "`git rev-parse --verify refs/remotes/flunk@18`" \ + = "`git rev-parse --verify refs/remotes/stunk`" && + test "`git rev-parse --verify refs/remotes/flunk~1`" \ + = "`git rev-parse --verify refs/remotes/stunk`" && + test "`git rev-parse --verify refs/remotes/flunked~1`" \ + = "`git rev-parse --verify refs/remotes/stunk~1`" + ' + test_expect_success "track multi-parent paths" ' svn cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob && git-svn multi-fetch && From 9c0c1b1f28e27bf4ac8a7b13f0b0ed3eaebc8cff Mon Sep 17 00:00:00 2001 From: Alexey Borzenkov Date: Mon, 8 Dec 2008 21:29:09 +0300 Subject: [PATCH 07/29] Define linkgit macro in [macros] section Starting with asciidoc 8.3.0 linkgit macro is no longer recognized by asciidoc and user guide suggests (http://www.methods.co.nz/asciidoc/userguide.html#_macro_definitions) that macros are supposed to be defined in [macros] section. I'm not sure whether undefined linkgit macro was working by pure chance or it is a regression in asciidoc 8.3.0, but this patch adds proper definition for the linkgit macro, allowing it to work on 8.3.0. Signed-off-by: Alexey Borzenkov Signed-off-by: Junio C Hamano --- Documentation/asciidoc.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index 2da867d2f8..1e735df3bb 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -7,6 +7,9 @@ # Show GIT link as: (
); if section is defined, else just show # the command. +[macros] +(?su)[\\]?(?Plinkgit):(?P\S*?)\[(?P.*?)\]= + [attributes] asterisk=* plus=+ From aa971cb9bf4105eefb435b9e6f282f019529c35f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 7 Dec 2008 18:38:46 -0800 Subject: [PATCH 08/29] work around Python warnings from AsciiDoc It appears that a reference to an anchor defined as [[anchor-name]] from another place using <> syntax, when the anchor name contains a string "-with-" in its name, triggers these warnings from Python interpreter. asciidoc -b docbook -d book user-manual.txt :1: Warning: 'with' will become a reserved keyword in Python 2.6 :1: Warning: 'with' will become a reserved keyword in Python 2.6 :1: Warning: 'with' will become a reserved keyword in Python 2.6 :1: Warning: 'with' will become a reserved keyword in Python 2.6 There currently is no reference to "Finding comments with given content", but for consistency and for futureproofing, the anchor is also updated as the other ones that are actually used and trigger these warnings. Signed-off-by: Junio C Hamano Signed-off-by: Junio C Hamano --- Documentation/user-manual.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index b6533fa206..99cb80878b 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -13,7 +13,7 @@ to build and test a particular version of a software project, search for regressions, and so on. People needing to do actual development will also want to read -<> and <>. +<> and <>. Further chapters cover more specialized topics. @@ -389,7 +389,7 @@ the order it uses to decide which to choose when there are multiple references with the same shorthand name, see the "SPECIFYING REVISIONS" section of linkgit:git-rev-parse[1]. -[[Updating-a-repository-with-git-fetch]] +[[Updating-a-repository-With-git-fetch]] Updating a repository with git-fetch ------------------------------------ @@ -945,7 +945,7 @@ echo "git diff --stat --summary -M v$last v$new > ../diffstat-$new" and then he just cut-and-pastes the output commands after verifying that they look OK. -[[Finding-comments-with-given-content]] +[[Finding-comments-With-given-Content]] Finding commits referencing a file with given content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -962,7 +962,7 @@ Figuring out why this works is left as an exercise to the (advanced) student. The linkgit:git-log[1], linkgit:git-diff-tree[1], and linkgit:git-hash-object[1] man pages may prove helpful. -[[Developing-with-git]] +[[Developing-With-git]] Developing with git =================== @@ -1665,7 +1665,7 @@ dangling objects can arise in other situations. Sharing development with others =============================== -[[getting-updates-with-git-pull]] +[[getting-updates-With-git-pull]] Getting updates with git-pull ----------------------------- @@ -1673,7 +1673,7 @@ After you clone a repository and make a few changes of your own, you may wish to check the original repository for updates and merge them into your own work. -We have already seen <> with linkgit:git-fetch[1], and how to merge two branches. So you can merge in changes from the original repository's master branch with: @@ -1784,7 +1784,7 @@ Public git repositories Another way to submit changes to a project is to tell the maintainer of that project to pull the changes from your repository using -linkgit:git-pull[1]. In the section "<>" we described this as a way to get updates from the "main" repository, but it works just as well in the other direction. @@ -1994,7 +1994,7 @@ $ git push ssh://yourserver.com/~you/proj.git +master Normally whenever a branch head in a public repository is modified, it is modified to point to a descendant of the commit that it pointed to before. By forcing a push in this situation, you break that convention. -(See <>.) +(See <>.) Nevertheless, this is a common practice for people that need a simple way to publish a work-in-progress patch series, and it is an acceptable @@ -2563,7 +2563,7 @@ There are numerous other tools, such as StGIT, which exist for the purpose of maintaining a patch series. These are outside of the scope of this manual. -[[problems-with-rewriting-history]] +[[problems-With-rewriting-history]] Problems with rewriting history ------------------------------- From 29b802aae6213d02879d21aabac1a8d2e035b583 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 9 Dec 2008 07:23:51 +0100 Subject: [PATCH 09/29] Improve language in git-merge.txt and related docs Improve some minor language and format issues like hyphenation, phrases, spacing, word order, comma, attributes. Signed-off-by: Junio C Hamano --- Documentation/git-fast-export.txt | 2 +- Documentation/git-merge-base.txt | 19 ++++++++--------- Documentation/git-merge-file.txt | 12 +++++------ Documentation/git-merge-index.txt | 6 +++--- Documentation/git-merge-tree.txt | 6 +++--- Documentation/git-merge.txt | 34 +++++++++++++++---------------- Documentation/git-mergetool.txt | 4 ++-- Documentation/merge-config.txt | 12 +++++------ Documentation/merge-options.txt | 2 +- 9 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt index b974e2115b..99a1c3158d 100644 --- a/Documentation/git-fast-export.txt +++ b/Documentation/git-fast-export.txt @@ -15,7 +15,7 @@ DESCRIPTION This program dumps the given revisions in a form suitable to be piped into 'git-fast-import'. -You can use it as a human readable bundle replacement (see +You can use it as a human-readable bundle replacement (see linkgit:git-bundle[1]), or as a kind of an interactive 'git-filter-branch'. diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt index 2f0c5259e0..767486c770 100644 --- a/Documentation/git-merge-base.txt +++ b/Documentation/git-merge-base.txt @@ -16,15 +16,15 @@ DESCRIPTION 'git-merge-base' finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is 'better' than another common ancestor if the latter is an ancestor of the former. A common ancestor -that does not have any better common ancestor than it is a 'best common +that does not have any better common ancestor is a 'best common ancestor', i.e. a 'merge base'. Note that there can be more than one -merge bases between two commits. +merge base for a pair of commits. -Among the two commits to compute their merge bases, one is specified by +Among the two commits to compute the merge base from, one is specified by the first commit argument on the command line; the other commit is a (possibly hypothetical) commit that is a merge across all the remaining -commits on the command line. As the most common special case, giving only -two commits from the command line means computing the merge base between +commits on the command line. As the most common special case, specifying only +two commits on the command line means computing the merge base between the given two commits. OPTIONS @@ -47,7 +47,7 @@ For example, with this topology: the merge base between 'A' and 'B' is '1'. Given three commits 'A', 'B' and 'C', `git merge-base A B C` will compute the -merge base between 'A' and an hypothetical commit 'M', which is a merge +merge base between 'A' and a hypothetical commit 'M', which is a merge between 'B' and 'C'. For example, with this topology: o---o---o---o---C @@ -71,8 +71,7 @@ common ancestor between 'A' and 'M', but '1' is a better common ancestor, because '2' is an ancestor of '1'. Hence, '2' is not a merge base. When the history involves criss-cross merges, there can be more than one -'best' common ancestors between two commits. For example, with this -topology: +'best' common ancestor for two commits. For example, with this topology: ---1---o---A \ / @@ -80,8 +79,8 @@ topology: / \ ---2---o---o---B -both '1' and '2' are merge-base of A and B. Neither one is better than -the other (both are 'best' merge base). When `--all` option is not given, +both '1' and '2' are merge-bases of A and B. Neither one is better than +the other (both are 'best' merge bases). When the `--all` option is not given, it is unspecified which best one is output. Author diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt index 024ec015a3..303537357b 100644 --- a/Documentation/git-merge-file.txt +++ b/Documentation/git-merge-file.txt @@ -15,17 +15,17 @@ SYNOPSIS DESCRIPTION ----------- -'git-file-merge' incorporates all changes that lead from the `` +'git-merge-file' incorporates all changes that lead from the `` to `` into ``. The result ordinarily goes into ``. 'git-merge-file' is useful for combining separate changes to an original. Suppose `` is the original, and both -`` and `` are modifications of ``. -Then 'git-merge-file' combines both changes. +`` and `` are modifications of ``, +then 'git-merge-file' combines both changes. A conflict occurs if both `` and `` have changes in a common segment of lines. If a conflict is found, 'git-merge-file' -normally outputs a warning and brackets the conflict with <<<<<<< and ->>>>>>> lines. A typical conflict will look like this: +normally outputs a warning and brackets the conflict with lines containing +<<<<<<< and >>>>>>> markers. A typical conflict will look like this: <<<<<<< A lines in file A @@ -60,7 +60,7 @@ OPTIONS ``. -q:: - Quiet; do not warn about conflicts. + Quiet; do not warn about conflicts. EXAMPLES diff --git a/Documentation/git-merge-index.txt b/Documentation/git-merge-index.txt index ff088c5c29..123e6d024a 100644 --- a/Documentation/git-merge-index.txt +++ b/Documentation/git-merge-index.txt @@ -29,11 +29,11 @@ OPTIONS Instead of stopping at the first failed merge, do all of them in one shot - continue with merging even when previous merges returned errors, and only return the error code after all the - merges are over. + merges. -q:: - Do not complain about failed merge program (the merge program - failure usually indicates conflicts during merge). This is for + Do not complain about a failed merge program (a merge program + failure usually indicates conflicts during the merge). This is for porcelains which might want to emit custom messages. If 'git-merge-index' is called with multiple s (or -a) then it diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt index dbb0c18668..f869a7f00f 100644 --- a/Documentation/git-merge-tree.txt +++ b/Documentation/git-merge-tree.txt @@ -14,14 +14,14 @@ DESCRIPTION ----------- Reads three treeish, and output trivial merge results and conflicting stages to the standard output. This is similar to -what three-way read-tree -m does, but instead of storing the +what three-way 'git read-tree -m' does, but instead of storing the results in the index, the command outputs the entries to the standard output. This is meant to be used by higher level scripts to compute -merge results outside index, and stuff the results back into the +merge results outside of the index, and stuff the results back into the index. For this reason, the output from the command omits -entries that match tree. +entries that match the tree. Author ------ diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 1f30830d46..f7be5846a6 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -69,20 +69,20 @@ Three kinds of merge can happen: simplest case, called "Already up-to-date." * `HEAD` is already contained in the merged commit. This is the - most common case especially when involved through 'git pull': - you are tracking an upstream repository, committed no local + most common case especially when invoked from 'git pull': + you are tracking an upstream repository, have committed no local changes and now you want to update to a newer upstream revision. - Your `HEAD` (and the index) is updated to at point the merged + Your `HEAD` (and the index) is updated to point at the merged commit, without creating an extra merge commit. This is called "Fast-forward". * Both the merged commit and `HEAD` are independent and must be - tied together by a merge commit that has them both as its parents. + tied together by a merge commit that has both of them as its parents. The rest of this section describes this "True merge" case. The chosen merge strategy merges the two commits into a single new source tree. -When things cleanly merge, these things happen: +When things merge cleanly, this is what happens: 1. The results are updated both in the index file and in your working tree; @@ -91,16 +91,16 @@ When things cleanly merge, these things happen: 4. The `HEAD` pointer gets advanced. Because of 2., we require that the original state of the index -file to match exactly the current `HEAD` commit; otherwise we +file matches exactly the current `HEAD` commit; otherwise we will write out your local changes already registered in your index file along with the merge result, which is not good. -Because 1. involves only the paths different between your +Because 1. involves only those paths differing between your branch and the remote branch you are pulling from during the merge (which is typically a fraction of the whole tree), you can have local modifications in your working tree as long as they do not overlap with what the merge updates. -When there are conflicts, these things happen: +When there are conflicts, the following happens: 1. `HEAD` stays the same. @@ -111,8 +111,8 @@ When there are conflicts, these things happen: versions; stage1 stores the version from the common ancestor, stage2 from `HEAD`, and stage3 from the remote branch (you can inspect the stages with `git ls-files -u`). The working - tree files have the result of "merge" program; i.e. 3-way - merge result with familiar conflict markers `<<< === >>>`. + tree files contain the result of the "merge" program; i.e. 3-way + merge results with familiar conflict markers `<<< === >>>`. 4. No other changes are done. In particular, the local modifications you had before you started merge will stay the @@ -145,13 +145,13 @@ Git makes conflict resolution easy. And here is another line that is cleanly resolved or unmodified. ------------ -The area a pair of conflicting changes happened is marked with markers +The area where a pair of conflicting changes happened is marked with markers "`<<<<<<<`", "`=======`", and "`>>>>>>>`". The part before the "`=======`" -is typically your side, and the part after it is typically their side. +is typically your side, and the part afterwards is typically their side. -The default format does not show what the original said in the conflicted -area. You cannot tell how many lines are deleted and replaced with the -Barbie's remark by your side. The only thing you can tell is that your +The default format does not show what the original said in the conflicting +area. You cannot tell how many lines are deleted and replaced with +Barbie's remark on your side. The only thing you can tell is that your side wants to say it is hard and you'd prefer to go shopping, while the other side wants to claim it is easy. @@ -186,14 +186,14 @@ HOW TO RESOLVE CONFLICTS After seeing a conflict, you can do two things: - * Decide not to merge. The only clean-up you need are to reset + * Decide not to merge. The only clean-ups you need are to reset the index file to the `HEAD` commit to reverse 2. and to clean up working tree changes made by 2. and 3.; 'git-reset --hard' can be used for this. * Resolve the conflicts. Git will mark the conflicts in the working tree. Edit the files into shape and - 'git-add' to the index. 'git-commit' to seal the deal. + 'git-add' them to the index. Use 'git-commit' to seal the deal. You can work through the conflict with a number of tools: diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt index e0b2703b38..602e7c6d3b 100644 --- a/Documentation/git-mergetool.txt +++ b/Documentation/git-mergetool.txt @@ -38,7 +38,7 @@ can configure the absolute path to kdiff3 by setting `mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the tool is available in PATH. + -Instead of running one of the known merge tool programs +Instead of running one of the known merge tool programs, 'git-mergetool' can be customized to run an alternative program by specifying the command line to invoke in a configuration variable `mergetool..cmd`. @@ -55,7 +55,7 @@ of the file to which the merge tool should write the result of the merge resolution. + If the custom merge tool correctly indicates the success of a -merge resolution with its exit code then the configuration +merge resolution with its exit code, then the configuration variable `mergetool..trustExitCode` can be set to `true`. Otherwise, 'git-mergetool' will prompt the user to indicate the success of the resolution after the custom tool has exited. diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt index 86d5b26ab2..1ff08ff2cc 100644 --- a/Documentation/merge-config.txt +++ b/Documentation/merge-config.txt @@ -1,10 +1,10 @@ merge.conflictstyle:: Specify the style in which conflicted hunks are written out to working tree files upon merge. The default is "merge", which - shows `<<<<<<<` conflict marker, change made by one side, - `=======` marker, change made by the other side, and then - `>>>>>>>` marker. An alternate style, "diff3", adds `|||||||` - marker and the original text before `=======` marker. + shows a `<<<<<<<` conflict marker, changes made by one side, + a `=======` marker, changes made by the other side, and then + a `>>>>>>>` marker. An alternate style, "diff3", adds a `|||||||` + marker and the original text before the `=======` marker. merge.log:: Whether to include summaries of merged commits in newly created @@ -32,10 +32,10 @@ merge.verbosity:: message if conflicts were detected. Level 1 outputs only conflicts, 2 outputs conflicts and file changes. Level 5 and above outputs debugging information. The default is level 2. - Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable. + Can be overridden by the 'GIT_MERGE_VERBOSITY' environment variable. merge..name:: - Defines a human readable name for a custom low-level + Defines a human-readable name for a custom low-level merge driver. See linkgit:gitattributes[5] for details. merge..driver:: diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 427cdefd01..637b53f898 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -12,7 +12,7 @@ -n:: --no-stat:: - Do not show diffstat at the end of the merge. + Do not show a diffstat at the end of the merge. --summary:: --no-summary:: From 75bc9573b0e332c34bc1c3d97306077fda573083 Mon Sep 17 00:00:00 2001 From: Tor Arvid Lund Date: Tue, 9 Dec 2008 16:41:50 +0100 Subject: [PATCH 10/29] git-p4: Fix regression in p4Where method. Unfortunately, I introduced a bug in commit 7f705dc36 (git-p4: Fix bug in p4Where method). This happens because sometimes the result from "p4 where " doesn't contain a "depotFile" key, but instead a "data" key that needs further parsing. This commit should ensure that both of these cases are checked. Signed-off-by: Tor Arvid Lund Signed-off-by: Junio C Hamano --- contrib/fast-import/git-p4 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index ee504e90ed..a85a7b2a58 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -249,9 +249,16 @@ def p4Where(depotPath): outputList = p4CmdList("where %s" % depotPath) output = None for entry in outputList: - if entry["depotFile"] == depotPath: - output = entry - break + if "depotFile" in entry: + if entry["depotFile"] == depotPath: + output = entry + break + elif "data" in entry: + data = entry.get("data") + space = data.find(" ") + if data[:space] == depotPath: + output = entry + break if output == None: return "" if output["code"] == "error": From 51ea440637bca30392dded5a75e23f382ce2f23a Mon Sep 17 00:00:00 2001 From: Alexander Potashev Date: Tue, 9 Dec 2008 20:26:22 +0300 Subject: [PATCH 11/29] Fix typos in documentation Signed-off-by: Alexander Potashev Signed-off-by: Junio C Hamano --- Documentation/git-send-email.txt | 2 +- Documentation/technical/racy-git.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index acf8bf41d6..12788667d4 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -46,7 +46,7 @@ The --cc option must be repeated for each user you want on the cc list. Use $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR to edit an introductory message for the patch series. + -When compose is in used, git send-email gets less interactive will use the +When '--compose' is used, git send-email gets less interactive will use the values of the headers you set there. If the body of the email (what you type after the headers and a blank line) only contains blank (or GIT: prefixed) lines, the summary won't be sent, but git-send-email will still use the diff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt index 6bdf034b3a..48bb97f0b1 100644 --- a/Documentation/technical/racy-git.txt +++ b/Documentation/technical/racy-git.txt @@ -135,7 +135,7 @@ them, and give the same timestamp to the index file: This will make all index entries racily clean. The linux-2.6 project, for example, there are over 20,000 files in the working -tree. On my Athron 64X2 3800+, after the above: +tree. On my Athlon 64 X2 3800+, after the above: $ /usr/bin/time git diff-files 1.68user 0.54system 0:02.22elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k From 0c01857df57fe8723714e49459e0c061fcaf056b Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 9 Dec 2008 03:12:28 -0500 Subject: [PATCH 12/29] diff: fix handling of binary rewrite diffs The current emit_rewrite_diff code always writes a text patch without checking whether the content is binary. This means that if you end up with a rewrite diff for a binary file, you get lots of raw binary goo in your patch. Instead, if we have binary files, then let's just skip emit_rewrite_diff altogether. We will already have shown the "dissimilarity index" line, so it is really about the diff contents. If binary diffs are turned off, the "Binary files a/file and b/file differ" message should be the same in either case. If we do have binary patches turned on, there isn't much point in making a less-efficient binary patch that does a total rewrite; no human is going to read it, and since binary patches don't apply with any fuzz anyway, the result of application should be the same. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff.c | 4 ++- t/t4031-diff-rewrite-binary.sh | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 t/t4031-diff-rewrite-binary.sh diff --git a/diff.c b/diff.c index e21af3b7ee..50277b82b2 100644 --- a/diff.c +++ b/diff.c @@ -1376,7 +1376,9 @@ static void builtin_diff(const char *name_a, */ if ((one->mode ^ two->mode) & S_IFMT) goto free_ab_and_return; - if (complete_rewrite) { + if (complete_rewrite && + !diff_filespec_is_binary(one) && + !diff_filespec_is_binary(two)) { emit_rewrite_diff(name_a, name_b, one, two, o); o->found_changes = 1; goto free_ab_and_return; diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh new file mode 100755 index 0000000000..e16c355103 --- /dev/null +++ b/t/t4031-diff-rewrite-binary.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +test_description='rewrite diff on binary file' + +. ./test-lib.sh + +# We must be large enough to meet the MINIMUM_BREAK_SIZE +# requirement. +make_file() { + for i in 1 2 3 4 5 6 7 8 9 10 + do + for j in 1 2 3 4 5 6 7 8 9 + do + for k in 1 2 3 4 5 + do + printf "$1\n" + done + done + done >file +} + +test_expect_success 'create binary file with changes' ' + make_file "\\0" && + git add file && + make_file "\\01" +' + +test_expect_success 'vanilla diff is binary' ' + git diff >diff && + grep "Binary files a/file and b/file differ" diff +' + +test_expect_success 'rewrite diff is binary' ' + git diff -B >diff && + grep "dissimilarity index" diff && + grep "Binary files a/file and b/file differ" diff +' + +test_expect_success 'rewrite diff can show binary patch' ' + git diff -B --binary >diff && + grep "dissimilarity index" diff && + grep "GIT binary patch" diff +' + +test_done From 3aa1f7ca3779f73164b285c070b71abcdd7397c1 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 9 Dec 2008 03:13:21 -0500 Subject: [PATCH 13/29] diff: respect textconv in rewrite diffs Currently we just skip rewrite diffs for binary files; this patch makes an exception for files which will be textconv'd, and actually performs the textconv before generating the diff. Conceptually, rewrite diffs should be in the exact same format as the a non-rewrite diff, except that we refuse to share any context. Thus it makes very little sense for "git diff" to show a textconv'd diff, but for "git diff -B" to show "Binary files differ". Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff.c | 48 +++++++++++++++++++++++++--------- t/t4031-diff-rewrite-binary.sh | 24 ++++++++++++++++- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/diff.c b/diff.c index 50277b82b2..afefe087bb 100644 --- a/diff.c +++ b/diff.c @@ -229,6 +229,8 @@ static void emit_rewrite_diff(const char *name_a, const char *name_b, struct diff_filespec *one, struct diff_filespec *two, + const char *textconv_one, + const char *textconv_two, struct diff_options *o) { int lc_a, lc_b; @@ -241,6 +243,8 @@ static void emit_rewrite_diff(const char *name_a, const char *reset = diff_get_color(color_diff, DIFF_RESET); static struct strbuf a_name = STRBUF_INIT, b_name = STRBUF_INIT; const char *a_prefix, *b_prefix; + const char *data_one, *data_two; + size_t size_one, size_two; if (diff_mnemonic_prefix && DIFF_OPT_TST(o, REVERSE_DIFF)) { a_prefix = o->b_prefix; @@ -262,8 +266,27 @@ static void emit_rewrite_diff(const char *name_a, diff_populate_filespec(one, 0); diff_populate_filespec(two, 0); - lc_a = count_lines(one->data, one->size); - lc_b = count_lines(two->data, two->size); + if (textconv_one) { + data_one = run_textconv(textconv_one, one, &size_one); + if (!data_one) + die("unable to read files to diff"); + } + else { + data_one = one->data; + size_one = one->size; + } + if (textconv_two) { + data_two = run_textconv(textconv_two, two, &size_two); + if (!data_two) + die("unable to read files to diff"); + } + else { + data_two = two->data; + size_two = two->size; + } + + lc_a = count_lines(data_one, size_one); + lc_b = count_lines(data_two, size_two); fprintf(o->file, "%s--- %s%s%s\n%s+++ %s%s%s\n%s@@ -", metainfo, a_name.buf, name_a_tab, reset, @@ -273,9 +296,9 @@ static void emit_rewrite_diff(const char *name_a, print_line_count(o->file, lc_b); fprintf(o->file, " @@%s\n", reset); if (lc_a) - copy_file_with_prefix(o->file, '-', one->data, one->size, old, reset); + copy_file_with_prefix(o->file, '-', data_one, size_one, old, reset); if (lc_b) - copy_file_with_prefix(o->file, '+', two->data, two->size, new, reset); + copy_file_with_prefix(o->file, '+', data_two, size_two, new, reset); } static int fill_mmfile(mmfile_t *mf, struct diff_filespec *one) @@ -1334,6 +1357,11 @@ static void builtin_diff(const char *name_a, const char *a_prefix, *b_prefix; const char *textconv_one = NULL, *textconv_two = NULL; + if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) { + textconv_one = get_textconv(one); + textconv_two = get_textconv(two); + } + diff_set_mnemonic_prefix(o, "a/", "b/"); if (DIFF_OPT_TST(o, REVERSE_DIFF)) { a_prefix = o->b_prefix; @@ -1377,9 +1405,10 @@ static void builtin_diff(const char *name_a, if ((one->mode ^ two->mode) & S_IFMT) goto free_ab_and_return; if (complete_rewrite && - !diff_filespec_is_binary(one) && - !diff_filespec_is_binary(two)) { - emit_rewrite_diff(name_a, name_b, one, two, o); + (textconv_one || !diff_filespec_is_binary(one)) && + (textconv_two || !diff_filespec_is_binary(two))) { + emit_rewrite_diff(name_a, name_b, one, two, + textconv_one, textconv_two, o); o->found_changes = 1; goto free_ab_and_return; } @@ -1388,11 +1417,6 @@ static void builtin_diff(const char *name_a, if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0) die("unable to read files to diff"); - if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) { - textconv_one = get_textconv(one); - textconv_two = get_textconv(two); - } - if (!DIFF_OPT_TST(o, TEXT) && ( (diff_filespec_is_binary(one) && !textconv_one) || (diff_filespec_is_binary(two) && !textconv_two) )) { diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh index e16c355103..157ed85a79 100755 --- a/t/t4031-diff-rewrite-binary.sh +++ b/t/t4031-diff-rewrite-binary.sh @@ -7,6 +7,8 @@ test_description='rewrite diff on binary file' # We must be large enough to meet the MINIMUM_BREAK_SIZE # requirement. make_file() { + # common first line to help identify rewrite versus regular diff + printf "=\n" >file for i in 1 2 3 4 5 6 7 8 9 10 do for j in 1 2 3 4 5 6 7 8 9 @@ -16,7 +18,7 @@ make_file() { printf "$1\n" done done - done >file + done >>file } test_expect_success 'create binary file with changes' ' @@ -42,4 +44,24 @@ test_expect_success 'rewrite diff can show binary patch' ' grep "GIT binary patch" diff ' +{ + echo "#!$SHELL_PATH" + cat >dump <<'EOF' +perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1" +EOF +} >dump +chmod +x dump + +test_expect_success 'setup textconv' ' + echo file diff=foo >.gitattributes && + git config diff.foo.textconv "$PWD"/dump +' + +test_expect_success 'rewrite diff respects textconv' ' + git diff -B >diff && + grep "dissimilarity index" diff && + grep "^-61" diff && + grep "^-0" diff +' + test_done From de749a972d3e262de27928785c83c7b286a18df0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 10 Dec 2008 11:39:07 -0800 Subject: [PATCH 14/29] Fix t4031 When I tweaked the patch to use $SHELL_PATH instead of a hard-coded "#!/bin/sh" to produce 3aa1f7c (diff: respect textconv in rewrite diffs, 2008-12-09), I screwed up. This should fix it. Signed-off-by: Junio C Hamano --- t/t4031-diff-rewrite-binary.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh index 157ed85a79..a894c60622 100755 --- a/t/t4031-diff-rewrite-binary.sh +++ b/t/t4031-diff-rewrite-binary.sh @@ -46,7 +46,7 @@ test_expect_success 'rewrite diff can show binary patch' ' { echo "#!$SHELL_PATH" - cat >dump <<'EOF' + cat <<'EOF' perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1" EOF } >dump From 71fe9451312b159eb4d42a9407c6f9e8b6b26176 Mon Sep 17 00:00:00 2001 From: Alexander Potashev Date: Thu, 11 Dec 2008 01:27:44 +0300 Subject: [PATCH 15/29] Fix typo in comment in builtin-add.c Reported-by: Tim Daly Signed-off-by: Alexander Potashev Signed-off-by: Junio C Hamano --- builtin-add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-add.c b/builtin-add.c index ea4e77169a..719de8b0f2 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -23,7 +23,7 @@ static void fill_pathspec_matches(const char **pathspec, char *seen, int specs) int num_unmatched = 0, i; /* - * Since we are walking the index as if we are warlking the directory, + * Since we are walking the index as if we were walking the directory, * we have to mark the matched pathspec as seen; otherwise we will * mistakenly think that the user gave a pathspec that did not match * anything. From c74faea19e39ca933492f697596310397175c329 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 9 Dec 2008 14:26:52 -0500 Subject: [PATCH 16/29] make sure packs to be replaced are closed beforehand Especially on Windows where an opened file cannot be replaced, make sure pack-objects always close packs it is about to replace. Even on non Windows systems, this could save potential bad results if ever objects were to be read from the new pack file using offset from the old index. This should fix t5303 on Windows. Signed-off-by: Nicolas Pitre Tested-by: Johannes Sixt (MinGW) Signed-off-by: Junio C Hamano --- builtin-pack-objects.c | 1 + cache.h | 1 + sha1_file.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 4411a480c1..fb5e14d56e 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -520,6 +520,7 @@ static void write_pack_file(void) snprintf(tmpname, sizeof(tmpname), "%s-%s.pack", base_name, sha1_to_hex(sha1)); + free_pack_by_name(tmpname); if (adjust_perm(pack_tmp_name, mode)) die("unable to make temporary pack file readable: %s", strerror(errno)); diff --git a/cache.h b/cache.h index d1cd6aaf73..42f2f2754b 100644 --- a/cache.h +++ b/cache.h @@ -738,6 +738,7 @@ extern int open_pack_index(struct packed_git *); extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *); extern void close_pack_windows(struct packed_git *); extern void unuse_pack(struct pack_window **); +extern void free_pack_by_name(const char *); extern struct packed_git *add_packed_git(const char *, int, int); extern const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t); extern off_t nth_packed_object_offset(const struct packed_git *, uint32_t); diff --git a/sha1_file.c b/sha1_file.c index c35469d488..88035a0cd1 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -659,6 +659,37 @@ void unuse_pack(struct pack_window **w_cursor) } } +/* + * This is used by git-repack in case a newly created pack happens to + * contain the same set of objects as an existing one. In that case + * the resulting file might be different even if its name would be the + * same. It is best to close any reference to the old pack before it is + * replaced on disk. Of course no index pointers nor windows for given pack + * must subsist at this point. If ever objects from this pack are requested + * again, the new version of the pack will be reinitialized through + * reprepare_packed_git(). + */ +void free_pack_by_name(const char *pack_name) +{ + struct packed_git *p, **pp = &packed_git; + + while (*pp) { + p = *pp; + if (strcmp(pack_name, p->pack_name) == 0) { + close_pack_windows(p); + if (p->pack_fd != -1) + close(p->pack_fd); + if (p->index_data) + munmap((void *)p->index_data, p->index_size); + free(p->bad_object_sha1); + *pp = p->next; + free(p); + return; + } + pp = &p->next; + } +} + /* * Do not call this directly as this leaks p->pack_fd on error return; * call open_packed_git() instead. From 07e62b733fad4236371a8cd6abc32409fb1fb87d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 10 Dec 2008 04:25:19 -0500 Subject: [PATCH 17/29] rebase: improve error messages about dirty state If you have unstaged changes in your working tree and try to rebase, you will get the cryptic "foo: needs update" message, but nothing else. If you have staged changes, you get "your index is not up-to-date". Let's improve this situation in two ways: - for unstaged changes, let's also tell them we are canceling the rebase, and why (in addition to the "needs update" lines) - for the staged changes case, let's use language that is a little more clear to the user: their index contains uncommitted changes Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-rebase.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index ea7720d3e2..ebd4df3a0e 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -332,11 +332,14 @@ else fi # The tree must be really really clean. -git update-index --ignore-submodules --refresh || exit +if ! git update-index --ignore-submodules --refresh; then + echo >&2 "cannot rebase: you have unstaged changes" + exit 1 +fi diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --) case "$diff" in -?*) echo "cannot rebase: your index is not up-to-date" - echo "$diff" +?*) echo >&2 "cannot rebase: your index contains uncommitted changes" + echo >&2 "$diff" exit 1 ;; esac From 04d39759373e5de017e7c17ef4b762ac5ad3afcc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 10 Dec 2008 19:44:37 -0800 Subject: [PATCH 18/29] fsck: reduce stack footprint The logic to mark all objects that are reachable from tips of refs were implemented as a set of recursive functions. In a repository with a deep enough history, this can easily eat up all the available stack space. Restructure the code to require less stackspace by using an object array to keep track of the objects that still need to be processed. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- builtin-fsck.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/builtin-fsck.c b/builtin-fsck.c index d3f3de9446..30971ce0ad 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -64,11 +64,11 @@ static int fsck_error_func(struct object *obj, int type, const char *err, ...) return (type == FSCK_WARN) ? 0 : 1; } +static struct object_array pending; + static int mark_object(struct object *obj, int type, void *data) { - struct tree *tree = NULL; struct object *parent = data; - int result; if (!obj) { printf("broken link from %7s %s\n", @@ -96,6 +96,20 @@ static int mark_object(struct object *obj, int type, void *data) return 1; } + add_object_array(obj, (void *) parent, &pending); + return 0; +} + +static void mark_object_reachable(struct object *obj) +{ + mark_object(obj, OBJ_ANY, 0); +} + +static int traverse_one_object(struct object *obj, struct object *parent) +{ + int result; + struct tree *tree = NULL; + if (obj->type == OBJ_TREE) { obj->parsed = 0; tree = (struct tree *)obj; @@ -107,15 +121,22 @@ static int mark_object(struct object *obj, int type, void *data) free(tree->buffer); tree->buffer = NULL; } - if (result < 0) - result = 1; - return result; } -static void mark_object_reachable(struct object *obj) +static int traverse_reachable(void) { - mark_object(obj, OBJ_ANY, 0); + int result = 0; + while (pending.nr) { + struct object_array_entry *entry; + struct object *obj, *parent; + + entry = pending.objects + --pending.nr; + obj = entry->item; + parent = (struct object *) entry->name; + result |= traverse_one_object(obj, parent); + } + return !!result; } static int mark_used(struct object *obj, int type, void *data) @@ -233,6 +254,9 @@ static void check_connectivity(void) { int i, max; + /* Traverse the pending reachable objects */ + traverse_reachable(); + /* Look up all the requirements, warn about missing objects.. */ max = get_max_object_index(); if (verbose) From 544ddb045a4bd49da9ffc1d9da80bdc0d71b2518 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 12 Dec 2008 10:00:41 +0100 Subject: [PATCH 19/29] git-config.txt: fix a typo Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 28e1861094..19a8917b83 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -279,7 +279,7 @@ If you want to know all the values for a multivar, do: % git config --get-all core.gitproxy ------------ -If you like to live dangerous, you can replace *all* core.gitproxy by a +If you like to live dangerously, you can replace *all* core.gitproxy by a new one with ------------ From a126ed0a01e265d7f3b2972a34e85636e12e6d34 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 12 Dec 2008 17:20:07 -0600 Subject: [PATCH 20/29] git-branch: display sha1 on branch deletion Make it easier to recover from a mistaken branch deletion by displaying the sha1 of the branch's tip commit. Update t3200 test to match the change in output. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- builtin-branch.c | 3 ++- t/t3200-branch.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin-branch.c b/builtin-branch.c index 494cbac005..02fa38fd3b 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -165,7 +165,8 @@ static int delete_branches(int argc, const char **argv, int force, int kinds) ret = 1; } else { struct strbuf buf = STRBUF_INIT; - printf("Deleted %sbranch %s.\n", remote, argv[i]); + printf("Deleted %sbranch %s (%s).\n", remote, argv[i], + find_unique_abbrev(sha1, DEFAULT_ABBREV)); strbuf_addf(&buf, "branch.%s", argv[i]); if (git_config_rename_section(buf.buf, NULL) < 0) warning("Update of config-file failed"); diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 25e9971fd8..61a2010f5b 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -194,7 +194,8 @@ test_expect_success 'test deleting branch deletes branch config' \ test_expect_success 'test deleting branch without config' \ 'git branch my7 s && - test "$(git branch -d my7 2>&1)" = "Deleted branch my7."' + sha1=$(git rev-parse my7 | cut -c 1-7) && + test "$(git branch -d my7 2>&1)" = "Deleted branch my7 ($sha1)."' test_expect_success 'test --track without .fetch entries' \ 'git branch --track my8 && From 7e76aba317b690932c8236311219b0faf97f1571 Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Sat, 13 Dec 2008 20:05:34 +0100 Subject: [PATCH 21/29] builtin-commit: remove unused message variable builtin-commit uses commit_tree() from builtin-commit-tree since 6bb6b03 (builtin-commit: use commit_tree(), 2008-09-10), where the same message is used. Signed-off-by: Markus Heidelberg Signed-off-by: Junio C Hamano --- builtin-commit.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/builtin-commit.c b/builtin-commit.c index 2b499fa543..e88b78f811 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -932,11 +932,6 @@ static int git_commit_config(const char *k, const char *v, void *cb) return git_status_config(k, v, cb); } -static const char commit_utf8_warn[] = -"Warning: commit message does not conform to UTF-8.\n" -"You may want to amend it after fixing the message, or set the config\n" -"variable i18n.commitencoding to the encoding your project uses.\n"; - int cmd_commit(int argc, const char **argv, const char *prefix) { struct strbuf sb = STRBUF_INIT; From 2fad5329f4bc03e2328a2994d336c12a9683d9b2 Mon Sep 17 00:00:00 2001 From: YONETANI Tomokazu Date: Sun, 14 Dec 2008 11:08:22 +0900 Subject: [PATCH 22/29] git-fast-import possible memory corruption problem Internal "allocate in bulk, we will never free this memory anyway" allocator used in fast-import had a logic to round up the size of the requested memory block in a wrong place (it computed if the available space is enough to fit the request first, and then carved a chunk of memory by size rounded up to the alignment, which could go beyond the actually available space). Signed-off-by: Junio C Hamano --- fast-import.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fast-import.c b/fast-import.c index 3c035a5788..3276d5d7aa 100644 --- a/fast-import.c +++ b/fast-import.c @@ -554,6 +554,10 @@ static void *pool_alloc(size_t len) struct mem_pool *p; void *r; + /* round up to a 'uintmax_t' alignment */ + if (len & (sizeof(uintmax_t) - 1)) + len += sizeof(uintmax_t) - (len & (sizeof(uintmax_t) - 1)); + for (p = mem_pool; p; p = p->next_pool) if ((p->end - p->next_free >= len)) break; @@ -572,9 +576,6 @@ static void *pool_alloc(size_t len) } r = p->next_free; - /* round out to a 'uintmax_t' alignment */ - if (len & (sizeof(uintmax_t) - 1)) - len += sizeof(uintmax_t) - (len & (sizeof(uintmax_t) - 1)); p->next_free += len; return r; } From 390c3480b2bcdc5c254db1a81ff163d7f7061f40 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 14 Dec 2008 22:44:32 +0300 Subject: [PATCH 23/29] Documentation: Describe git-gui Tools menu configuration options. Now git gui has a customizable Tools menu, so this adds information about variables that are used to configure it. Signed-off-by: Alexander Gavrilov Signed-off-by: Junio C Hamano --- Documentation/config.txt | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index b233fe5352..21ea16590b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -839,6 +839,57 @@ gui.blamehistoryctx:: Context` menu item is invoked from 'git gui blame'. If this variable is set to zero, the whole history is shown. +guitool..cmd:: + Specifies the shell command line to execute when the corresponding item + of the linkgit:git-gui[1] `Tools` menu is invoked. This option is + mandatory for every tool. The command is executed from the root of + the working directory, and in the environment it receives the name of + the tool as 'GIT_GUITOOL', the name of the currently selected file as + 'FILENAME', and the name of the current branch as 'CUR_BRANCH' (if + the head is detached, 'CUR_BRANCH' is empty). + +guitool..needsfile:: + Run the tool only if a diff is selected in the GUI. It guarantees + that 'FILENAME' is not empty. + +guitool..noconsole:: + Run the command silently, without creating a window to display its + output. + +guitool..norescan:: + Don't rescan the working directory for changes after the tool + finishes execution. + +guitool..confirm:: + Show a confirmation dialog before actually running the tool. + +guitool..argprompt:: + Request a string argument from the user, and pass it to the tool + through the 'ARGS' environment variable. Since requesting an + argument implies confirmation, the 'confirm' option has no effect + if this is enabled. If the option is set to 'true', 'yes', or '1', + the dialog uses a built-in generic prompt; otherwise the exact + value of the variable is used. + +guitool..revprompt:: + Request a single valid revision from the user, and set the + 'REVISION' environment variable. In other aspects this option + is similar to 'argprompt', and can be used together with it. + +guitool..revunmerged:: + Show only unmerged branches in the 'revprompt' subdialog. + This is useful for tools similar to merge or rebase, but not + for things like checkout or reset. + +guitool..title:: + Specifies the title to use for the prompt dialog. The default + is the tool name. + +guitool..prompt:: + Specifies the general prompt string to display at the top of + the dialog, before subsections for 'argprompt' and 'revprompt'. + The default value includes the actual command. + help.browser:: Specify the browser that will be used to display help in the 'web' format. See linkgit:git-help[1]. From 8befc50c49e8a271fd3cd7fb34258fe88d1dfcad Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 14 Dec 2008 23:10:52 +0100 Subject: [PATCH 24/29] Get rid of the last remnants of GIT_CONFIG_LOCAL In dc871831(Only use GIT_CONFIG in "git config", not other programs), GIT_CONFIG_LOCAL was rested in peace, in favor of not reading /etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.c | 5 +---- git-svn.perl | 3 +-- t/t5400-send-pack.sh | 2 +- t/test-lib.sh | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/config.c b/config.c index d2fc8f5f22..790405a213 100644 --- a/config.c +++ b/config.c @@ -636,10 +636,7 @@ int git_config(config_fn_t fn, void *data) char *repo_config = NULL; const char *home = NULL; - /* $GIT_CONFIG makes git read _only_ the given config file, - * $GIT_CONFIG_LOCAL will make it process it in addition to the - * global config file, the same way it would the per-repository - * config file otherwise. */ + /* Setting $GIT_CONFIG makes git read _only_ the given config file. */ if (config_exclusive_filename) return git_config_from_file(fn, config_exclusive_filename, data); if (git_config_system() && !access(git_etc_gitconfig(), R_OK)) diff --git a/git-svn.perl b/git-svn.perl index 2c206e9178..ad01e182df 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -5015,8 +5015,7 @@ sub minimize_connections { } } if (@emptied) { - my $file = $ENV{GIT_CONFIG} || $ENV{GIT_CONFIG_LOCAL} || - "$ENV{GIT_DIR}/config"; + my $file = $ENV{GIT_CONFIG} || "$ENV{GIT_DIR}/config"; print STDERR < Date: Mon, 15 Dec 2008 00:36:56 -0800 Subject: [PATCH 25/29] git-show: do not segfault when showing a bad tag When a tag points at a bad or nonexistent object, we should diagnose the breakage and exit. An earlier commit 4f3dcc2 (Fix 'git show' on signed tag of signed tag of commit, 2008-07-01) lost this check and made it segfault instead; not good. This fixes it. Signed-off-by: Junio C Hamano --- builtin-log.c | 8 +++++++- t/t7007-show.sh | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 t/t7007-show.sh diff --git a/builtin-log.c b/builtin-log.c index 2efe593734..db71e0da74 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -356,7 +356,13 @@ int cmd_show(int argc, const char **argv, const char *prefix) t->tag, diff_get_color_opt(&rev.diffopt, DIFF_RESET)); ret = show_object(o->sha1, 1, &rev); - objects[i].item = parse_object(t->tagged->sha1); + if (ret) + break; + o = parse_object(t->tagged->sha1); + if (!o) + ret = error("Could not read object %s", + sha1_to_hex(t->tagged->sha1)); + objects[i].item = o; i--; break; } diff --git a/t/t7007-show.sh b/t/t7007-show.sh new file mode 100755 index 0000000000..cce222f052 --- /dev/null +++ b/t/t7007-show.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +test_description='git show' + +. ./test-lib.sh + +test_expect_success setup ' + echo hello world >foo && + H=$(git hash-object -w foo) && + git tag -a foo-tag -m "Tags $H" $H && + HH=$(expr "$H" : "\(..\)") && + H38=$(expr "$H" : "..\(.*\)") && + rm -f .git/objects/$HH/$H38 +' + +test_expect_success 'showing a tag that point at a missing object' ' + test_must_fail git --no-pager show foo-tag +' + +test_done From a8335024c294db470e16e9df3aaa346bfcfbeacb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 15 Dec 2008 00:33:34 -0800 Subject: [PATCH 26/29] pager: do not dup2 stderr if it is already redirected An earlier commit 61b8050 (sending errors to stdout under $PAGER, 2008-02-16) avoided losing the error messages that are sent to the standard error when $PAGER is in effect by dup2'ing fd 2 to the pager. his way, showing a tag object that points to a bad object: $ git show tag-foo would give the error message to the pager. However, it was not quite right if the user did: $ git show 2>error.log tag-foo i.e. use the pager but store the errors in a separate file. Signed-off-by: Junio C Hamano --- pager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pager.c b/pager.c index 6b5c9e44b4..0b7e55f476 100644 --- a/pager.c +++ b/pager.c @@ -102,7 +102,8 @@ void setup_pager(void) /* original process continues, but writes to the pipe */ dup2(pager_process.in, 1); - dup2(pager_process.in, 2); + if (isatty(2)) + dup2(pager_process.in, 2); close(pager_process.in); /* this makes sure that the parent terminates after the pager */ From 87c8a56e4f71cc7e22c16caa4adc2ae17f6aa93d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 15 Dec 2008 22:11:40 +0100 Subject: [PATCH 27/29] fast-import: close pack before unlinking it This is sort of a companion patch to 4723ee9(Close files opened by lock_file() before unlinking.): on Windows, you cannot delete what is still open. This makes test 9300-fast-import pass on Windows for me; quite a few fast-imports leave temporary packs until the test "blank lines not necessary after other commands" actually tests for the number of files in .git/objects/pack/, which has a few temporary packs now. I guess that 8b4eb6b(Do not perform cross-directory renames when creating packs) was "responsible" for the breakage. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- fast-import.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fast-import.c b/fast-import.c index 5473cd4d62..13b36147a4 100644 --- a/fast-import.c +++ b/fast-import.c @@ -982,8 +982,10 @@ static void end_packfile(void) pack_id++; } - else + else { + close(old_p->pack_fd); unlink(old_p->pack_name); + } free(old_p); /* We can't carry a delta across packfiles. */ From 025a19298dca1a94e8d39ea28cb57412c12dfbff Mon Sep 17 00:00:00 2001 From: Lee Marlow Date: Mon, 15 Dec 2008 10:45:48 -0700 Subject: [PATCH 28/29] bash completion: Sort config completion variables Sort the config variables to make sync-ing them with Documents/config.txt easier in the future. Signed-off-by: Lee Marlow Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 79 +++++++++++++------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index c79c98ffec..79cbed589d 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1206,84 +1206,87 @@ _git_config () esac __gitcomp " apply.whitespace - core.fileMode - core.gitProxy - core.ignoreStat - core.preferSymlinkRefs - core.logAllRefUpdates - core.loosecompression - core.repositoryFormatVersion - core.sharedRepository - core.warnAmbiguousRefs - core.compression - core.packedGitWindowSize - core.packedGitLimit clean.requireForce color.branch color.branch.current color.branch.local - color.branch.remote color.branch.plain + color.branch.remote color.diff - color.diff.plain - color.diff.meta - color.diff.frag - color.diff.old - color.diff.new color.diff.commit + color.diff.frag + color.diff.meta + color.diff.new + color.diff.old + color.diff.plain color.diff.whitespace color.pager color.status - color.status.header color.status.added color.status.changed + color.status.header color.status.untracked + core.compression + core.fileMode + core.gitProxy + core.ignoreStat + core.logAllRefUpdates + core.loosecompression + core.packedGitLimit + core.packedGitWindowSize + core.preferSymlinkRefs + core.repositoryFormatVersion + core.sharedRepository + core.warnAmbiguousRefs diff.renameLimit diff.renames fetch.unpackLimit format.headers format.subjectprefix - gitcvs.enabled - gitcvs.logfile - gitcvs.allbinary - gitcvs.dbname gitcvs.dbdriver gitcvs.dbuser gitcvs.dbpass - gitcvs.dbtablenameprefix gc.packrefs gc.reflogexpire gc.reflogexpireunreachable gc.rerereresolved gc.rerereunresolved - http.sslVerify - http.sslCert - http.sslKey - http.sslCAInfo - http.sslCAPath - http.maxRequests + gitcvs.allbinary + gitcvs.dbdriver + gitcvs.dbname + gitcvs.dbpass + gitcvs.dbtablenameprefix + gitcvs.dbuser + gitcvs.enabled + gitcvs.logfile http.lowSpeedLimit http.lowSpeedTime + http.maxRequests http.noEPSV + http.sslCAInfo + http.sslCAPath + http.sslCert + http.sslKey + http.sslVerify i18n.commitEncoding i18n.logOutputEncoding log.showroot - merge.tool merge.summary + merge.tool merge.verbosity - pack.window - pack.depth - pack.windowMemory pack.compression - pack.deltaCacheSize pack.deltaCacheLimit + pack.deltaCacheSize + pack.depth + pack.window + pack.windowMemory pull.octopus pull.twohead + receive.denyNonFastForwards + receive.unpackLimit repack.useDeltaBaseOffset showbranch.default tar.umask transfer.unpackLimit - receive.unpackLimit - receive.denyNonFastForwards - user.name user.email + user.name user.signingkey branch. remote. " From 98171a07ae74e796a6c78e7c446ac9a5aaf28c07 Mon Sep 17 00:00:00 2001 From: Lee Marlow Date: Mon, 15 Dec 2008 10:45:49 -0700 Subject: [PATCH 29/29] bash completion: Sync config variables with their man pages Add 'normal' to config color options. Add 'mergeoptions' to branch config options. Add 'proxy' and 'mirror' to remote config options. Signed-off-by: Lee Marlow Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 87 +++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 79cbed589d..e00454983e 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1155,7 +1155,7 @@ _git_config () ;; color.*.*) __gitcomp " - black red green yellow blue magenta cyan white + normal black red green yellow blue magenta cyan white bold dim ul blink reverse " return @@ -1179,7 +1179,7 @@ _git_config () branch.*.*) local pfx="${cur%.*}." cur="${cur##*.}" - __gitcomp "remote merge" "$pfx" "$cur" + __gitcomp "remote merge mergeoptions" "$pfx" "$cur" return ;; branch.*) @@ -1192,7 +1192,7 @@ _git_config () local pfx="${cur%.*}." cur="${cur##*.}" __gitcomp " - url fetch push skipDefaultUpdate + url proxy fetch push mirror skipDefaultUpdate receivepack uploadpack tagopt " "$pfx" "$cur" return @@ -1206,6 +1206,8 @@ _git_config () esac __gitcomp " apply.whitespace + branch.autosetupmerge + branch.autosetuprebase clean.requireForce color.branch color.branch.current @@ -1220,46 +1222,95 @@ _git_config () color.diff.old color.diff.plain color.diff.whitespace + color.interactive + color.interactive.header + color.interactive.help + color.interactive.prompt color.pager color.status color.status.added color.status.changed color.status.header + color.status.nobranch color.status.untracked + color.status.updated + color.ui + commit.template + core.autocrlf + core.bare core.compression + core.deltaBaseCacheLimit + core.editor + core.excludesfile core.fileMode + core.fsyncobjectfiles core.gitProxy + core.ignoreCygwinFSTricks core.ignoreStat core.logAllRefUpdates core.loosecompression core.packedGitLimit core.packedGitWindowSize + core.pager core.preferSymlinkRefs + core.preloadindex + core.quotepath core.repositoryFormatVersion + core.safecrlf core.sharedRepository + core.symlinks + core.trustctime core.warnAmbiguousRefs + core.whitespace + core.worktree + diff.autorefreshindex + diff.external + diff.mnemonicprefix diff.renameLimit + diff.renameLimit. diff.renames fetch.unpackLimit format.headers - format.subjectprefix + format.numbered + format.pretty + format.suffix + gc.aggressiveWindow + gc.auto + gc.autopacklimit gc.packrefs + gc.pruneexpire gc.reflogexpire gc.reflogexpireunreachable gc.rerereresolved gc.rerereunresolved gitcvs.allbinary + gitcvs.dbTableNamePrefix gitcvs.dbdriver gitcvs.dbname gitcvs.dbpass - gitcvs.dbtablenameprefix gitcvs.dbuser gitcvs.enabled gitcvs.logfile + gitcvs.usecrlfattr + gui.blamehistoryctx + gui.commitmsgwidth + gui.copyblamethreshold + gui.diffcontext + gui.encoding + gui.fastcopyblame + gui.matchtrackingbranch + gui.newbranchtemplate + gui.pruneduringfetch + gui.spellingdictionary + gui.trustmtime + help.autocorrect + help.browser + help.format http.lowSpeedLimit http.lowSpeedTime http.maxRequests http.noEPSV + http.proxy http.sslCAInfo http.sslCAPath http.sslCert @@ -1267,27 +1318,49 @@ _git_config () http.sslVerify i18n.commitEncoding i18n.logOutputEncoding + instaweb.browser + instaweb.httpd + instaweb.local + instaweb.modulepath + instaweb.port + log.date log.showroot - merge.summary + man.viewer + merge.conflictstyle + merge.log + merge.renameLimit + merge.stat merge.tool merge.verbosity + mergetool.keepBackup pack.compression pack.deltaCacheLimit pack.deltaCacheSize pack.depth + pack.indexVersion + pack.packSizeLimit + pack.threads pack.window pack.windowMemory pull.octopus pull.twohead + receive.denyCurrentBranch + receive.denyDeletes receive.denyNonFastForwards + receive.fsckObjects receive.unpackLimit - repack.useDeltaBaseOffset + repack.usedeltabaseoffset + rerere.autoupdate + rerere.enabled showbranch.default + status.relativePaths + status.showUntrackedFiles tar.umask transfer.unpackLimit user.email user.name user.signingkey + web.browser branch. remote. " }