{"thread":{"id":"27721","subject":"refactoring in GIT","startedAt":"2011-06-28T13:19:23Z","lastAt":"2011-06-28T17:09:26Z","messageCount":4,"participants":["eugene","Massimo Manca","Christof Krüger","Fredrik Gustafsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"170627","messageId":"loom.20110628T151105-908@post.gmane.org","threadId":"27721","inReplyTo":null,"subject":"refactoring in GIT","fromName":"eugene","fromEmail":"eugene@oggtrading.com","sentAt":"2011-06-28T13:19:23Z","receivedAt":"2011-06-28T13:19:23Z","isPatch":false,"sender":{"key":"eugene@oggtrading.com","avatar":null},"body":"Hi,\n I'm new to GIT and have two questions about code refactoring. \n\n#1. I want to refactor class A into few classes B,C,D. How should I check them \nin and mark class A inactive so that development on A stops? Note, I do need A \nstay in repository for backward compt. with prior code releases.\n\n#2. [related question] What if another developer already had A in his local \nrepository, made changes and wants to commit after me. I just made A obsolete. \nDoes he have drop his changes and take B,C,D from me and/or merge?\n\nSorry if this question was already answered, pls point me.\n\nThanks,\nEugene\n"},{"id":"170628","messageId":"4E09F2CD.6060309@micronengineering.it","threadId":"27721","inReplyTo":"loom.20110628T151105-908@post.gmane.org","subject":"Re: refactoring in GIT","fromName":"Massimo Manca","fromEmail":"massimo.manca@micronengineering.it","sentAt":"2011-06-28T15:27:09Z","receivedAt":"2011-06-28T15:27:09Z","isPatch":false,"sender":{"key":"massimo.manca@micronengineering.it","avatar":"https://gravatar.com/avatar/1c2a993a173142d1f7fe53dcf07a0769b89feebd2e9f6d618d9d13e2a7391a94?d=mp&s=160"},"body":"Il 28/06/2011 15.19, eugene ha scritto:\n\nHi,\n I'm new to GIT and have two questions about code refactoring. \n\n#1. I want to refactor class A into few classes B,C,D. How should I check them \nin and mark class A inactive so that development on A stops?\n\nYou can't. \nIf you are working on a shared repository you have to modify the code in your private repository (or working directory), then verify if in the mean time another developer changed something, eventually apply other modification to your code (merge) and solve conflicts manually (if there are) in your working directory/private repository. After this you can push your code to the shared repository.\n\n Note, I do need A \nstay in repository for backward compt. with prior code releases.\n\n#2. [related question] What if another developer already had A in his local \nrepository, made changes and wants to commit after me. I just made A obsolete. \nDoes he have drop his changes and take B,C,D from me and/or merge?\n\nSame as for #1. The last developer that modifies module A has to update other modifications BEFORE and then apply her modifications.\n\nShortly: git doesn't block anything unstead git permits to merge changes coming from more the one developer.\n\nIt is my opinion that 2 developers haven't to work on the same module at the same time, but this for me is an organization matter it isn't related to git.\n\nSorry if this question was already answered, pls point me.\n\nThanks,\nEugene\n\n\n\n\nbegin:vcard\nfn:Massimo Manca\nn:Manca;Massimo\norg:Micron Engineering di Massimo Manca\nadr:;;via della Ferriera, 48;Pordenone;PN;33170;ITALIA\nemail;internet:massimo.manca@micronengineering.it\ntel;work:+39 0434 1856131\ntel;fax:+39 0434 1851032 / 178 273 3543\ntel;cell:+39 349 4504979\nurl:http://www.micronengineering.it\nversion:2.1\nend:vcard\n\n"},{"id":"170630","messageId":"1a25cfcef173d20a259950d6829b2611.squirrel@mail.localhost.li","threadId":"27721","inReplyTo":"loom.20110628T151105-908@post.gmane.org","subject":"Re: refactoring in GIT","fromName":"Christof Krüger","fromEmail":"git@christof-krueger.de","sentAt":"2011-06-28T15:59:37Z","receivedAt":"2011-06-28T15:59:37Z","isPatch":false,"sender":{"key":"git@christof-krueger.de","avatar":null},"body":"Hi Eugene\n\n> #1. I want to refactor class A into few classes B,C,D. How should I check\n> them\n> in and mark class A inactive so that development on A stops? Note, I do\n> need A\n> stay in repository for backward compt. with prior code releases.\nWell, if you really need to keep that file, how about a huge comment at\nthe beginning of the file?  Or move its content somewhere else and\n#include it from the original file.\nGit really can't help you here. This is a communication issue within your\nproject.  Resulting from its distributed design git does not have a global\n\"lock\" feature that could be misused for that matter.\n\n> #2. [related question] What if another developer already had A in his\n> local\n> repository, made changes and wants to commit after me. I just made A\n> obsolete.\n> Does he have drop his changes and take B,C,D from me and/or merge?\nGit can't help you here either.\nIf your changes don't conflict with their changes, they won't notice if\nthey do not examine your changes. This again is a\ncommunication/coordination issue, not a git one. However, if you had moved\n\"A\" away or changed every line, the other developers would get a conflict\nwhen trying to pull your stuff.\n\nFurther, git obviously won't automatically refactor other developers code\nto match your changes. Depending on the complexity of your refactoring,\nyou might be able to play around with patches manually.\n\nThe least thing you can do is to inform the other developers about your\nchanges and apologize for not telling them that you planned to make A\nobsolete in advance ;)\n"},{"id":"170633","messageId":"20110628170926.GB910@paksenarrion.iveqy.com","threadId":"27721","inReplyTo":"loom.20110628T151105-908@post.gmane.org","subject":"Re: refactoring in GIT","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2011-06-28T17:09:26Z","receivedAt":"2011-06-28T17:09:26Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Tue, Jun 28, 2011 at 01:19:23PM +0000, eugene wrote:\n> Hi,\n>  I'm new to GIT and have two questions about code refactoring. \n> \n> #1. I want to refactor class A into few classes B,C,D. How should I check them \n> in and mark class A inactive so that development on A stops? Note, I do need A \n> stay in repository for backward compt. with prior code releases.\n> \n> #2. [related question] What if another developer already had A in his local \n> repository, made changes and wants to commit after me. I just made A obsolete. \n> Does he have drop his changes and take B,C,D from me and/or merge?\n> \n> Sorry if this question was already answered, pls point me.\n> \n> Thanks,\n> Eugene\n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nThe only way I can imagine that you do that is by using submodules\ntogether with a repository permission management tool lite gitolite. Or\nMaybe just using gitolite with different branches. If I recall correctly\ngitolite has per branch rw permissions.\n\nHowever, I doubt that this issue should be solved technically.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"}]}