{"thread":{"id":"23476","subject":"Possible bug in Git","startedAt":"2010-04-15T10:47:42Z","lastAt":"2010-04-16T17:00:26Z","messageCount":12,"participants":["David Martínez Martí","Thomas Rast","Avery Pennarun","Junio C Hamano","Jay Soffian","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"139573","messageId":"4BC6EECE.6060408@gestiweb.com","threadId":"23476","inReplyTo":null,"subject":"Possible bug in Git","fromName":"David Martínez Martí","fromEmail":"desarrollo@gestiweb.com","sentAt":"2010-04-15T10:47:42Z","receivedAt":"2010-04-15T10:47:42Z","isPatch":false,"sender":{"key":"desarrollo@gestiweb.com","avatar":null},"body":"(Please add deavidsedice@gmail.com and desarrollo@gestiweb.com to CC \nbecause I'm not suscripted to this list)\n\nHere I've a strange behaviour in GIT:\n\nWe noticed a file in our repo is empty: \nfacturacion/facturacion/scripts/lineasfacturascli.qs\n\nWe didn't found the reason using gitk --all -- \nfacturacion/facturacion/scripts/lineasfacturascli.qs\n\nWith git bisect we found the problematic commit: \ndac6a95f559604978ff9e1fac24ad752c54382ae\n\nWith git show, it doesn't show anything about the modification:\n\n$ git show dac6a95f5 -p --pretty=raw -- \nfacturacion/facturacion/scripts/lineasfacturascli.qs\ncommit dac6a95f559604978ff9e1fac24ad752c54382ae\ntree f1472f1d289f9813df5fd691c9cea6ccb04313a7\nparent 5dfdd78f24f4578cdfeed876b8bacb45790af9ef\nparent 6ed54c8c6508b6d5551290b45785eaf44dd05d75\nauthor David Martinez Marti <desarrollo@gestiweb.com> 1260959309 +0100\ncommitter David Martinez Marti <desarrollo@gestiweb.com> 1260959309 +0100\n\n     Merge remote branch 'origin/infosial'\n\n     Conflicts:\n         contabilidad/informes/scripts/flcontinfo.qs\n         facturacion/almacen/forms/articulos.ui\n         facturacion/almacen/scripts/articulos.qs\n         facturacion/almacen/tables/factalma_general.mtd\n         facturacion/facturacion/forms/albaranescli.ui\n         facturacion/facturacion/forms/albaranesprov.ui\n         facturacion/facturacion/forms/facturasprov.ui\n         facturacion/facturacion/forms/pedidoscli.ui\n         facturacion/facturacion/forms/pedidosprov.ui\n         facturacion/facturacion/forms/presupuestoscli.ui\n         facturacion/facturacion/scripts/facturascli.qs\n         facturacion/facturacion/scripts/facturasprov.qs\n         facturacion/facturacion/scripts/flfacturac.qs\n         facturacion/facturacion/scripts/lineasalbaranescli.qs\n         facturacion/facturacion/scripts/lineasfacturascli.qs\n         facturacion/facturacion/scripts/lineaspresupuestoscli.qs\n         facturacion/informes/flfactinfo.xml\n         facturacion/informes/forms/i_reciboscli.ui\n         facturacion/informes/forms/i_recibosprov.ui\n         facturacion/informes/queries/i_reciboscli.qry\n         facturacion/informes/queries/i_recibosprov.qry\n         facturacion/informes/queries/i_resreciboscli.qry\n         facturacion/informes/queries/i_resrecibosprov.qry\n         facturacion/informes/scripts/flfactinfo.qs\n         facturacion/informes/scripts/i_masterinventario.qs\n         facturacion/principal/flfactppal.xml\n         facturacion/principal/forms/agentes.ui\n         facturacion/principal/forms/clientes.ui\n         facturacion/principal/forms/empresa.ui\n         facturacion/principal/forms/flfactppal.ui\n         facturacion/principal/forms/proveedores.ui\n         facturacion/principal/scripts/clientes.qs\n         facturacion/principal/scripts/proveedores.qs\n         facturacion/principal/tables/clientes.mtd\n         facturacion/principal/tables/proveedores.mtd\n         facturacion/tesoreria/tables/reciboscli.mtd\n\n\n\n\nThere was a conflict on that file but it doesn't show anything changed \nabout it. Gitk does the same.\n\ngit show commit^1:path and git show commit^2:path shows the files:\n\n$ git show \ndac6a95f5^1:facturacion/facturacion/scripts/lineasfacturascli.qs | head\n/***************************************************************************\n                  lineasfacturascli.qs  -  description\n                              -------------------\n     begin                : lun abr 26 2004\n     copyright            : (C) 2004 by InfoSiAL S.L.\n     email                : mail@infosial.com\n  ***************************************************************************/\n/***************************************************************************\n  *                                                                         *\n  *   This program is free software; you can redistribute it and/or \nmodify  *\n\n\n$ git show \ndac6a95f5^2:facturacion/facturacion/scripts/lineasfacturascli.qs | head\n/***************************************************************************\n                  lineasfacturascli.qs  -  description\n                              -------------------\n     begin                : lun abr 26 2004\n     copyright            : (C) 2004 by InfoSiAL S.L.\n     email                : mail@infosial.com\n  ***************************************************************************/\n/***************************************************************************\n  *                                                                         *\n  *   This program is free software; you can redistribute it and/or \nmodify  *\n\n\ngit show commit:path shows empty file:\n$ git show \ndac6a95f5:facturacion/facturacion/scripts/lineasfacturascli.qs | wc\n       0       0       0\n\n\n\nI believe that changes *should* appear on git log -p and on gitk, and \nthey doesn't, so I think it may be a bug in some git tools.\n\nTell me if I can do anything to fdetermine if it's really a bug and \nwhere it is to help GIT devs resovling it.\n\nPD: I know my merge failed somehow, and I corrected it in a newer commit.\n"},{"id":"139585","messageId":"884b9b68a4478aceda580299c059a9a67417cb1c.1271336073.git.trast@student.ethz.ch","threadId":"23476","inReplyTo":"4BC6EECE.6060408@gestiweb.com","subject":"[PATCH] combined diff: correctly handle truncated file","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-04-15T12:59:37Z","receivedAt":"2010-04-15T12:59:37Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Consider an evil merge of two commits A and B, both of which have a\nfile 'foo', but the merge result does not have that file.\n\nThe combined-diff code learned in 4462731 (combine-diff: do not punt\non removed or added files., 2006-02-06) to concisely show only the\nremoval, since that is the evil part and the previous contents are\npresumably uninteresting.\n\nHowever, to diagnose an empty merge result, it overloaded the variable\nthat holds the file's length.  This means that the check also triggers\nfor truncated files.  Consequently, such files were not shown in the\ndiff at all despite the merge being clearly evil.\n\nFix this by adding a new variable that distinguishes whether the file\nwas deleted (which is the case 4462731 handled) or truncated.  In the\ntruncated case, we show the full combined diff again, which is rather\nspammy but at least does not hide the evilness.\n\nReported-by: David Martínez Martí <desarrollo@gestiweb.com>\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n combine-diff.c           |   14 ++++++++------\n t/t4038-diff-combined.sh |    8 ++++++++\n 2 files changed, 16 insertions(+), 6 deletions(-)\n\ndiff --git a/combine-diff.c b/combine-diff.c\nindex 6162691..3480dae 100644\n--- a/combine-diff.c\n+++ b/combine-diff.c\n@@ -204,7 +204,7 @@ static void consume_line(void *state_, char *line, unsigned long len)\n static void combine_diff(const unsigned char *parent, unsigned int mode,\n \t\t\t mmfile_t *result_file,\n \t\t\t struct sline *sline, unsigned int cnt, int n,\n-\t\t\t int num_parent)\n+\t\t\t int num_parent, int result_deleted)\n {\n \tunsigned int p_lno, lno;\n \tunsigned long nmask = (1UL << n);\n@@ -215,7 +215,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,\n \tstruct combine_diff_state state;\n \tunsigned long sz;\n \n-\tif (!cnt)\n+\tif (result_deleted)\n \t\treturn; /* result deleted */\n \n \tparent_file.ptr = grab_blob(parent, mode, &sz);\n@@ -517,7 +517,7 @@ static void show_line_to_eol(const char *line, int len, const char *reset)\n }\n \n static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,\n-\t\t       int use_color)\n+\t\t       int use_color, int result_deleted)\n {\n \tunsigned long mark = (1UL<<num_parent);\n \tunsigned long no_pre_delete = (2UL<<num_parent);\n@@ -530,7 +530,7 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,\n \tconst char *c_plain = diff_get_color(use_color, DIFF_PLAIN);\n \tconst char *c_reset = diff_get_color(use_color, DIFF_RESET);\n \n-\tif (!cnt)\n+\tif (result_deleted)\n \t\treturn; /* result deleted */\n \n \twhile (1) {\n@@ -687,6 +687,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,\n {\n \tstruct diff_options *opt = &rev->diffopt;\n \tunsigned long result_size, cnt, lno;\n+\tint result_deleted = 0;\n \tchar *result, *cp;\n \tstruct sline *sline; /* survived lines */\n \tint mode_differs = 0;\n@@ -767,6 +768,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,\n \t\t}\n \t\telse {\n \t\tdeleted_file:\n+\t\t\tresult_deleted = 1;\n \t\t\tresult_size = 0;\n \t\t\telem->mode = 0;\n \t\t\tresult = xcalloc(1, 1);\n@@ -823,7 +825,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,\n \t\t\tcombine_diff(elem->parent[i].sha1,\n \t\t\t\t     elem->parent[i].mode,\n \t\t\t\t     &result_file, sline,\n-\t\t\t\t     cnt, i, num_parent);\n+\t\t\t\t     cnt, i, num_parent, result_deleted);\n \t\tif (elem->parent[i].mode != elem->mode)\n \t\t\tmode_differs = 1;\n \t}\n@@ -889,7 +891,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,\n \t\t\tdump_quoted_path(\"+++ \", b_prefix, elem->path,\n \t\t\t\t\t c_meta, c_reset);\n \t\tdump_sline(sline, cnt, num_parent,\n-\t\t\t   DIFF_OPT_TST(opt, COLOR_DIFF));\n+\t\t\t   DIFF_OPT_TST(opt, COLOR_DIFF), result_deleted);\n \t}\n \tfree(result);\n \ndiff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\nindex 7584efa..09e8c8a 100755\n--- a/t/t4038-diff-combined.sh\n+++ b/t/t4038-diff-combined.sh\n@@ -81,4 +81,12 @@ test_expect_success 'check combined output (2)' '\n \tverify_helper sidesansone\n '\n \n+test_expect_success 'diagnose truncated file' '\n+\t: > file &&\n+\tgit add file &&\n+\tgit commit --amend -C HEAD &&\n+\tgit show > out &&\n+\tgrep \"diff --cc file\" out\n+'\n+\n test_done\n-- \n1.7.1.rc1.265.g77471\n"},{"id":"139637","messageId":"k2u32541b131004151645i78733507rc50724548036ef36@mail.gmail.com","threadId":"23476","inReplyTo":"4BC6EECE.6060408@gestiweb.com","subject":"Re: Possible bug in Git","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-15T23:45:59Z","receivedAt":"2010-04-15T23:45:59Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Apr 15, 2010 at 6:47 AM, David Martínez Martí\n<desarrollo@gestiweb.com> wrote:\n> $ git show dac6a95f5 -p --pretty=raw --\n> facturacion/facturacion/scripts/lineasfacturascli.qs\n> commit dac6a95f559604978ff9e1fac24ad752c54382ae\n> tree f1472f1d289f9813df5fd691c9cea6ccb04313a7\n> parent 5dfdd78f24f4578cdfeed876b8bacb45790af9ef\n> parent 6ed54c8c6508b6d5551290b45785eaf44dd05d75\n> author David Martinez Marti <desarrollo@gestiweb.com> 1260959309 +0100\n> committer David Martinez Marti <desarrollo@gestiweb.com> 1260959309 +0100\n>\n>    Merge remote branch 'origin/infosial'\n>\n>    Conflicts:\n>       [...]\n>    [empty diff]\n>\n> There was a conflict on that file but it doesn't show anything changed about\n> it. Gitk does the same.\n\nYou're trying to show the log of a merge commit.  git tries to be\nclever about showing diffs on such commits, but it screws up rather\ntoo often to be reliable, and this bites a lot of people (including\nmyself).\n\nThe core of the problem is this: if you're looking at 'git log -p',\nyou'll see all the individual commits.  But a merge commit is\nessentially a combination of all the commits on branch #2 as you add\nthem to branch #1.  (Or alternatively: all the commits on branch #1 as\nyou add them to branch #2.)  So if git did the obvious thing and just\nshowed the *entire* diff that the merge applies to branch #1, it would\nbe a big long patch, but worse, it would be *equivalent* to the\npatches you've already seen from other individual commits.\n\nSo what git tries to do is reduce the diff output of a merge commit\ndown to just the \"unexpected\" parts: the parts that are different from\nwhat you'd get if you just merged in the individual changes in the\nobvious way.  Unfortunately, actually calculating that would be really\ncomplicated; it would require redoing the whole merge just to find out\nwhat happened, and that turns out to be too slow.  So git uses\nheuristics to try to guess what happened, and those heuristics don't\nalways work out.  In your case, it seems to have decided that \"nothing\nspecial happened\" during the merge even though apparently the file was\nentirely blanked out, which seems obviously wrong to me, but I don't\nactually know how the heuristics work.\n\nThe \"git log\" options -c and --cc are documented (in 'man git-log') as\nsupposedly affecting this behaviour.  However, it seems that \"--cc\"\nbecame the default somehow, and there's no obvious way to turn it back\nto the \"supposedly default\" plain or -c behaviour.  Maybe someone else\non the list can comment more.\n\nHave fun,\n\nAvery\n"},{"id":"139638","messageId":"7vr5mggt9a.fsf@alter.siamese.dyndns.org","threadId":"23476","inReplyTo":"k2u32541b131004151645i78733507rc50724548036ef36@mail.gmail.com","subject":"Re: Possible bug in Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-16T00:01:37Z","receivedAt":"2010-04-16T00:01:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Avery Pennarun <apenwarr@gmail.com> writes:\n\n> So what git tries to do is reduce the diff output of a merge commit\n> down to just the \"unexpected\" parts: the parts that are different from\n> what you'd get if you just merged in the individual changes in the\n> obvious way.\n\nThis (and everything you said after this paragraph) is not quite correct.\nWhat is shown is the pieces that do not match either of the parent.\n\nSo if you have a conflicted merge and resolve it by taking what one side\ndid literally (think: \"merge -X ours\"), that hunk becomes uninteresting\nbecause the end result matches what one of the parents had.\n"},{"id":"139639","messageId":"o2m32541b131004151706hb48a0d04yf7fa4238d423a4e3@mail.gmail.com","threadId":"23476","inReplyTo":"7vr5mggt9a.fsf@alter.siamese.dyndns.org","subject":"Re: Possible bug in Git","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-16T00:06:46Z","receivedAt":"2010-04-16T00:06:46Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Apr 15, 2010 at 8:01 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Avery Pennarun <apenwarr@gmail.com> writes:\n>\n>> So what git tries to do is reduce the diff output of a merge commit\n>> down to just the \"unexpected\" parts: the parts that are different from\n>> what you'd get if you just merged in the individual changes in the\n>> obvious way.\n>\n> This (and everything you said after this paragraph) is not quite correct.\n> What is shown is the pieces that do not match either of the parent.\n>\n> So if you have a conflicted merge and resolve it by taking what one side\n> did literally (think: \"merge -X ours\"), that hunk becomes uninteresting\n> because the end result matches what one of the parents had.\n\nHmm, but David also said:\n\n>>> git show commit:path shows empty file:\n>>> $ git show dac6a95f5:facturacion/facturacion/scripts/lineasfacturascli.qs | wc\n>>>     0       0       0\n\nThe output seems to match neither parent in any way, and yet the\nsimplification has resulted in no diff at all.  Strange, no?\n\nAvery\n"},{"id":"139640","messageId":"k2n32541b131004151713s51498b01s34c5a95c0f360901@mail.gmail.com","threadId":"23476","inReplyTo":"o2m32541b131004151706hb48a0d04yf7fa4238d423a4e3@mail.gmail.com","subject":"Re: Possible bug in Git","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-16T00:13:55Z","receivedAt":"2010-04-16T00:13:55Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Apr 15, 2010 at 8:06 PM, Avery Pennarun <apenwarr@gmail.com> wrote:\n> On Thu, Apr 15, 2010 at 8:01 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Avery Pennarun <apenwarr@gmail.com> writes:\n>>\n>>> So what git tries to do is reduce the diff output of a merge commit\n>>> down to just the \"unexpected\" parts: the parts that are different from\n>>> what you'd get if you just merged in the individual changes in the\n>>> obvious way.\n>>\n>> This (and everything you said after this paragraph) is not quite correct.\n>> What is shown is the pieces that do not match either of the parent.\n>>\n>> So if you have a conflicted merge and resolve it by taking what one side\n>> did literally (think: \"merge -X ours\"), that hunk becomes uninteresting\n>> because the end result matches what one of the parents had.\n>\n> Hmm, but David also said:\n>\n>>>> git show commit:path shows empty file:\n>>>> $ git show dac6a95f5:facturacion/facturacion/scripts/lineasfacturascli.qs | wc\n>>>>     0       0       0\n>\n> The output seems to match neither parent in any way, and yet the\n> simplification has resulted in no diff at all.  Strange, no?\n>\n> Avery\n>\n\n mkdir testy\n cd testy\n git init\n cp /etc/profile .\n git add profile\n git commit -m root\n git checkout -b a master\n cat /etc/profile >>profile\n git commit -a -m test1\n git checkout -b b master\n cat /etc/profile | tr A-Za-z a-zA-Z >profile\n git commit -a -m test1b\n git merge a\n   # produces a conflict\n true >profile   # blank the file\n git commit -a -m resolved\n git show HEAD:profile\n   # no output\n\nNote that if you instead replace the file with a nonempty (but\ndifferent) file, you get something appropriate as the output.\n\nHave fun,\n\nAvery\n"},{"id":"139641","messageId":"o2w76718491004151738zb2deaad1p3f7360a437725c4d@mail.gmail.com","threadId":"23476","inReplyTo":"k2n32541b131004151713s51498b01s34c5a95c0f360901@mail.gmail.com","subject":"Re: Possible bug in Git","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-04-16T00:38:58Z","receivedAt":"2010-04-16T00:38:58Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Apr 15, 2010 at 8:13 PM, Avery Pennarun <apenwarr@gmail.com> wrote:\n>  true >profile   # blank the file\n>  git commit -a -m resolved\n>  git show HEAD:profile\n>   # no output\n\nWell, I wouldn't expect output from show HEAD:profile. But this is odd::\n\n$ git diff HEAD^1 --name-status\nM       profile\n\n$ git diff HEAD^2 --name-status\nM       profile\n\n$ git diff-tree HEAD --name-status\n<no output>\n\nHmfph. \"git log -m -p -1\" at least gives the diffs from each side.\n\nj.\n"},{"id":"139643","messageId":"u2t32541b131004151745k5284b05egfcbbd29d69bd9d94@mail.gmail.com","threadId":"23476","inReplyTo":"o2w76718491004151738zb2deaad1p3f7360a437725c4d@mail.gmail.com","subject":"Re: Possible bug in Git","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-16T00:45:55Z","receivedAt":"2010-04-16T00:45:55Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Apr 15, 2010 at 8:38 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> On Thu, Apr 15, 2010 at 8:13 PM, Avery Pennarun <apenwarr@gmail.com> wrote:\n>>  true >profile   # blank the file\n>>  git commit -a -m resolved\n>>  git show HEAD:profile\n>>   # no output\n>\n> Well, I wouldn't expect output from show HEAD:profile. But this is odd::\n>\n> $ git diff HEAD^1 --name-status\n> M       profile\n>\n> $ git diff HEAD^2 --name-status\n> M       profile\n>\n> $ git diff-tree HEAD --name-status\n> <no output>\n>\n> Hmfph. \"git log -m -p -1\" at least gives the diffs from each side.\n\nWhoops, actually I meant \"git show HEAD profile\".  Totally different,\nof course.  But it doesn't produce output either :)\n\nHave fun,\n\nAvery\n"},{"id":"139670","messageId":"alpine.LFD.2.00.1004160845350.15116@i5.linux-foundation.org","threadId":"23476","inReplyTo":"k2n32541b131004151713s51498b01s34c5a95c0f360901@mail.gmail.com","subject":"Re: Possible bug in Git","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2010-04-16T15:53:00Z","receivedAt":"2010-04-16T15:53:00Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 15 Apr 2010, Avery Pennarun wrote:\n> >\n> > The output seems to match neither parent in any way, and yet the\n> > simplification has resulted in no diff at all.  Strange, no?\n> \n>  mkdir testy\n>  cd testy\n>  git init\n>  cp /etc/profile .\n>  git add profile\n>  git commit -m root\n>  git checkout -b a master\n>  cat /etc/profile >>profile\n>  git commit -a -m test1\n>  git checkout -b b master\n>  cat /etc/profile | tr A-Za-z a-zA-Z >profile\n>  git commit -a -m test1b\n>  git merge a\n>    # produces a conflict\n>  true >profile   # blank the file\n>  git commit -a -m resolved\n>  git show HEAD:profile\n>    # no output\n> \n> Note that if you instead replace the file with a nonempty (but\n> different) file, you get something appropriate as the output.\n\nHmm. That does seem to be a bug. It's clearly an evil merge that doesn't \nmatch either side, and we should show it as such.\n\nAnd yes, changing the\n\n\ttrue >profile\n\nto\n\n\techo 1 >profile\n\nchanges it to suddenly show it as such.\n\nI guess the issue is that combine-diff decides that there is nothing in \nthe result that isn't in either of the sources (because there is nothing \nat all in the result), and as such it's not \"interesting\" after all.\n\n\t\tLinus\n"},{"id":"139674","messageId":"201004161839.37731.trast@student.ethz.ch","threadId":"23476","inReplyTo":"alpine.LFD.2.00.1004160845350.15116@i5.linux-foundation.org","subject":"Re: Possible bug in Git","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-04-16T16:39:37Z","receivedAt":"2010-04-16T16:39:37Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Linus Torvalds wrote:\n> I guess the issue is that combine-diff decides that there is nothing in \n> the result that isn't in either of the sources (because there is nothing \n> at all in the result), and as such it's not \"interesting\" after all.\n\nIt does give me a warm and fuzzy feeling when you are devising and\ndiscussing test cases for a bug that I believe I fixed before this\nbranch of the thread even began:\n\n  http://article.gmane.org/gmane.comp.version-control.git/144982\n\n:-)\n\n[scnr]\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"139686","messageId":"7vvdbrcp5g.fsf@alter.siamese.dyndns.org","threadId":"23476","inReplyTo":"alpine.LFD.2.00.1004160845350.15116@i5.linux-foundation.org","subject":"Re: Possible bug in Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-16T16:56:11Z","receivedAt":"2010-04-16T16:56:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> I guess the issue is that combine-diff decides that there is nothing in \n> the result that isn't in either of the sources (because there is nothing \n> at all in the result), and as such it's not \"interesting\" after all.\n\nThere was already a \"fix\" posted for the \"empty vs missing\" confusion.\n\nFrom: Thomas Rast <trast@student.ethz.ch>\nSubject: [PATCH] combined diff: correctly handle truncated file\nDate: Thu, 15 Apr 2010 14:59:37 +0200\nMessage-ID:\n <884b9b68a4478aceda580299c059a9a67417cb1c.1271336073.git.trast@student.ethz.ch>\n\nI've been busy for the past few days, but I have it in my 'to-maint'\nqueue.  We may actually want to do the same for \"missing\" case as well,\nthough.\n"},{"id":"139688","messageId":"201004161900.26537.trast@student.ethz.ch","threadId":"23476","inReplyTo":"7vvdbrcp5g.fsf@alter.siamese.dyndns.org","subject":"Re: Possible bug in Git","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-04-16T17:00:26Z","receivedAt":"2010-04-16T17:00:26Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> There was already a \"fix\" posted for the \"empty vs missing\" confusion.\n> \n> From: Thomas Rast <trast@student.ethz.ch>\n> Subject: [PATCH] combined diff: correctly handle truncated file\n> Date: Thu, 15 Apr 2010 14:59:37 +0200\n> Message-ID:\n>  <884b9b68a4478aceda580299c059a9a67417cb1c.1271336073.git.trast@student.ethz.ch>\n> \n> I've been busy for the past few days, but I have it in my 'to-maint'\n> queue.  We may actually want to do the same for \"missing\" case as well,\n> though.\n\nWhy?  The evil deletion is already reported as\n\n  diff --cc foo\n  index 5716ca5,7601807..0000000\n  deleted file mode 100644,100644\n  --- a/foo\n  +++ /dev/null\n\nwith no diff -- but the absence of a diff is because of your 4462731\n(combine-diff: do not punt on removed or added files., 2006-02-06) and\nI tend to agree with the reasoning.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}