Created
March 9, 2015 17:46
-
-
Save oneandoneis2/3162ac298b9052f026e8 to your computer and use it in GitHub Desktop.
Trivial demo of why not to blindly rebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original code: | |
$c->{stash}{this} = thing(); | |
$c->{stash}{that} = thing(); | |
$c->{stash}{the_other} = thing(); | |
some_code(); | |
------------------------------------------------------------------------------ | |
Your changes: | |
$c->{stash}{this} = thing(); | |
$c->{stash}{that} = thing(); | |
$c->{stash}{the_other} = thing(); | |
more_code(); | |
$c->{stash}{mything} = thing(); | |
some_code(); | |
------------------------------------------------------------------------------ | |
Their changes: | |
my $stash = $c->{stash}; | |
$stash->{this} = thing(); | |
$stash->{that} = thing(); | |
$stash->{the_other} = thing(); | |
some_code(); | |
------------------------------------------------------------------------------ | |
What your rebase winds up with: | |
my $stash = $c->{stash}; | |
$stash->{this} = thing(); | |
$stash->{that} = thing(); | |
$stash->{the_other} = thing(); | |
more_code(); | |
$c->{stash}{mything} = thing(); | |
some_code(); | |
------------------------------------------------------------------------------ | |
What your reviewer asks: | |
"Why didn't you follow Best Practice and use $stash, you Bad Person?" | |
If you'd merged, your history would explain. Because you rebased, your history lies and makes you look careless. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment