From: Junio C Hamano Date: Sun, 21 Jun 2009 06:48:21 +0000 (-0700) Subject: Merge branch 'maint-1.6.0' into maint-1.6.1 X-Git-Tag: v1.6.4.1~2^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4258c212ca2c3674be4b7e00a19db705eee77a48?ds=inline;hp=-c Merge branch 'maint-1.6.0' into maint-1.6.1 * maint-1.6.0: git-show-ref.txt: remove word and make consistent git-svn documentation: fix typo in 'rebase vs. pull/merge' section use xstrdup, not strdup in ll-merge.c --- 4258c212ca2c3674be4b7e00a19db705eee77a48 diff --combined Documentation/git-svn.txt index 8d0c421b80,b6577dd4c4..216c4563f1 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@@ -149,22 -149,6 +149,22 @@@ and have no uncommitted changes is very strongly discouraged. -- +'branch':: + Create a branch in the SVN repository. + +-m;; +--message;; + Allows to specify the commit message. + +-t;; +--tag;; + Create a tag by using the tags_subdir instead of the branches_subdir + specified during git svn init. + +'tag':: + Create a tag in the SVN repository. This is a shorthand for + 'branch -t'. + 'log':: This should make it easy to look up svn log messages when svn users refer to -r/--revision numbers. @@@ -388,8 -372,7 +388,8 @@@ Passed directly to 'git-rebase' when us -n:: --dry-run:: -This can be used with the 'dcommit' and 'rebase' commands. +This can be used with the 'dcommit', 'rebase', 'branch' and 'tag' +commands. For 'dcommit', print out the series of git arguments that would show which diffs would be committed to SVN. @@@ -398,9 -381,6 +398,9 @@@ For 'rebase', display the local branch repository associated with the current branch and the URL of svn repository that will be fetched from. +For 'branch' and 'tag', display the urls that will be used for copying when +creating the branch or tag. + -- ADVANCED OPTIONS @@@ -518,8 -498,6 +518,8 @@@ Tracking and contributing to an entire git svn clone http://svn.example.com/project -T trunk -b branches -t tags # View all branches and tags you have cloned: git branch -r +# Create a new branch in SVN + git svn branch waldo # Reset your master to trunk (or any other branch, replacing 'trunk' # with the appropriate name): git reset --hard remotes/trunk @@@ -563,7 -541,7 +563,7 @@@ pulled or merged from. This is becaus If you use `git svn set-tree A..B` to commit several diffs and you do not have the latest remotes/git-svn merged into my-branch, you should use `git svn rebase` to update your work branch instead of `git pull` or - `git merge`. `pull`/`merge' can cause non-linear history to be flattened + `git merge`. `pull`/`merge` can cause non-linear history to be flattened when committing into SVN, which can lead to merge commits reversing previous commits in SVN. diff --combined ll-merge.c index fa2ca5250c,e339b8cfac..9723f3a5dc --- a/ll-merge.c +++ b/ll-merge.c @@@ -8,6 -8,7 +8,6 @@@ #include "attr.h" #include "xdiff-interface.h" #include "run-command.h" -#include "interpolate.h" #include "ll-merge.h" struct ll_merge_driver; @@@ -62,7 -63,6 +62,7 @@@ static int ll_xdl_merge(const struct ll int virtual_ancestor) { xpparam_t xpp; + int style = 0; if (buffer_is_binary(orig->ptr, orig->size) || buffer_is_binary(src1->ptr, src1->size) || @@@ -77,12 -77,10 +77,12 @@@ } memset(&xpp, 0, sizeof(xpp)); + if (git_xmerge_style >= 0) + style = git_xmerge_style; return xdl_merge(orig, src1, name1, src2, name2, - &xpp, XDL_MERGE_ZEALOUS, + &xpp, XDL_MERGE_ZEALOUS | style, result); } @@@ -97,15 -95,10 +97,15 @@@ static int ll_union_merge(const struct char *src, *dst; long size; const int marker_size = 7; + int status, saved_style; - int status = ll_xdl_merge(drv_unused, result, path_unused, - orig, src1, NULL, src2, NULL, - virtual_ancestor); + /* We have to force the RCS "merge" style */ + saved_style = git_xmerge_style; + git_xmerge_style = 0; + status = ll_xdl_merge(drv_unused, result, path_unused, + orig, src1, NULL, src2, NULL, + virtual_ancestor); + git_xmerge_style = saved_style; if (status <= 0) return status; size = result->size; @@@ -168,12 -161,11 +168,12 @@@ static int ll_ext_merge(const struct ll int virtual_ancestor) { char temp[3][50]; - char cmdbuf[2048]; - struct interp table[] = { - { "%O" }, - { "%A" }, - { "%B" }, + struct strbuf cmd = STRBUF_INIT; + struct strbuf_expand_dict_entry dict[] = { + { "O", temp[0] }, + { "A", temp[1] }, + { "B", temp[2] }, + { NULL } }; struct child_process child; const char *args[20]; @@@ -189,13 -181,17 +189,13 @@@ create_temp(src1, temp[1]); create_temp(src2, temp[2]); - interp_set_entry(table, 0, temp[0]); - interp_set_entry(table, 1, temp[1]); - interp_set_entry(table, 2, temp[2]); - - interpolate(cmdbuf, sizeof(cmdbuf), fn->cmdline, table, 3); + strbuf_expand(&cmd, fn->cmdline, strbuf_expand_dict_cb, &dict); memset(&child, 0, sizeof(child)); child.argv = args; args[0] = "sh"; args[1] = "-c"; - args[2] = cmdbuf; + args[2] = cmd.buf; args[3] = NULL; status = run_command(&child); @@@ -220,7 -216,6 +220,7 @@@ bad: for (i = 0; i < 3; i++) unlink(temp[i]); + strbuf_release(&cmd); return status; } @@@ -238,7 -233,7 +238,7 @@@ static int read_merge_config(const cha if (!strcmp(var, "merge.default")) { if (value) - default_ll_merge = strdup(value); + default_ll_merge = xstrdup(value); return 0; } @@@ -272,7 -267,7 +272,7 @@@ if (!strcmp("name", ep)) { if (!value) return error("%s: lacks value", var); - fn->description = strdup(value); + fn->description = xstrdup(value); return 0; } @@@ -295,14 -290,14 +295,14 @@@ * file named by %A, and signal that it has done with zero exit * status. */ - fn->cmdline = strdup(value); + fn->cmdline = xstrdup(value); return 0; } if (!strcmp("recursive", ep)) { if (!value) return error("%s: lacks value", var); - fn->recursive = strdup(value); + fn->recursive = xstrdup(value); return 0; }