{"thread":{"id":"24913","subject":"Detection of relocations within a file","startedAt":"2010-08-30T15:04:56Z","lastAt":"2010-08-30T16:24:30Z","messageCount":3,"participants":["Tim Mazid","Jonathan Nieder","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149337","messageId":"SNT124-W57C91CBC3A362218ACA23DC4890@phx.gbl","threadId":"24913","inReplyTo":null,"subject":"Detection of relocations within a file","fromName":"Tim Mazid","fromEmail":"timmazid@hotmail.com","sentAt":"2010-08-30T15:04:56Z","receivedAt":"2010-08-30T15:04:56Z","isPatch":false,"sender":{"key":"timmazid@hotmail.com","avatar":null},"body":"\nHi git-list,\n\nI was just wondering if git can/does detect relocations of sections of code/text within a file.\n\nFor example, moving a function from the top of a file to the end.\n\nIf git does not currently do this, would it be a good/bad idea, and how hard would it be to implement?\n\nRegards,\nTim.\n \t\t \t   \t\t  "},{"id":"149338","messageId":"20100830154427.GB3292@burratino","threadId":"24913","inReplyTo":"SNT124-W57C91CBC3A362218ACA23DC4890@phx.gbl","subject":"Re: Detection of relocations within a file","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-30T15:44:27Z","receivedAt":"2010-08-30T15:44:27Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Tim,\n\nTim Mazid wrote:\n\n> I was just wondering if git can/does detect relocations of sections of code/text within a file.\n> \n> For example, moving a function from the top of a file to the end.\n\nDepends what you are trying to do.\n\n1. I am mystified by some piece of code, and I want to know where\nit originated.  Code movements is uninteresting to me (so grepping\nthrough a patch won't do it).  The command\n\n $ git log -S'const char git_more_info_string[] =\n\t\"See 'git help COMMAND' for more information on a specific command.\";' \\\n      -- git.c\n\ntells the originating commit pretty quickly.\n\n2. I am mystified not by some particular piece of code but by an\nentire file.  The command\n\n $ git gui blame -- git.c\n\nworks okay.\n\n3. The origins of some piece of code make enough sense, but the code\nchanges since then are a mystery to investigate.  The command\n\n $ git log -L '/int main(/,/}/' git.c\n\nwith git from the \"next\" branch can help.\n\n4. I want a simple, easy-to-review patch representing a code movement.\nNo one I know of has worked on this, and if you have ideas for it,\nthat would be very neat.\n"},{"id":"149342","messageId":"vpqk4n81329.fsf@bauges.imag.fr","threadId":"24913","inReplyTo":"20100830154427.GB3292@burratino","subject":"Re: Detection of relocations within a file","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-08-30T16:24:30Z","receivedAt":"2010-08-30T16:24:30Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> 4. I want a simple, easy-to-review patch representing a code movement.\n> No one I know of has worked on this, and if you have ideas for it,\n> that would be very neat.\n\n5. I have a history with a lot of code movement, someone branched from\nme a while ago, modified various pieces of code which moved in the\nmeantime, and we want to merge.\n\nUnfortunately, I don't think any VCS does a really good job here\neither.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}