{"thread":{"id":"18287","subject":"Choosing between \"renaming\" and \"copy\"","startedAt":"2009-03-12T13:01:14Z","lastAt":"2009-03-12T14:44:25Z","messageCount":2,"participants":["Samuel Tardieu","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107826","messageId":"2009-03-12-14-01-15+trackit+sam@rfc1149.net","threadId":"18287","inReplyTo":null,"subject":"Choosing between \"renaming\" and \"copy\"","fromName":"Samuel Tardieu","fromEmail":"sam@rfc1149.net","sentAt":"2009-03-12T13:01:14Z","receivedAt":"2009-03-12T13:01:14Z","isPatch":false,"sender":{"key":"sam@rfc1149.net","avatar":"https://avatars.githubusercontent.com/u/44656?v=4"},"body":"I renamed a file in my repository, and made a slightly modified copy\nof it. It looks like GIT gets confused on which one is the renaming\nand which one is the copy, and doesn't favour the 100% identical one\nto be chosen as the renaming.\n\nNot a big deal, but maybe git could be more clever here.\n\n% git commit -m \"Split into flash and ram alternatives.\" \n[stm32-sk 601462c] Split into flash and ram alternatives.\n 3 files changed, 3 insertions(+), 2 deletions(-)\n copy Demo/CORTEX_STM32SK_GCC/{stm32f103r8t6.ld => stm32f103r8t6_flash.ld} (100%)\n rename Demo/CORTEX_STM32SK_GCC/{stm32f103r8t6.ld => stm32f103r8t6_ram.ld} (98%)\n\n% git --version\ngit version 1.6.2.rc2.305.g23381\n\n  Sam\n-- \nSamuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/\n"},{"id":"107832","messageId":"49B91FC9.6090700@op5.se","threadId":"18287","inReplyTo":"2009-03-12-14-01-15+trackit+sam@rfc1149.net","subject":"Re: Choosing between \"renaming\" and \"copy\"","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-03-12T14:44:25Z","receivedAt":"2009-03-12T14:44:25Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Samuel Tardieu wrote:\n> I renamed a file in my repository, and made a slightly modified copy\n> of it. It looks like GIT gets confused on which one is the renaming\n> and which one is the copy, and doesn't favour the 100% identical one\n> to be chosen as the renaming.\n> \n> Not a big deal, but maybe git could be more clever here.\n> \n> % git commit -m \"Split into flash and ram alternatives.\" \n> [stm32-sk 601462c] Split into flash and ram alternatives.\n>  3 files changed, 3 insertions(+), 2 deletions(-)\n>  copy Demo/CORTEX_STM32SK_GCC/{stm32f103r8t6.ld => stm32f103r8t6_flash.ld} (100%)\n>  rename Demo/CORTEX_STM32SK_GCC/{stm32f103r8t6.ld => stm32f103r8t6_ram.ld} (98%)\n> \n\nThere isn't that much more to be clever about, really. One is a rename+edit,\nthe other is a copy. The other way around would have been copy+edit + rename\nwhich isn't necessarily an improvement.\n\nLooking at how git internally[1] does things and remembering the meanings of\n\"copy\" and \"rename\" though, it makes perfect sense to leave it as-is.\n\n[1].\nIn git, the content is part of the (object) name, so changing the content\nmakes it closer to a rename than a copy, while changing the location always\nmakes it a copy, although sometimes coupled with a delete.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"}]}