Skip to content

Instantly share code, notes, and snippets.

@danstur
Created June 21, 2023 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danstur/04532c268d8663ad935f036be8434b94 to your computer and use it in GitHub Desktop.
Save danstur/04532c268d8663ad935f036be8434b94 to your computer and use it in GitHub Desktop.
// main - commit 100
void Foo() {
Console.WriteLine("My horrible func");
}
void Bar() {
Foo();
}
// longer-living branch from 100
void Foo() {
Console.WriteLine("My horrible func");
}
void Bar() {
Foo();
}
void Baz() {
Foo(); // we also need Foo and it does exactly what we want!
}
// main - commit 101
void Foo() {
Console.WriteLine("My new awesome func");
}
void AwfulFoo() {
Console.WriteLine("My horrible func");
}
void Bar() {
AwfulFoo(); // we made sure to renaem all funcs before creating our new one!
}
// main - commit 102 when longer-living is merged:
void Foo() {
Console.WriteLine("My new awesome func");
}
void AwfulFoo() {
Console.WriteLine("My horrible func");
}
void Bar() {
AwfulFoo(); // we made sure to renaem all funcs before creating our new one!
}
void Baz() {
Foo(); // No merge conflict because nobody in main changed anything in Baz.
// No compile conflict because Foo still exists, but it now calls something else
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment