Skip to content

Instantly share code, notes, and snippets.

@oneandoneis2
Created March 9, 2015 17:46
Show Gist options
  • Save oneandoneis2/3162ac298b9052f026e8 to your computer and use it in GitHub Desktop.
Save oneandoneis2/3162ac298b9052f026e8 to your computer and use it in GitHub Desktop.
Trivial demo of why not to blindly rebase
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