{"thread":{"id":"19507","subject":"Suggested workflow for frequent directory renames.","startedAt":"2009-05-26T00:17:48Z","lastAt":"2009-05-26T09:24:16Z","messageCount":2,"participants":["Matthew Clemence","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114725","messageId":"4A1B352C.9030409@virgin.net","threadId":"19507","inReplyTo":null,"subject":"Suggested workflow for frequent directory renames.","fromName":"Matthew Clemence","fromEmail":"matthew.clemence@virgin.net","sentAt":"2009-05-26T00:17:48Z","receivedAt":"2009-05-26T00:17:48Z","isPatch":false,"sender":{"key":"matthew.clemence@virgin.net","avatar":null},"body":"Dear git users,\n\nI am working with an externally supplied code tree (some 2000 files, \nwhich gets passed to me without any SCM) and have multiple users wokring \non their own individual branched versions under git control. The problem \nI am facing is that there are frequenct directory renames when the code \nupdates which I need to find a relatively painless way of bringing the \nusers branches up to date. From reading the lists and faq, there seems \nto be problems (and strong opinions) with this, and I am struggling to \nfind an effcient model to manage this merging - either git loses track \nof the users changed files (and so have to be manually merged from diff \nfiles and usually lose history) or git loses track of everything else \n(and I end up manually adding files from the new tree to get out of \nmerge conflict).\n\nI would be very interested to hear if anyone has a suggestion on how \nthis could best be handled.\n\nMany thanks\n\nMatthew\n"},{"id":"293744","messageId":"m37i04cj45.fsf@localhost.localdomain","threadId":"19507","inReplyTo":"4A1B352C.9030409@virgin.net","subject":"Re: Suggested workflow for frequent directory renames.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-05-26T09:24:16Z","receivedAt":"2009-05-26T09:24:16Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Matthew Clemence <matthew.clemence@virgin.net> writes:\n\n> I am working with an externally supplied code tree (some 2000 files,\n> which gets passed to me without any SCM) and have multiple users\n> working on their own individual branched versions under git\n> control. The problem I am facing is that there are frequenct directory\n> renames when the code updates which I need to find a relatively\n> painless way of bringing the users branches up to date. \n\nHmmm... are you sure you are solving the correct problem? Can't you\navoid directory renames, e.g. by munging position of files before\nentering them into SCM?\n\n> From reading\n> the lists and faq, there seems to be problems (and strong opinions)\n> with this, and I am struggling to find an effcient model to manage\n> this merging - either git loses track of the users changed files (and\n> so have to be manually merged from diff files and usually lose\n> history) or git loses track of everything else (and I end up manually\n> adding files from the new tree to get out of merge conflict).\n> \n> I would be very interested to hear if anyone has a suggestion on how\n> this could best be handled.\n\nGit, contrary to other version control systems such as Mercurial or\nBazaar, doesn't use tracking of renames (either via recording rename\nevent, or by using file identities / inodes), but heuristic similarity\nbased rename _detection_.  If the files are of sufficient size\ncompared to changes, rename detection should work well and when\nmerging changes should be applied to correct files / correct files\nwould be renamed.  Changing directory the file resides in is currently\nin Git just the form of changing pathname of a file, i.e. renaming of\na file.  Rename detection uses similarity of filename as one of\nfactors so if basename didn't change git should correctly pair files.\n\n\nThe problem currently is when one side renames directory, and other\nside creates new file in the old-name directory.  Rename tracking\nwould not help here unless SCM track also directory renames, like\nBazaar reportedly does.\n\nBut the problem is not impossible to overcome using rename detection\nlike in git.  There were even patches adding detection of wholesame\ndirectory renaming (factoring out directory renames out of set of\ndetected file renames) by Yann Dirson, but they were not accepted for\nsome reason.  You migh want to either contact author, or clean up the\nseries and send them yourself (if possibly with use cases and success\nstories):\n  http://thread.gmane.org/gmane.comp.version-control.git/99529\n\nSee also directory rename detection script (in Perl) in\n  http://permalink.gmane.org/gmane.comp.version-control.git/81547\n\nBTW. This issue was discussed extensively on git mailing list...\n-- \nJakub Narebski\nPoland\n"}]}