Using git flow I create a new branch, newFunction
, off of develop
branch.
I add newFunction to example class:
class ExampleClass
{
public function exampleFunction(){
return "example";
}
public function newFunction(){
return "new";
}
}
Lets say I merge it to develop
, I come back a few months later and my class looks like this.
class ExampleClass
{
public function exampleFunction(){
return "example";
}
public function anotherFunction(){
return "another";
}
public function yetAnotherFunction(){
return "yetAnother";
}
public function newFunction(){
return "new";
}
}
Is it possible to apply the diff
between develop
and newFunction
at that point in time? Possibly using git patch
or some sort of black magic.
So I run a magical git something
command and I end up with something like this:
class ExampleClass
{
public function exampleFunction(){
return "example";
}
public function anotherFunction(){
return "another";
}
public function yetAnotherFunction(){
return "yetAnother";
}
public function newFunction(){
return "new";
}
public function newFunction(){
return "new";
}
}
and if I did it again, I would get this:
class ExampleClass
{
public function exampleFunction(){
return "example";
}
public function anotherFunction(){
return "another";
}
public function yetAnotherFunction(){
return "yetAnother";
}
public function newFunction(){
return "new";
}
public function newFunction(){
return "new";
}
public function newFunction(){
return "new";
}
}
etc. I am aware that the code it currently generates is incorrect, as in the functions have the same name. I would use this for generation of boilerplate code in a legacy system, for example.