{"thread":{"id":"908","subject":"[PATCH 5/3] read-tree: loosen too strict index requirements","startedAt":"2005-06-11T09:53:57Z","lastAt":"2005-06-13T22:17:17Z","messageCount":7,"participants":["Junio C Hamano","Jon Seymour","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"4869","messageId":"7vfyvpxlqi.fsf@assigned-by-dhcp.cox.net","threadId":"908","inReplyTo":null,"subject":"[PATCH 5/3] read-tree: loosen too strict index requirements","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-06-11T09:53:57Z","receivedAt":"2005-06-11T09:53:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This patch teaches read-tree 3-way merge that, when only \"the\nother tree\" changed a path, and if the index file already has\nthe same change, we are not in a situation that would clobber\nthe index and the work tree, and lets the merge succeed; this is\ncase #14ALT in t1000 test.  It does not change the result of the\nmerge, but prevents it from failing when it does not have to.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n*** This is another leftover bits from the earlier 3-piece series.\n*** This is not necessary for the --emu23 two-way improvements,\n*** but rather help a case that would not be so uncommon in the\n*** 3-way merge case.\n\n read-tree.c                 |    6 ++++++\n t/t1000-read-tree-m-3way.sh |    9 +++++++++\n 2 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/read-tree.c b/read-tree.c\n--- a/read-tree.c\n+++ b/read-tree.c\n@@ -280,6 +280,12 @@ static int threeway_merge(struct cache_e\n \t\t}\n \t\t/* otherwise we will apply the original rule */\n \t}\n+\t/* #14ALT */\n+\tif (a && b && c && same(a, b) && !same(a, c)) {\n+\t\tif (old && same(old, c))\n+\t\t\treturn merged_entry_allow_dirty(c, old, dst);\n+\t\t/* otherwise the regular rule applies */\n+\t}\n \t/*\n \t * If we have an entry in the index cache (\"old\"), then we want\n \t * to make sure that it matches any entries in stage 2 (\"first\ndiff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh\n--- a/t/t1000-read-tree-m-3way.sh\n+++ b/t/t1000-read-tree-m-3way.sh\n@@ -464,6 +464,15 @@ test_expect_success \\\n      git-read-tree -m $tree_O $tree_A $tree_B &&\n      check_result\"\n \n+test_expect_success \\\n+    '14 - may match B in O && A && B && O==A && O!=B case' \\\n+    \"rm -f .git/index NM &&\n+     cp .orig-B/NM NM &&\n+     git-update-cache --add NM &&\n+     echo extra >>NM &&\n+     git-read-tree -m $tree_O $tree_A $tree_B &&\n+     check_result\"\n+\n test_expect_failure \\\n     '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' \\\n     \"rm -f .git/index NM &&\n------------\n\n"},{"id":"4887","messageId":"7vwtp0p6tz.fsf@assigned-by-dhcp.cox.net","threadId":"908","inReplyTo":"7vfyvpxlqi.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Fix rename/copy when dealing with temporarily broken pairs.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-06-12T03:55:20Z","receivedAt":"2005-06-12T03:55:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When rename/copy uses a file that was broken by diffcore-break\nas the source, and the broken filepair gets merged back later,\nthe output was mislabeled as a rename.  In this case, the source\nfile ends up staying in the output, so we should label it as a\ncopy instead.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n diff.c            |    1 +\n diffcore-rename.c |   10 ++++++++--\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/diff.c b/diff.c\n--- a/diff.c\n+++ b/diff.c\n@@ -661,6 +661,7 @@ struct diff_filepair *diff_queue(struct \n \tdp->one = one;\n \tdp->two = two;\n \tdp->score = 0;\n+\tdp->status = 0;\n \tdp->source_stays = 0;\n \tdp->broken_pair = 0;\n \tdiff_q(queue, dp);\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -249,8 +249,14 @@ void diffcore_rename(int detect_rename, \n \t\t\t\tcontinue; /* unmerged */\n \t\t\telse\n \t\t\t\tlocate_rename_dst(p->two, 1);\n-\t\telse if (!DIFF_FILE_VALID(p->two))\n-\t\t\tregister_rename_src(p->one, 0);\n+\t\telse if (!DIFF_FILE_VALID(p->two)) {\n+\t\t\t/* If the source is a broken \"delete\", and\n+\t\t\t * they did not really want to get broken,\n+\t\t\t * that means the source actually stays.\n+\t\t\t */\n+\t\t\tint stays = (p->broken_pair && !p->score);\n+\t\t\tregister_rename_src(p->one, stays);\n+\t\t}\n \t\telse if (detect_rename == DIFF_DETECT_COPY)\n \t\t\tregister_rename_src(p->one, 1);\n \t}\n------------\n\n"},{"id":"4888","messageId":"7vr7f8p6qu.fsf@assigned-by-dhcp.cox.net","threadId":"908","inReplyTo":"7vfyvpxlqi.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add --diff-filter= output restriction to diff-* family.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-06-12T03:57:13Z","receivedAt":"2005-06-12T03:57:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is a halfway between debugging aid and a helper to write an\nultra-smart merge scripts.  The new option takes a string that\nconsists of a list of \"status\" letters, and limits the diff\noutput to only those classes of changes, with two exceptions:\n\n - A broken pair (aka \"complete rewrite\"), does not match D\n   (deleted) or N (created).  Use B to look for them.\n\n - The letter \"A\" in the diff-filter string does not match\n   anything itself, but causes the entire diff that contains\n   selected patches to be output (this behaviour is similar to\n   that of --pickaxe-all for the -S option).\n\nFor example,\n\n    $ git-rev-list HEAD |\n      git-diff-tree --stdin -s -v -B -C --diff-filter=BCR\n\nshows a list of commits that have complete rewrite, copy, or\nrename.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n diff.h        |    8 +++++--\n diff-cache.c  |    9 ++++++-\n diff-files.c  |    7 ++++--\n diff-helper.c |   15 +++++++-----\n diff-stages.c |    8 +++++--\n diff-tree.c   |   12 +++++++---\n diff.c        |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---\n 7 files changed, 108 insertions(+), 21 deletions(-)\n\ndiff --git a/diff.h b/diff.h\n--- a/diff.h\n+++ b/diff.h\n@@ -47,7 +47,11 @@ extern void diffcore_std(const char **pa\n \t\t\t int detect_rename, int rename_score,\n \t\t\t const char *pickaxe, int pickaxe_opts,\n \t\t\t int break_opt,\n-\t\t\t const char *orderfile);\n+\t\t\t const char *orderfile, const char *filter);\n+\n+extern void diffcore_std_no_resolve(const char **paths,\n+\t\t\t\t    const char *pickaxe, int pickaxe_opts,\n+\t\t\t\t    const char *orderfile, const char *filter);\n \n extern int diff_queue_is_empty(void);\n \n@@ -56,6 +60,6 @@ extern int diff_queue_is_empty(void);\n #define DIFF_FORMAT_PATCH\t2\n #define DIFF_FORMAT_NO_OUTPUT\t3\n \n-extern void diff_flush(int output_style, int resolve_rename_copy);\n+extern void diff_flush(int output_style);\n \n #endif /* DIFF_H */\ndiff --git a/diff-cache.c b/diff-cache.c\n--- a/diff-cache.c\n+++ b/diff-cache.c\n@@ -11,6 +11,7 @@ static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n static int diff_break_opt = -1;\n static const char *orderfile = NULL;\n+static const char *diff_filter = NULL;\n \n /* A file entry went away or appeared */\n static void show_file(const char *prefix, struct cache_entry *ce, unsigned char *sha1, unsigned int mode)\n@@ -224,6 +225,10 @@ int main(int argc, const char **argv)\n \t\t\tpickaxe = arg + 2;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strncmp(arg, \"--diff-filter=\", 14)) {\n+\t\t\tdiff_filter = arg + 14;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strncmp(arg, \"-O\", 2)) {\n \t\t\torderfile = arg + 2;\n \t\t\tcontinue;\n@@ -263,7 +268,7 @@ int main(int argc, const char **argv)\n \t\t     detect_rename, diff_score_opt,\n \t\t     pickaxe, pickaxe_opts,\n \t\t     diff_break_opt,\n-\t\t     orderfile);\n-\tdiff_flush(diff_output_format, 1);\n+\t\t     orderfile, diff_filter);\n+\tdiff_flush(diff_output_format);\n \treturn ret;\n }\ndiff --git a/diff-files.c b/diff-files.c\n--- a/diff-files.c\n+++ b/diff-files.c\n@@ -17,6 +17,7 @@ static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n static int diff_break_opt = -1;\n static const char *orderfile = NULL;\n+static const char *diff_filter = NULL;\n static int silent = 0;\n \n static void show_unmerge(const char *path)\n@@ -59,6 +60,8 @@ int main(int argc, const char **argv)\n \t\t\tpickaxe = argv[1] + 2;\n \t\telse if (!strncmp(argv[1], \"-O\", 2))\n \t\t\torderfile = argv[1] + 2;\n+\t\telse if (!strncmp(argv[1], \"--diff-filter=\", 14))\n+\t\t\tdiff_filter = argv[1] + 14;\n \t\telse if (!strcmp(argv[1], \"--pickaxe-all\"))\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\telse if (!strncmp(argv[1], \"-B\", 2)) {\n@@ -131,7 +134,7 @@ int main(int argc, const char **argv)\n \t\t     detect_rename, diff_score_opt,\n \t\t     pickaxe, pickaxe_opts,\n \t\t     diff_break_opt,\n-\t\t     orderfile);\n-\tdiff_flush(diff_output_format, 1);\n+\t\t     orderfile, diff_filter);\n+\tdiff_flush(diff_output_format);\n \treturn 0;\n }\ndiff --git a/diff-helper.c b/diff-helper.c\n--- a/diff-helper.c\n+++ b/diff-helper.c\n@@ -8,17 +8,16 @@\n static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n static const char *orderfile = NULL;\n+static const char *diff_filter = NULL;\n static int line_termination = '\\n';\n static int inter_name_termination = '\\t';\n \n static void flush_them(int ac, const char **av)\n {\n-\tdiffcore_std(av + 1,\n-\t\t     0, 0, /* no renames */\n-\t\t     pickaxe, pickaxe_opts,\n-\t\t     -1, /* no breaks */\n-\t\t     orderfile);\n-\tdiff_flush(DIFF_FORMAT_PATCH, 0);\n+\tdiffcore_std_no_resolve(av + 1,\n+\t\t\t\tpickaxe, pickaxe_opts,\n+\t\t\t\torderfile, diff_filter);\n+\tdiff_flush(DIFF_FORMAT_PATCH);\n }\n \n static const char *diff_helper_usage =\n@@ -38,6 +37,10 @@ int main(int ac, const char **av) {\n \t\t}\n \t\telse if (!strcmp(av[1], \"--pickaxe-all\"))\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n+\t\telse if (!strncmp(av[1], \"--diff-filter=\", 14))\n+\t\t\tdiff_filter = av[1] + 14;\n+\t\telse if (!strncmp(av[1], \"-O\", 2))\n+\t\t\torderfile = av[1] + 2;\n \t\telse\n \t\t\tusage(diff_helper_usage);\n \t\tac--; av++;\ndiff --git a/diff-stages.c b/diff-stages.c\n--- a/diff-stages.c\n+++ b/diff-stages.c\n@@ -13,6 +13,7 @@ static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n static int diff_break_opt = -1;\n static const char *orderfile = NULL;\n+static const char *diff_filter = NULL;\n \n static char *diff_stages_usage =\n \"git-diff-stages [-p] [-r] [-z] [-M] [-C] [-R] [-S<string>] [-O<orderfile>] <stage1> <stage2> [<path>...]\";\n@@ -88,6 +89,8 @@ int main(int ac, const char **av)\n \t\t\tpickaxe = arg + 2;\n \t\telse if (!strncmp(arg, \"-O\", 2))\n \t\t\torderfile = arg + 2;\n+\t\telse if (!strncmp(arg, \"--diff-filter=\", 14))\n+\t\t\tdiff_filter = arg + 14;\n \t\telse if (!strcmp(arg, \"--pickaxe-all\"))\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\telse\n@@ -111,7 +114,8 @@ int main(int ac, const char **av)\n \t\t     detect_rename, diff_score_opt,\n \t\t     pickaxe, pickaxe_opts,\n \t\t     diff_break_opt,\n-\t\t     orderfile);\n-\tdiff_flush(diff_output_format, 1);\n+\t\t     orderfile,\n+\t\t     diff_filter);\n+\tdiff_flush(diff_output_format);\n \treturn 0;\n }\ndiff --git a/diff-tree.c b/diff-tree.c\n--- a/diff-tree.c\n+++ b/diff-tree.c\n@@ -18,6 +18,7 @@ static const char *pickaxe = NULL;\n static int pickaxe_opts = 0;\n static int diff_break_opt = -1;\n static const char *orderfile = NULL;\n+static const char *diff_filter = NULL;\n static const char *header = NULL;\n static const char *header_prefix = \"\";\n static enum cmit_fmt commit_format = CMIT_FMT_RAW;\n@@ -272,9 +273,10 @@ static int call_diff_flush(void)\n \t\t     detect_rename, diff_score_opt,\n \t\t     pickaxe, pickaxe_opts,\n \t\t     diff_break_opt,\n-\t\t     orderfile);\n+\t\t     orderfile,\n+\t\t     diff_filter);\n \tif (diff_queue_is_empty()) {\n-\t\tdiff_flush(DIFF_FORMAT_NO_OUTPUT, 0);\n+\t\tdiff_flush(DIFF_FORMAT_NO_OUTPUT);\n \t\treturn 0;\n \t}\n \tif (header) {\n@@ -285,7 +287,7 @@ static int call_diff_flush(void)\n \t\tprintf(fmt, header, 0);\n \t\theader = NULL;\n \t}\n-\tdiff_flush(diff_output_format, 1);\n+\tdiff_flush(diff_output_format);\n \treturn 1;\n }\n \n@@ -455,6 +457,10 @@ int main(int argc, const char **argv)\n \t\t\torderfile = arg + 2;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strncmp(arg, \"--diff-filter=\", 14)) {\n+\t\t\tdiff_filter = arg + 14;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"--pickaxe-all\")) {\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n \t\t\tcontinue;\ndiff --git a/diff.c b/diff.c\n--- a/diff.c\n+++ b/diff.c\n@@ -920,7 +920,7 @@ static void diff_resolve_rename_copy(voi\n \tdiff_debug_queue(\"resolve-rename-copy done\", q);\n }\n \n-void diff_flush(int diff_output_style, int resolve_rename_copy)\n+void diff_flush(int diff_output_style)\n {\n \tstruct diff_queue_struct *q = &diff_queued_diff;\n \tint i;\n@@ -929,8 +929,6 @@ void diff_flush(int diff_output_style, i\n \n \tif (diff_output_style == DIFF_FORMAT_MACHINE)\n \t\tline_termination = inter_name_termination = 0;\n-\tif (resolve_rename_copy)\n-\t\tdiff_resolve_rename_copy();\n \n \tfor (i = 0; i < q->nr; i++) {\n \t\tstruct diff_filepair *p = q->queue[i];\n@@ -957,11 +955,58 @@ void diff_flush(int diff_output_style, i\n \tq->nr = q->alloc = 0;\n }\n \n+static void diffcore_apply_filter(const char *filter)\n+{\n+\tint i;\n+\tstruct diff_queue_struct *q = &diff_queued_diff;\n+\tstruct diff_queue_struct outq;\n+\toutq.queue = NULL;\n+\toutq.nr = outq.alloc = 0;\n+\n+\tif (!filter)\n+\t\treturn;\n+\n+\tif (strchr(filter, 'A')) {\n+\t\t/* All-or-none */\n+\t\tint found;\n+\t\tfor (i = found = 0; !found && i < q->nr; i++) {\n+\t\t\tstruct diff_filepair *p = q->queue[i];\n+\t\t\tif ((p->broken_pair && strchr(filter, 'B')) ||\n+\t\t\t    (!p->broken_pair && strchr(filter, p->status)))\n+\t\t\t\tfound++;\n+\t\t}\n+\t\tif (found)\n+\t\t\treturn;\n+\n+\t\t/* otherwise we will clear the whole queue\n+\t\t * by copying the empty outq at the end of this\n+\t\t * function, but first clear the current entries\n+\t\t * in the queue.\n+\t\t */\n+\t\tfor (i = 0; i < q->nr; i++)\n+\t\t\tdiff_free_filepair(q->queue[i]);\n+\t}\n+\telse {\n+\t\t/* Only the matching ones */\n+\t\tfor (i = 0; i < q->nr; i++) {\n+\t\t\tstruct diff_filepair *p = q->queue[i];\n+\t\t\tif ((p->broken_pair && strchr(filter, 'B')) ||\n+\t\t\t    (!p->broken_pair && strchr(filter, p->status)))\n+\t\t\t\tdiff_q(&outq, p);\n+\t\t\telse\n+\t\t\t\tdiff_free_filepair(p);\n+\t\t}\n+\t}\n+\tfree(q->queue);\n+\t*q = outq;\n+}\n+\n void diffcore_std(const char **paths,\n \t\t  int detect_rename, int rename_score,\n \t\t  const char *pickaxe, int pickaxe_opts,\n \t\t  int break_opt,\n-\t\t  const char *orderfile)\n+\t\t  const char *orderfile,\n+\t\t  const char *filter)\n {\n \tif (paths && paths[0])\n \t\tdiffcore_pathspec(paths);\n@@ -975,6 +1020,23 @@ void diffcore_std(const char **paths,\n \t\tdiffcore_pickaxe(pickaxe, pickaxe_opts);\n \tif (orderfile)\n \t\tdiffcore_order(orderfile);\n+\tdiff_resolve_rename_copy();\n+\tdiffcore_apply_filter(filter);\n+}\n+\n+\n+void diffcore_std_no_resolve(const char **paths,\n+\t\t\t     const char *pickaxe, int pickaxe_opts,\n+\t\t\t     const char *orderfile,\n+\t\t\t     const char *filter)\n+{\n+\tif (paths && paths[0])\n+\t\tdiffcore_pathspec(paths);\n+\tif (pickaxe)\n+\t\tdiffcore_pickaxe(pickaxe, pickaxe_opts);\n+\tif (orderfile)\n+\t\tdiffcore_order(orderfile);\n+\tdiffcore_apply_filter(filter);\n }\n \n void diff_addremove(int addremove, unsigned mode,\n------------\n\n"},{"id":"4912","messageId":"2cfc4032050613092462d3a456@mail.gmail.com","threadId":"908","inReplyTo":"7vwtp0p6tz.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix rename/copy when dealing with temporarily broken pairs.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-06-13T16:24:16Z","receivedAt":"2005-06-13T16:24:16Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"G'day Junio,\n\nOn 6/12/05, Junio C Hamano <junkio@cox.net> wrote:\n> When rename/copy uses a file that was broken by diffcore-break\n> as the source, and the broken filepair gets merged back later,\n> the output was mislabeled as a rename.  In this case, the source\n> file ends up staying in the output, so we should label it as a\n> copy instead.\n\nI've got a patch series that renames a file, but the patches generated by your\ngit-format-patch-script fail to rename the file to the new name.\n\nI wondered if this patch might fix it, but it doesn't seem to.\n\nHere's a hunk from the patch:\n\ndiff --git a/epoch.c b/traversal.c\nsimilarity index 100%\nrename from epoch.c\nrename to traversal.c\n--- a/epoch.c\n+++ b/traversal.c\n@@ -14,7 +14,7 @@\n\n #include \"cache.h\"\n #include \"commit.h\"\n-#include \"epoch.h\"\n+#include \"traversal.h\"\n\n struct fraction {\n        BIGNUM numerator;\n\nWhat tool am I meant to be using to apply the patch? \n\nI am currently using \"patch -p1\"\n\njon.\n"},{"id":"4914","messageId":"20050613175812.GA21005@pasky.ji.cz","threadId":"908","inReplyTo":"2cfc4032050613092462d3a456@mail.gmail.com","subject":"Re: [PATCH] Fix rename/copy when dealing with temporarily broken pairs.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-13T17:58:12Z","receivedAt":"2005-06-13T17:58:12Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Jun 13, 2005 at 06:24:16PM CEST, I got a letter\nwhere Jon Seymour <jon.seymour@gmail.com> told me that...\n> diff --git a/epoch.c b/traversal.c\n> similarity index 100%\n> rename from epoch.c\n> rename to traversal.c\n> What tool am I meant to be using to apply the patch? \n> \n> I am currently using \"patch -p1\"\n\nTry git-apply.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"},{"id":"4920","messageId":"7vis0ic6ot.fsf@assigned-by-dhcp.cox.net","threadId":"908","inReplyTo":"2cfc4032050613092462d3a456@mail.gmail.com","subject":"Re: [PATCH] Fix rename/copy when dealing with temporarily broken pairs.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-06-13T21:01:22Z","receivedAt":"2005-06-13T21:01:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"JS\" == Jon Seymour <jon.seymour@gmail.com> writes:\n\nJS> I've got a patch series that renames a file, but the patches\nJS> generated by your git-format-patch-script fail to rename the\nJS> file to the new name.\n\nJS> I wondered if this patch might fix it, but it doesn't seem to.\n\nI doubt the problem you have is related to the problem this\npatch addresses.  This is a fix for a case that the machinery\nsometimes says rename when it should say copy.\n\nRegular \"patch\" cannot grok either copy or rename.  If your\nrecipient uses \"patch\", then you must not use -C nor -M when you\nare preparing a diff for his consumption.\n\nJS> What tool am I meant to be using to apply the patch? \nJS> I am currently using \"patch -p1\"\n\nAs Petr already responded, the git-apply program from the King\nPenguin himself should work [*1*].\n\nOne thing I just want to make sure is this.  You are not\nreporting that the patch you sent that said \"rename\" should have\nbeen \"copy\", are you?  \n\nI understand that your change creates traversal.c out of\nepoch.c.  Say the output is from between commitA and commitB.\n\nWhat I would like to know is if commitB still contains epoch.c,\nor it does not have epoch.c anymore [*2*].  If it is the former\nthen I think you spotted a bug in the patch your message is a\nresponse to.  I hope that is not the case.\n\nP.S.  I will be offline shortly and will not be able to offer\nfurther help until perhaps late next week.\n\n\n[Footnote]\n\n*1* Find the thread in the mailing list archive that contains\nthis message, which I think would be of help too.\n\n    Date: Sun, 5 Jun 2005 16:17:56 -0700 (PDT)\n    From: Linus Torvalds <torvalds@osdl.org>\n    To: Junio C Hamano <junkio@cox.net>\n    cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org\n    Subject: Re: [PATCH-CAREFUL/RENAME] rename git-rpush and git-rpull to git-ssh-push and git-ssh-pull\n    Message-ID: <Pine.LNX.4.58.0506051613370.1876@ppc970.osdl.org>\n    References: <7vk6l9flzr.fsf@assigned-by-dhcp.cox.net>\n     <Pine.LNX.4.21.0506050132590.30848-100000@iabervon.org>\n     <7vfyvxb89m.fsf_-_@assigned-by-dhcp.cox.net> <Pine.LNX.4.58.0506051427280.1876@ppc970.osdl.org>\n     <7vmzq4zata.fsf@assigned-by-dhcp.cox.net>\n\n    On Sun, 5 Jun 2005, Junio C Hamano wrote:\n    > \n    > Here is a rebase.  To apply with git-apply, you need the \"Yes,\n    > sir\" patch to grok \"rename from/to\".\n\n    Seems to have applied correctly. Very nice.\n\n                    Linus\n\n"},{"id":"4924","messageId":"2cfc403205061315173f8095b8@mail.gmail.com","threadId":"908","inReplyTo":"7vis0ic6ot.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix rename/copy when dealing with temporarily broken pairs.","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-06-13T22:17:17Z","receivedAt":"2005-06-13T22:17:17Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On 6/14/05, Junio C Hamano <junkio@cox.net> wrote:\n> JS> I wondered if this patch might fix it, but it doesn't seem to.\n> Regular \"patch\" cannot grok either copy or rename.  If your\n> recipient uses \"patch\", then you must not use -C nor -M when you\n> are preparing a diff for his consumption.\n\nOk, there was no problem other than me not understanding what\ngit-apply did - thank you Pasky for bringing light to the dark regions\nof my sleep-deprived brain!\n\njon.\n"}]}