All of lore.kernel.org
 help / color / mirror / Atom feed
* refactoring in GIT
@ 2011-06-28 13:19 eugene
  2011-06-28 15:27 ` Massimo Manca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: eugene @ 2011-06-28 13:19 UTC (permalink / raw)
  To: git

Hi,
 I'm new to GIT and have two questions about code refactoring. 

#1. I want to refactor class A into few classes B,C,D. How should I check them 
in and mark class A inactive so that development on A stops? Note, I do need A 
stay in repository for backward compt. with prior code releases.

#2. [related question] What if another developer already had A in his local 
repository, made changes and wants to commit after me. I just made A obsolete. 
Does he have drop his changes and take B,C,D from me and/or merge?

Sorry if this question was already answered, pls point me.

Thanks,
Eugene

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: refactoring in GIT
  2011-06-28 13:19 refactoring in GIT eugene
@ 2011-06-28 15:27 ` Massimo Manca
  2011-06-28 15:59 ` Christof Krüger
  2011-06-28 17:09 ` Fredrik Gustafsson
  2 siblings, 0 replies; 4+ messages in thread
From: Massimo Manca @ 2011-06-28 15:27 UTC (permalink / raw)
  To: eugene; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

Il 28/06/2011 15.19, eugene ha scritto:

Hi,
 I'm new to GIT and have two questions about code refactoring. 

#1. I want to refactor class A into few classes B,C,D. How should I check them 
in and mark class A inactive so that development on A stops?

You can't. 
If 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.

 Note, I do need A 
stay in repository for backward compt. with prior code releases.

#2. [related question] What if another developer already had A in his local 
repository, made changes and wants to commit after me. I just made A obsolete. 
Does he have drop his changes and take B,C,D from me and/or merge?

Same as for #1. The last developer that modifies module A has to update other modifications BEFORE and then apply her modifications.

Shortly: git doesn't block anything unstead git permits to merge changes coming from more the one developer.

It 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.

Sorry if this question was already answered, pls point me.

Thanks,
Eugene



[-- Attachment #2: massimo_manca.vcf --]
[-- Type: text/x-vcard, Size: 340 bytes --]

begin:vcard
fn:Massimo Manca
n:Manca;Massimo
org:Micron Engineering di Massimo Manca
adr:;;via della Ferriera, 48;Pordenone;PN;33170;ITALIA
email;internet:massimo.manca@micronengineering.it
tel;work:+39 0434 1856131
tel;fax:+39 0434 1851032 / 178 273 3543
tel;cell:+39 349 4504979
url:http://www.micronengineering.it
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: refactoring in GIT
  2011-06-28 13:19 refactoring in GIT eugene
  2011-06-28 15:27 ` Massimo Manca
@ 2011-06-28 15:59 ` Christof Krüger
  2011-06-28 17:09 ` Fredrik Gustafsson
  2 siblings, 0 replies; 4+ messages in thread
From: Christof Krüger @ 2011-06-28 15:59 UTC (permalink / raw)
  To: eugene; +Cc: git

Hi Eugene

> #1. I want to refactor class A into few classes B,C,D. How should I check
> them
> in and mark class A inactive so that development on A stops? Note, I do
> need A
> stay in repository for backward compt. with prior code releases.
Well, if you really need to keep that file, how about a huge comment at
the beginning of the file?  Or move its content somewhere else and
#include it from the original file.
Git really can't help you here. This is a communication issue within your
project.  Resulting from its distributed design git does not have a global
"lock" feature that could be misused for that matter.

> #2. [related question] What if another developer already had A in his
> local
> repository, made changes and wants to commit after me. I just made A
> obsolete.
> Does he have drop his changes and take B,C,D from me and/or merge?
Git can't help you here either.
If your changes don't conflict with their changes, they won't notice if
they do not examine your changes. This again is a
communication/coordination issue, not a git one. However, if you had moved
"A" away or changed every line, the other developers would get a conflict
when trying to pull your stuff.

Further, git obviously won't automatically refactor other developers code
to match your changes. Depending on the complexity of your refactoring,
you might be able to play around with patches manually.

The least thing you can do is to inform the other developers about your
changes and apologize for not telling them that you planned to make A
obsolete in advance ;)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: refactoring in GIT
  2011-06-28 13:19 refactoring in GIT eugene
  2011-06-28 15:27 ` Massimo Manca
  2011-06-28 15:59 ` Christof Krüger
@ 2011-06-28 17:09 ` Fredrik Gustafsson
  2 siblings, 0 replies; 4+ messages in thread
From: Fredrik Gustafsson @ 2011-06-28 17:09 UTC (permalink / raw)
  To: eugene; +Cc: git

On Tue, Jun 28, 2011 at 01:19:23PM +0000, eugene wrote:
> Hi,
>  I'm new to GIT and have two questions about code refactoring. 
> 
> #1. I want to refactor class A into few classes B,C,D. How should I check them 
> in and mark class A inactive so that development on A stops? Note, I do need A 
> stay in repository for backward compt. with prior code releases.
> 
> #2. [related question] What if another developer already had A in his local 
> repository, made changes and wants to commit after me. I just made A obsolete. 
> Does he have drop his changes and take B,C,D from me and/or merge?
> 
> Sorry if this question was already answered, pls point me.
> 
> Thanks,
> Eugene
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

The only way I can imagine that you do that is by using submodules
together with a repository permission management tool lite gitolite. Or
Maybe just using gitolite with different branches. If I recall correctly
gitolite has per branch rw permissions.

However, I doubt that this issue should be solved technically.

-- 
Med vänliga hälsningar
Fredrik Gustafsson

tel: 0733-608274
e-post: iveqy@iveqy.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-28 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28 13:19 refactoring in GIT eugene
2011-06-28 15:27 ` Massimo Manca
2011-06-28 15:59 ` Christof Krüger
2011-06-28 17:09 ` Fredrik Gustafsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.