Merge branch 'rt/cherry-pick-status'
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 14 Oct 2013 18:08:47 +0000 (11:08 -0700)
committerJonathan Nieder <jrnieder@gmail.com>
Mon, 14 Oct 2013 18:08:47 +0000 (11:08 -0700)
* rt/cherry-pick-status:
status: show commit sha1 in "You are currently cherry-picking" message
status test: add missing && to <<EOF blocks

13 files changed:
.mailmap
Documentation/git-remote.txt
Documentation/howto/revert-a-faulty-merge.txt
Documentation/howto/setup-git-server-over-http.txt
builtin/remote.c
connect.c
contrib/completion/git-completion.bash
git-mergetool--lib.sh
merge-recursive.c
mergetools/diffmerge [new file with mode: 0644]
t/t0060-path-utils.sh
t/t5601-clone.sh
test-path-utils.c
index 1c1f5ec6bf83ca9dd27f7dacaa05b722202e115b..11057cbcdf4c9f814189bdbf0a17980825da194c 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -218,7 +218,9 @@ Tay Ray Chuan <rctay89@gmail.com>
 Ted Percival <ted@midg3t.net> <ted.percival@quest.com>
 Theodore Ts'o <tytso@mit.edu>
 Thomas Ackermann <th.acker@arcor.de> <th.acker66@arcor.de>
-Thomas Rast <trast@inf.ethz.ch> <trast@student.ethz.ch>
+Thomas Rast <tr@thomasrast.ch> <trast@student.ethz.ch>
+Thomas Rast <tr@thomasrast.ch> <trast@inf.ethz.ch>
+Thomas Rast <tr@thomasrast.ch> <trast@google.com>
 Timo Hirvonen <tihirvon@gmail.com> <tihirvon@ee.oulu.fi>
 Toby Allsopp <Toby.Allsopp@navman.co.nz> <toby.allsopp@navman.co.nz>
 Tom Grennan <tmgrennan@gmail.com> <tgrennan@redback.com>
