{"thread":{"id":"5295","subject":"[RFC] Enable 'check for copy and renames' (-C) also when path filtering","startedAt":"2006-08-16T09:06:49Z","lastAt":"2006-08-16T21:11:26Z","messageCount":4,"participants":["Marco Costalba","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"25409","messageId":"e5bfff550608160206w606008ddv2da42ce49e98fa2b@mail.gmail.com","threadId":"5295","inReplyTo":null,"subject":"[RFC] Enable 'check for copy and renames' (-C) also when path filtering","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2006-08-16T09:06:49Z","receivedAt":"2006-08-16T09:06:49Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"It seems that -C option of git-diff-tree it works only if the whole\nchangeset is retrieved.\n\n>From git repository:\n\n- Ask for all\n\n$git diff-tree  -r -p -C 5d4a600\n5d4a60033543e063bc9d77ca957de0187fb58fb3\ndiff --git a/Makefile b/Makefile\nindex 132c9cf..4fd62bc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -177,7 +177,7 @@ PROGRAMS = \\\n  \tgit-convert-objects$X git-fetch-pack$X git-fsck-objects$X \\\n\n            ----cut----\n\ndiff --git a/pack-objects.c b/builtin-pack-objects.c\nsimilarity index 100%                          <-------  similarity and\nrename from pack-objects.c              <--------  rename info shown\nrename to builtin-pack-objects.c      <--------  only in this case\nindex 861c7f0..2301cd5 100644\n--- a/pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -1,3 +1,4 @@\n+#include \"builtin.h\"\n #include \"cache.h\"\n\n\n- Ask for pack-objects.c only\n\n$git diff-tree  -r -p -C 5d4a600 -- pack-objects.c\n5d4a60033543e063bc9d77ca957de0187fb58fb3\ndiff --git a/pack-objects.c b/pack-objects.c\ndeleted file mode 100644\nindex 861c7f0..0000000\n--- a/pack-objects.c\n+++ /dev/null\n@@ -1,1376 +0,0 @@\n-#include \"cache.h\"\n-#include \"object.h\"\n\n\n- Ask for builtin-pack-objects.conly\n\n$git diff-tree  -r -p -C 5d4a600 -- builtin-pack-objects.c\n5d4a60033543e063bc9d77ca957de0187fb58fb3\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nnew file mode 100644\nindex 0000000..2301cd5\n--- /dev/null\n+++ b/builtin-pack-objects.c\n@@ -0,0 +1,1376 @@\n+#include \"builtin.h\"\n+#include \"cache.h\"\n+#include \"object.h\"\n\nShowing rename info also when filtering on a specified path could be\nuseful to retrieve a single file history following renames.\n\nThanks\nMarco\n"},{"id":"25420","messageId":"7v8xlo4lht.fsf@assigned-by-dhcp.cox.net","threadId":"5295","inReplyTo":"e5bfff550608160206w606008ddv2da42ce49e98fa2b@mail.gmail.com","subject":"Re: [RFC] Enable 'check for copy and renames' (-C) also when path filtering","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-16T17:51:42Z","receivedAt":"2006-08-16T17:51:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Marco Costalba\" <mcostalba@gmail.com> writes:\n\n> It seems that -C option of git-diff-tree it works only if the whole\n> changeset is retrieved.\n\nCorrect (sort of).  Pathspec works on the input side not on the\noutput side.  It's been specified and worked that way from the\nbeginning (check the list archive to see me arguing that it\nwould be easier to use on the output side, and Linus vetoing\nbecause following a single file is not that interesting and the\ncost outweighs the benefit of that uninteresting case).\n\nAlways feeding the whole tree is wasteful, but if we are\ninterested in following a single file, we could do something\nlike:\n\n - follow that file and that file only from the recent to past;\n\n - notice when that file disappears -- that is the point the\n   file was created.  it may have created from scratch, it may\n   have been renamed or copied.\n\n - on that commit that creates the file, look at the whole tree\n   to see if we can find an origin.\n\n - if we find that the file was created by renaming or copying\n   another, keep following that other file from that point on.\n"},{"id":"25427","messageId":"e5bfff550608161349t29a678ccl4b211cb570a1217d@mail.gmail.com","threadId":"5295","inReplyTo":"7v8xlo4lht.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC] Enable 'check for copy and renames' (-C) also when path filtering","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2006-08-16T20:49:17Z","receivedAt":"2006-08-16T20:49:17Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 8/16/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Marco Costalba\" <mcostalba@gmail.com> writes:\n>\n> > It seems that -C option of git-diff-tree it works only if the whole\n> > changeset is retrieved.\n>\n> Correct (sort of).  Pathspec works on the input side not on the\n> output side.  It's been specified and worked that way from the\n> beginning (check the list archive to see me arguing that it\n> would be easier to use on the output side, and Linus vetoing\n> because following a single file is not that interesting and the\n> cost outweighs the benefit of that uninteresting case).\n>\n> Always feeding the whole tree is wasteful, but if we are\n> interested in following a single file, we could do something\n> like:\n>\n>  - follow that file and that file only from the recent to past;\n>\n>  - notice when that file disappears -- that is the point the\n>    file was created.  it may have created from scratch, it may\n>    have been renamed or copied.\n>\n>  - on that commit that creates the file, look at the whole tree\n>    to see if we can find an origin.\n>\n>  - if we find that the file was created by renaming or copying\n>    another, keep following that other file from that point on.\n>\n\nYes, I was thinking about something like this, Thanks for point me out\nthis, now I am quite sure it's the correct way to go ;-)\n\n   Marco\n\nP.S: The first thing will be to teach qgit about renames and copies,\ni.e. diff-tree with -C option. I'm cooking a patch on this.\n\nBTW, regarding copies, there are only 6 (6973dca, 8752d11, 927a503,\n2276aa6, ddafa7e9 and 7ef7692) in git tree, against 181 renames.\n"},{"id":"25429","messageId":"7vr6zg2xoh.fsf@assigned-by-dhcp.cox.net","threadId":"5295","inReplyTo":"e5bfff550608161349t29a678ccl4b211cb570a1217d@mail.gmail.com","subject":"Re: [RFC] Enable 'check for copy and renames' (-C) also when path filtering","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-16T21:11:26Z","receivedAt":"2006-08-16T21:11:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Marco Costalba\" <mcostalba@gmail.com> writes:\n\n> On 8/16/06, Junio C Hamano <junkio@cox.net> wrote:\n>> \"Marco Costalba\" <mcostalba@gmail.com> writes:\n>>\n>> > It seems that -C option of git-diff-tree it works only if the whole\n>> > changeset is retrieved.\n>>\n>> Correct (sort of).  Pathspec works on the input side not on the\n>> output side.  It's been specified and worked that way from the\n>> beginning (check the list archive to see me arguing that it\n>> would be easier to use on the output side, and Linus vetoing\n>> because following a single file is not that interesting and the\n>> cost outweighs the benefit of that uninteresting case).\n>>\n>> Always feeding the whole tree is wasteful, but if we are\n>> interested in following a single file, we could do something\n>> like:\n>>\n>>  - follow that file and that file only from the recent to past;\n>>\n>>  - notice when that file disappears -- that is the point the\n>>    file was created.  it may have created from scratch, it may\n>>    have been renamed or copied.\n>>\n>>  - on that commit that creates the file, look at the whole tree\n>>    to see if we can find an origin.\n>>\n>>  - if we find that the file was created by renaming or copying\n>>    another, keep following that other file from that point on.\n>\n> Yes, I was thinking about something like this, Thanks for point me out\n> this, now I am quite sure it's the correct way to go ;-)\n\nYou may want to talk with Fredrik about this.  The above is not\nentirely my making but was an outline brought up while we\ndiscussed his \"rename following revision walker\" on the list\nrecently. \n"}]}