{"thread":{"id":"25461","subject":"[PATCH] merge-file: correctly find files when called in subdir","startedAt":"2010-10-16T11:33:29Z","lastAt":"2010-10-18T06:10:35Z","messageCount":10,"participants":["Thomas Rast","Bert Wesarg","Jonathan Nieder","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"153625","messageId":"33ab2f03ed522e1a9be202017b7bbfe35e6d7a99.1287228637.git.trast@student.ethz.ch","threadId":"25461","inReplyTo":null,"subject":"[PATCH] merge-file: correctly find files when called in subdir","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-16T11:33:29Z","receivedAt":"2010-10-16T11:33:29Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Since b541248 (merge.conflictstyle: choose between \"merge\" and \"diff3\n-m\" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),\nthus cd'ing around to find any possible config files to use.\n\nThis broke merge-file when it is called from within a subdirectory of\na repository, and the arguments are all relative paths.\n\nFix by prepending the prefix, as passed down from the main git\nexecutable, if there is any.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n builtin/merge-file.c  |   11 ++++++++++-\n t/t6023-merge-file.sh |    8 ++++++++\n 2 files changed, 18 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex b6664d4..b873fee 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -28,6 +28,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \txmparam_t xmp = {{0}};\n \tint ret = 0, i = 0, to_stdout = 0;\n \tint quiet = 0;\n+\tint prefixlen;\n \tstruct option options[] = {\n \t\tOPT_BOOLEAN('p', \"stdout\", &to_stdout, \"send results to standard output\"),\n \t\tOPT_SET_INT(0, \"diff3\", &xmp.style, \"use a diff3 based merge\", XDL_MERGE_DIFF3),\n@@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \t\t\t\t     \"%s\\n\", strerror(errno));\n \t}\n \n+\tif (prefix)\n+\t\tprefixlen = strlen(prefix);\n+\n \tfor (i = 0; i < 3; i++) {\n+\t\tconst char *name;\n+\t\tif (prefix)\n+\t\t\tname = prefix_filename(prefix, prefixlen, argv[i]);\n+\t\telse\n+\t\t\tname = argv[i];\n \t\tif (!names[i])\n \t\t\tnames[i] = argv[i];\n-\t\tif (read_mmfile(mmfs + i, argv[i]))\n+\t\tif (read_mmfile(mmfs + i, name))\n \t\t\treturn -1;\n \t\tif (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))\n \t\t\treturn error(\"Cannot merge binary files: %s\\n\",\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex d486d73..d9f3439 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -64,6 +64,14 @@ cp new1.txt test.txt\n test_expect_success \"merge without conflict\" \\\n \t\"git merge-file test.txt orig.txt new2.txt\"\n \n+test_expect_success 'works in subdirectory' '\n+\tmkdir dir &&\n+\tcp new1.txt dir/a.txt &&\n+\tcp orig.txt dir/o.txt &&\n+\tcp new2.txt dir/b.txt &&\n+\t( cd dir && git merge-file a.txt o.txt b.txt )\n+'\n+\n cp new1.txt test.txt\n test_expect_success \"merge without conflict (--quiet)\" \\\n \t\"git merge-file --quiet test.txt orig.txt new2.txt\"\n-- \n1.7.3.1.266.g3c065\n"},{"id":"153627","messageId":"AANLkTimzuF3Ku_Jjnq0qKFtrDfAfz8YxChomZr8+Shm1@mail.gmail.com","threadId":"25461","inReplyTo":"33ab2f03ed522e1a9be202017b7bbfe35e6d7a99.1287228637.git.trast@student.ethz.ch","subject":"Re: [PATCH] merge-file: correctly find files when called in subdir","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-10-16T13:30:48Z","receivedAt":"2010-10-16T13:30:48Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Sat, Oct 16, 2010 at 13:33, Thomas Rast <trast@student.ethz.ch> wrote:\n> Since b541248 (merge.conflictstyle: choose between \"merge\" and \"diff3\n> -m\" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),\n> thus cd'ing around to find any possible config files to use.\n>\n> This broke merge-file when it is called from within a subdirectory of\n> a repository, and the arguments are all relative paths.\n>\n> Fix by prepending the prefix, as passed down from the main git\n> executable, if there is any.\n>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n> ---\n>  builtin/merge-file.c  |   11 ++++++++++-\n>  t/t6023-merge-file.sh |    8 ++++++++\n>  2 files changed, 18 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/merge-file.c b/builtin/merge-file.c\n> index b6664d4..b873fee 100644\n> --- a/builtin/merge-file.c\n> +++ b/builtin/merge-file.c\n> @@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n>                                     \"%s\\n\", strerror(errno));\n>        }\n>\n> +       if (prefix)\n> +               prefixlen = strlen(prefix);\n> +\n>        for (i = 0; i < 3; i++) {\n> +               const char *name;\n> +               if (prefix)\n> +                       name = prefix_filename(prefix, prefixlen, argv[i]);\n> +               else\n> +                       name = argv[i];\n\nI think you can safe this condition, if you set prefixlen to 0.\n\nBert\n"},{"id":"153646","messageId":"20101017011111.GA26656@burratino","threadId":"25461","inReplyTo":"AANLkTimzuF3Ku_Jjnq0qKFtrDfAfz8YxChomZr8+Shm1@mail.gmail.com","subject":"Re: [PATCH] merge-file: correctly find files when called in subdir","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-17T01:11:11Z","receivedAt":"2010-10-17T01:11:11Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Bert Wesarg wrote:\n> On Sat, Oct 16, 2010 at 13:33, Thomas Rast <trast@student.ethz.ch> wrote:\n\n>> --- a/builtin/merge-file.c\n>> +++ b/builtin/merge-file.c\n>> @@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n[...]\n>> +               if (prefix)\n>> +                       name = prefix_filename(prefix, prefixlen, argv[i]);\n>> +               else\n>> +                       name = argv[i];\n>\n> I think you can safe this condition, if you set prefixlen to 0.\n\nI'm not so sure.  On Windows, prefix_filename() starts with\n\n\tchar *p;\n\t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n\tif (is_absolute_path(arg))\n\t\tpfx_len = 0;\n\telse\n\t\tmemcpy(path, pfx, pfx_len);\n\nand memcpy() has undefined behavior when pfx is NULL (even with\npfx_len of 0; see WG14/N1256: 7.21.1 \"String function conventions\").\nEven if the win32api memcpy does the right thing with NULL pfx, I\ncannot trust GCC when they are given that kind of license. :)\n"},{"id":"153647","messageId":"20101017013005.GB26656@burratino","threadId":"25461","inReplyTo":"33ab2f03ed522e1a9be202017b7bbfe35e6d7a99.1287228637.git.trast@student.ethz.ch","subject":"Re: [PATCH] merge-file: correctly find files when called in subdir","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-17T01:30:05Z","receivedAt":"2010-10-17T01:30:05Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Thomas Rast wrote:\n\n> --- a/builtin/merge-file.c\n> +++ b/builtin/merge-file.c\n> @@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n>  \t\t\t\t     \"%s\\n\", strerror(errno));\n>  \t}\n>  \n> +\tif (prefix)\n> +\t\tprefixlen = strlen(prefix);\n> +\n>  \tfor (i = 0; i < 3; i++) {\n> +\t\tconst char *name;\n> +\t\tif (prefix)\n> +\t\t\tname = prefix_filename(prefix, prefixlen, argv[i]);\n\nProvokes a warning (silly gcc) which can be suppressed with\n\n\tint prefixlen = prefixlen;\n\n(or = 0 to fit with the surrounding style).\n\n> --- a/t/t6023-merge-file.sh\n> +++ b/t/t6023-merge-file.sh\n> @@ -64,6 +64,14 @@ cp new1.txt test.txt\n>  test_expect_success \"merge without conflict\" \\\n>  \t\"git merge-file test.txt orig.txt new2.txt\"\n>  \n> +test_expect_success 'works in subdirectory' '\n> +\tmkdir dir &&\n> +\tcp new1.txt dir/a.txt &&\n> +\tcp orig.txt dir/o.txt &&\n> +\tcp new2.txt dir/b.txt &&\n> +\t( cd dir && git merge-file a.txt o.txt b.txt )\n\nThanks!  Here's a backport to maint-1.6.1 for kicks.\n\n-- 8< --\nFrom: Thomas Rast <trast@student.ethz.ch>\nSubject: merge-file: correctly find files when called in subdir\n\nSince b541248 (merge.conflictstyle: choose between \"merge\" and \"diff3\n-m\" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),\nthus cd'ing around to find any possible config files to use.\n\nThis broke merge-file when it is called from within a subdirectory of\na repository, and the arguments are all relative paths.\n\nFix by prepending the prefix, as passed down from the main git\nexecutable, if there is any.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin-merge-file.c  |   11 ++++++++++-\n t/t6023-merge-file.sh |    8 ++++++++\n 2 files changed, 18 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-merge-file.c b/builtin-merge-file.c\nindex 96edb97..848e3de 100644\n--- a/builtin-merge-file.c\n+++ b/builtin-merge-file.c\n@@ -27,6 +27,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \tmmbuffer_t result = {NULL, 0};\n \txpparam_t xpp = {XDF_NEED_MINIMAL};\n \tint ret = 0, i = 0, to_stdout = 0;\n+\tint prefixlen = 0;\n \tint merge_level = XDL_MERGE_ZEALOUS_ALNUM;\n \tint merge_style = 0, quiet = 0;\n \tint nongit;\n@@ -57,10 +58,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \t\t\t\t     \"%s\\n\", strerror(errno));\n \t}\n \n+\tif (prefix)\n+\t\tprefixlen = strlen(prefix);\n+\n \tfor (i = 0; i < 3; i++) {\n+\t\tconst char *name;\n+\t\tif (prefix)\n+\t\t\tname = prefix_filename(prefix, prefixlen, argv[i]);\n+\t\telse\n+\t\t\tname = argv[i];\n \t\tif (!names[i])\n \t\t\tnames[i] = argv[i];\n-\t\tif (read_mmfile(mmfs + i, argv[i]))\n+\t\tif (read_mmfile(mmfs + i, name))\n \t\t\treturn -1;\n \t\tif (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))\n \t\t\treturn error(\"Cannot merge binary files: %s\\n\",\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex f8942bc..f09430a 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -58,6 +58,14 @@ cp new1.txt test.txt\n test_expect_success \"merge without conflict\" \\\n \t\"git merge-file test.txt orig.txt new2.txt\"\n \n+test_expect_success 'works in subdirectory' '\n+\tmkdir dir &&\n+\tcp new1.txt dir/a.txt &&\n+\tcp orig.txt dir/o.txt &&\n+\tcp new2.txt dir/b.txt &&\n+\t( cd dir && git merge-file a.txt o.txt b.txt )\n+'\n+\n cp new1.txt test2.txt\n test_expect_success \"merge without conflict (missing LF at EOF)\" \\\n \t\"git merge-file test2.txt orig.txt new2.txt\"\n-- \n1.7.2.3\n"},{"id":"153666","messageId":"201010171239.13990.trast@student.ethz.ch","threadId":"25461","inReplyTo":"20101017011111.GA26656@burratino","subject":"Re: [PATCH] merge-file: correctly find files when called in subdir","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-17T10:39:13Z","receivedAt":"2010-10-17T10:39:13Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jonathan Nieder wrote:\n> Bert Wesarg wrote:\n> > On Sat, Oct 16, 2010 at 13:33, Thomas Rast <trast@student.ethz.ch> wrote:\n> \n> >> --- a/builtin/merge-file.c\n> >> +++ b/builtin/merge-file.c\n> >> @@ -65,10 +66,18 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n> [...]\n> >> +               if (prefix)\n> >> +                       name = prefix_filename(prefix, prefixlen, argv[i]);\n> >> +               else\n> >> +                       name = argv[i];\n> >\n> > I think you can safe this condition, if you set prefixlen to 0.\n> \n> I'm not so sure.  On Windows, prefix_filename() starts with\n> \n> \tchar *p;\n> \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n> \tif (is_absolute_path(arg))\n> \t\tpfx_len = 0;\n> \telse\n> \t\tmemcpy(path, pfx, pfx_len);\n> \n> and memcpy() has undefined behavior when pfx is NULL (even with\n> pfx_len of 0; see WG14/N1256: 7.21.1 \"String function conventions\").\n> Even if the win32api memcpy does the right thing with NULL pfx, I\n> cannot trust GCC when they are given that kind of license. :)\n\nHmmh.\n\nI was ready to say \"you're right\" to Bert's suggestion.  So maybe, for\nthe sake of foolproof-ness, we should do something like the patch\nbelow?\n\ndiff --git i/setup.c w/setup.c\nindex a3b76de..7c8906d 100644\n--- i/setup.c\n+++ w/setup.c\n@@ -55,7 +55,7 @@\n \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n \tif (is_absolute_path(arg))\n \t\tpfx_len = 0;\n-\telse\n+\telse if (pfx && *pfx)\n \t\tmemcpy(path, pfx, pfx_len);\n \tstrcpy(path + pfx_len, arg);\n \tfor (p = path + pfx_len; *p; p++)\n\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"153670","messageId":"20101017160546.GD301@burratino","threadId":"25461","inReplyTo":"201010171239.13990.trast@student.ethz.ch","subject":"Re: [PATCH] merge-file: correctly find files when called in subdir","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-17T16:05:46Z","receivedAt":"2010-10-17T16:05:46Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Thomas Rast wrote:\n\n> I was ready to say \"you're right\" to Bert's suggestion.  So maybe, for\n> the sake of foolproof-ness, we should do something like the patch\n> below?\n> \n> diff --git i/setup.c w/setup.c\n> index a3b76de..7c8906d 100644\n> --- i/setup.c\n> +++ w/setup.c\n> @@ -55,7 +55,7 @@\n>  \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n>  \tif (is_absolute_path(arg))\n>  \t\tpfx_len = 0;\n> -\telse\n> +\telse if (pfx && *pfx)\n>  \t\tmemcpy(path, pfx, pfx_len);\n>  \tstrcpy(path + pfx_len, arg);\n>  \tfor (p = path + pfx_len; *p; p++)\n\nYes, please!  But I'd write it as\n\n\tif (pfx_len)\n\t\tmemcpy(...)\n\nand rely on the commit message to explain that this is about the !pfx\ncase (so callers with pfx_len == 3, !pfx get a nice, quick segfault\ninstead of heisenbugs from uninitialized data).\n"},{"id":"153673","messageId":"64b470380b8f7bd8afe8f019553cb99f72091c7d.1287342969.git.trast@student.ethz.ch","threadId":"25461","inReplyTo":"20101017160546.GD301@burratino","subject":"[PATCH v2 1/2] prefix_filename(): safely handle the case where pfx_len=0","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-17T19:23:21Z","receivedAt":"2010-10-17T19:23:21Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Current prefix_filename() is proofed against the case where the prefix\n'pfx' is NULL or a 0-length string, _except on Windows_.\n\nChange the behaviour to work the same on both platforms, and only\ncheck pfx_len so that callers passing a NULL prefix with a nonzero\npfx_len segfault early on both.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nJonathan Nieder wrote:\n> Yes, please!  But I'd write it as\n> \n>         if (pfx_len)\n>                 memcpy(...)\n> \n> and rely on the commit message to explain that this is about the !pfx\n> case (so callers with pfx_len == 3, !pfx get a nice, quick segfault\n> instead of heisenbugs from uninitialized data).\n\nHrm, why not.  I think symmetry is important here, so I also changed\nthe non-Windows arm, which feels wrong somehow.  But it didn't break\nany tests.\n\nIn writing this I also realised that \"it didn't break any tests\" is\npretty weak and checked them all by hand (there are only a dozen\ngrep matches).\n\n\n setup.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex a3b76de..346ef2e 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -46,7 +46,7 @@\n {\n \tstatic char path[PATH_MAX];\n #ifndef WIN32\n-\tif (!pfx || !*pfx || is_absolute_path(arg))\n+\tif (!pfx_len || is_absolute_path(arg))\n \t\treturn arg;\n \tmemcpy(path, pfx, pfx_len);\n \tstrcpy(path + pfx_len, arg);\n@@ -55,7 +55,7 @@\n \t/* don't add prefix to absolute paths, but still replace '\\' by '/' */\n \tif (is_absolute_path(arg))\n \t\tpfx_len = 0;\n-\telse\n+\telse if (pfx_len)\n \t\tmemcpy(path, pfx, pfx_len);\n \tstrcpy(path + pfx_len, arg);\n \tfor (p = path + pfx_len; *p; p++)\n-- \n1.7.3.1.266.g3c065\n"},{"id":"153674","messageId":"d0e540fdced31557e983d7503da3dcb75c622dc9.1287342969.git.trast@student.ethz.ch","threadId":"25461","inReplyTo":"64b470380b8f7bd8afe8f019553cb99f72091c7d.1287342969.git.trast@student.ethz.ch","subject":"[PATCH v2 2/2] merge-file: correctly find files when called in subdir","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-17T19:23:22Z","receivedAt":"2010-10-17T19:23:22Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Since b541248 (merge.conflictstyle: choose between \"merge\" and \"diff3\n-m\" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),\nthus cd'ing around to find any possible config files to use.\n\nThis broke merge-file when it is called from within a subdirectory of\na repository, and the arguments are all relative paths.\n\nFix by prepending the prefix, as passed down from the main git\nsetup code, if there is any.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nWith the last patch, we can safely pass a zero prefix length to say\n\"there was no prefix\".\n\nThis is a slight semantic change on Windows, because it now\nsubstitutes / for \\ in paths, but I suppose that's harmless?\n\n\n builtin/merge-file.c  |    7 ++++++-\n t/t6023-merge-file.sh |    8 ++++++++\n 2 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/merge-file.c b/builtin/merge-file.c\nindex b6664d4..6c4afb5 100644\n--- a/builtin/merge-file.c\n+++ b/builtin/merge-file.c\n@@ -28,6 +28,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \txmparam_t xmp = {{0}};\n \tint ret = 0, i = 0, to_stdout = 0;\n \tint quiet = 0;\n+\tint prefixlen = 0;\n \tstruct option options[] = {\n \t\tOPT_BOOLEAN('p', \"stdout\", &to_stdout, \"send results to standard output\"),\n \t\tOPT_SET_INT(0, \"diff3\", &xmp.style, \"use a diff3 based merge\", XDL_MERGE_DIFF3),\n@@ -65,10 +66,14 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)\n \t\t\t\t     \"%s\\n\", strerror(errno));\n \t}\n \n+\tif (prefix)\n+\t\tprefixlen = strlen(prefix);\n+\n \tfor (i = 0; i < 3; i++) {\n+\t\tconst char *fname = prefix_filename(prefix, prefixlen, argv[i]);\n \t\tif (!names[i])\n \t\t\tnames[i] = argv[i];\n-\t\tif (read_mmfile(mmfs + i, argv[i]))\n+\t\tif (read_mmfile(mmfs + i, fname))\n \t\t\treturn -1;\n \t\tif (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))\n \t\t\treturn error(\"Cannot merge binary files: %s\\n\",\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex d486d73..d9f3439 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -64,6 +64,14 @@ cp new1.txt test.txt\n test_expect_success \"merge without conflict\" \\\n \t\"git merge-file test.txt orig.txt new2.txt\"\n \n+test_expect_success 'works in subdirectory' '\n+\tmkdir dir &&\n+\tcp new1.txt dir/a.txt &&\n+\tcp orig.txt dir/o.txt &&\n+\tcp new2.txt dir/b.txt &&\n+\t( cd dir && git merge-file a.txt o.txt b.txt )\n+'\n+\n cp new1.txt test.txt\n test_expect_success \"merge without conflict (--quiet)\" \\\n \t\"git merge-file --quiet test.txt orig.txt new2.txt\"\n-- \n1.7.3.1.266.g3c065\n"},{"id":"153678","messageId":"20101017195914.GA3434@burratino","threadId":"25461","inReplyTo":"d0e540fdced31557e983d7503da3dcb75c622dc9.1287342969.git.trast@student.ethz.ch","subject":"Re: [PATCH v2 2/2] merge-file: correctly find files when called in subdir","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-17T19:59:14Z","receivedAt":"2010-10-17T19:59:14Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Thomas Rast wrote:\n\n> This is a slight semantic change on Windows, because it now\n> substitutes / for \\ in paths, but I suppose that's harmless?\n\nYeah, I think it doesn't matter either way.  cc-ing msysgit@\njust in case.\n\n>  builtin/merge-file.c  |    7 ++++++-\n>  t/t6023-merge-file.sh |    8 ++++++++\n>  2 files changed, 14 insertions(+), 1 deletions(-)\n\nFWIW I still like both patches.\n"},{"id":"153694","messageId":"4CBBE4DB.6080307@viscovery.net","threadId":"25461","inReplyTo":"d0e540fdced31557e983d7503da3dcb75c622dc9.1287342969.git.trast@student.ethz.ch","subject":"Re: [PATCH v2 2/2] merge-file: correctly find files when called in subdir","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-10-18T06:10:35Z","receivedAt":"2010-10-18T06:10:35Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/17/2010 21:23, schrieb Thomas Rast:\n> With the last patch, we can safely pass a zero prefix length to say\n> \"there was no prefix\".\n> \n> This is a slight semantic change on Windows, because it now\n> substitutes / for \\ in paths, but I suppose that's harmless?\n\nYes, it should be harmless.\n\n-- Hannes\n"}]}