index 9c3e3bf83a2721678a2c7a430ec88bee0d39dd0a..2507c8bd913224b21118fe38d648f2538a06c387 100644 (file)
@@ -13,7 +13,7 @@ SYNOPSIS
 'git remote add' [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url>
 'git remote rename' <old> <new>
 'git remote remove' <name>
-'git remote set-head' <name> (-a | -d | <branch>)
+'git remote set-head' <name> (-a | --auto | -d | --delete | <branch>)
 'git remote set-branches' [--add] <name> <branch>...
 'git remote set-url' [--push] <name> <newurl> [<oldurl>]
 'git remote set-url --add' [--push] <name> <newurl>
@@ -101,9 +101,9 @@ branch. For example, if the default branch for `origin` is set to
 `master`, then `origin` may be specified wherever you would normally
 specify `origin/master`.
 +
-With `-d`, the symbolic ref `refs/remotes/<name>/HEAD` is deleted.
+With `-d` or `--delete`, the symbolic ref `refs/remotes/<name>/HEAD` is deleted.
 +
-With `-a`, the remote is queried to determine its `HEAD`, then the
+With `-a` or `--auto`, the remote is queried to determine its `HEAD`, then the
 symbolic-ref `refs/remotes/<name>/HEAD` is set to the same branch. e.g., if the remote
 `HEAD` is pointed at `next`, "`git remote set-head origin -a`" will set
 the symbolic-ref `refs/remotes/origin/HEAD` to `refs/remotes/origin/next`. This will
index 075418eeeb9f7e5ba3308e724313054d004214a1..acf3e477e59f1bab9addde756274afe15d39a8ed 100644 (file)
@@ -37,7 +37,7 @@ where A and B are on the side development that was not so good, M is the
 merge that brings these premature changes into the mainline, x are changes
 unrelated to what the side branch did and already made on the mainline,
 and W is the "revert of the merge M" (doesn't W look M upside down?).
-IOW, "diff W^..W" is similar to "diff -R M^..M".
+IOW, `"diff W^..W"` is similar to `"diff -R M^..M"`.
 
 Such a "revert" of a merge can be made with:
 
@@ -121,9 +121,9 @@ If you reverted the revert in such a case as in the previous example:
        ---A---B                   A'--B'--C'
 
 where Y is the revert of W, A' and B' are rerolled A and B, and there may
-also be a further fix-up C' on the side branch.  "diff Y^..Y" is similar
-to "diff -R W^..W" (which in turn means it is similar to "diff M^..M"),
-and "diff A'^..C'" by definition would be similar but different from that,
+also be a further fix-up C' on the side branch.  `"diff Y^..Y"` is similar
+to `"diff -R W^..W"` (which in turn means it is similar to `"diff M^..M"`),
+and `"diff A'^..C'"` by definition would be similar but different from that,
 because it is a rerolled series of the earlier change.  There will be a
 lot of overlapping changes that result in conflicts.  So do not do "revert
 of revert" blindly without thinking..
index 7f4943e1025de7013715241145d2122ef16057e3..981cbddc8627fcc2322d626148e2735d6222075c 100644 (file)
@@ -81,8 +81,8 @@ Initialize a bare repository
     $ git --bare init
 
 
-Change the ownership to your web-server's credentials. Use "grep ^User
-httpd.conf" and "grep ^Group httpd.conf" to find out:
+Change the ownership to your web-server's credentials. Use `"grep ^User
+httpd.conf"` and `"grep ^Group httpd.conf"` to find out:
 
     $ chown -R www.www .
 
index eaac3e20124c48456faab48a6529ed281075ee25..4e14891095e6ea016b9f44262ae300c42a75e1b2 100644 (file)
@@ -12,7 +12,7 @@ static const char * const builtin_remote_usage[] = {
        N_("git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>"),
        N_("git remote rename <old> <new>"),
        N_("git remote remove <name>"),
-       N_("git remote set-head <name> (-a | -d | <branch>)"),
+       N_("git remote set-head <name> (-a | --auto | -d | --delete |<branch>)"),
        N_("git remote [-v | --verbose] show [-n] <name>"),
        N_("git remote prune [-n | --dry-run] <name>"),
        N_("git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]"),
@@ -39,7 +39,7 @@ static const char * const builtin_remote_rm_usage[] = {
 };
 
 static const char * const builtin_remote_sethead_usage[] = {
-       N_("git remote set-head <name> (-a | -d | <branch>)"),
+       N_("git remote set-head <name> (-a | --auto | -d | --delete | <branch>)"),
        NULL
 };
 
index a80ebd316c34bb0f0cf3d5a04c33123bb2847421..40868610ab1c02d10cc7cdc927fdf97a5e010414 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -552,7 +552,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
        path = strchr(end, c);
        if (path && !has_dos_drive_prefix(end)) {
                if (c == ':') {
-                       if (path < strchrnul(host, '/')) {
+                       if (host != url || path < strchrnul(host, '/')) {
                                protocol = PROTO_SSH;
                                *path++ = '\0';
                        } else /* '/' in the host part, assume local path */
index 86f77345fdd7ed24d8c76ac33900ff65bdaa32fa..dba3c15700fae1ae8a7a43fd7a6ad7a5b9cbd5dd 100644 (file)
@@ -1188,7 +1188,7 @@ _git_diff ()
        __git_complete_revlist_file
 }
 
-__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
+__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
                        tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
 "
 
index feee6a4a0d3a970c94fe506070ddc497c4b40658..858bc37e80de90b8a15887759c612e2a9704f91a 100644 (file)
@@ -250,7 +250,8 @@ list_merge_tool_candidates () {
                else
                        tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
                fi
-               tools="$tools gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare"
+               tools="$tools gvimdiff diffuse diffmerge ecmerge"
+               tools="$tools p4merge araxis bc3 codecompare"
        fi
        case "${VISUAL:-$EDITOR}" in
        *vim*)
index 40eb840a52acce0d21a17ce5a898e93f164aef97..dbb7104c043b14f2a43d67e1ca87ce88f4a55408 100644 (file)
@@ -2069,8 +2069,8 @@ int parse_merge_opt(struct merge_options *o, const char *s)
                o->xdl_opts = DIFF_WITH_ALG(o, PATIENCE_DIFF);
        else if (!strcmp(s, "histogram"))
                o->xdl_opts = DIFF_WITH_ALG(o, HISTOGRAM_DIFF);
-       else if (!strcmp(s, "diff-algorithm=")) {
-               long value = parse_algorithm_value(s+15);
+       else if (!prefixcmp(s, "diff-algorithm=")) {
+               long value = parse_algorithm_value(s + strlen("diff-algorithm="));
                if (value < 0)
                        return -1;
                /* clear out previous settings */
diff --git a/mergetools/diffmerge b/mergetools/diffmerge
new file mode 100644 (file)
index 0000000..85ac720
--- /dev/null
@@ -0,0 +1,15 @@
+diff_cmd () {
+       "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
+}
+
+merge_cmd () {
+       if $base_present
+       then
+               "$merge_tool_path" --merge --result="$MERGED" \
+                       "$LOCAL" "$BASE" "$REMOTE"
+       else
+               "$merge_tool_path" --merge \
+                       --result="$MERGED" "$LOCAL" "$REMOTE"
+       fi
+       status=$?
+}
index 3a48de20d8e0d63a6901cb8df037805e97c5c3f3..2bd5e3274549c7a50375e90e58fa5a4dc393491d 100755 (executable)
@@ -8,13 +8,13 @@ test_description='Test various path utilities'
 . ./test-lib.sh
 
 norm_path() {
-       expected=$(test-path-utils mingw_path "$2")
+       expected=$(test-path-utils print_path "$2")
        test_expect_success $3 "normalize path: $1 => $2" \
        "test \"\$(test-path-utils normalize_path_copy '$1')\" = '$expected'"
 }
 
 relative_path() {
-       expected=$(test-path-utils mingw_path "$3")
+       expected=$(test-path-utils print_path "$3")
        test_expect_success $4 "relative path: $1 $2 => $3" \
        "test \"\$(test-path-utils relative_path '$1' '$2')\" = '$expected'"
 }
index 0629149eddcff4e6e724ab82479504deda141141..a3e3d489ec9db3c3ca0e53ffd2307dd3652c3713 100755 (executable)
@@ -280,9 +280,53 @@ test_expect_success 'clone checking out a tag' '
        test_cmp fetch.expected fetch.actual
 '
 
+test_expect_success 'setup ssh wrapper' '
+       write_script "$TRASH_DIRECTORY/ssh-wrapper" <<-\EOF &&
+       echo >>"$TRASH_DIRECTORY/ssh-output" "ssh: $*" &&
+       # throw away all but the last argument, which should be the
+       # command
+       while test $# -gt 1; do shift; done
+       eval "$1"
+       EOF
+
+       GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper" &&
+       export GIT_SSH &&
+       export TRASH_DIRECTORY
+'
+
+clear_ssh () {
+       >"$TRASH_DIRECTORY/ssh-output"
+}
+
+expect_ssh () {
+       {
+               case "$1" in
+               none)
+                       ;;
+               *)
+                       echo "ssh: $1 git-upload-pack '$2'"
+               esac
+       } >"$TRASH_DIRECTORY/ssh-expect" &&
+       (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output)
+}
+
+test_expect_success 'cloning myhost:src uses ssh' '
+       clear_ssh &&
+       git clone myhost:src ssh-clone &&
+       expect_ssh myhost src
+'
+
 test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' '
+       clear_ssh &&
        cp -R src "foo:bar" &&
-       git clone "./foo:bar" foobar
+       git clone "./foo:bar" foobar &&
+       expect_ssh none
+'
+
+test_expect_success 'bracketed hostnames are still ssh' '
+       clear_ssh &&
+       git clone "[myhost:123]:src" ssh-bracket-clone &&
+       expect_ssh myhost:123 src
 '
 
 test_done
index bb975e4d3eaf54bb162ecdad8b4b8995c84fb035..3dd3744a57cffd2a98be5cd551cda475c746e646 100644 (file)
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
                return 0;
        }
 
-       if (argc == 3 && !strcmp(argv[1], "mingw_path")) {
+       if (argc == 3 && !strcmp(argv[1], "print_path")) {
                puts(argv[2]);
                return 0;
        }