Skip to content

Instantly share code, notes, and snippets.

@MKorostoff
Last active December 31, 2015 12:59
Show Gist options
  • Save MKorostoff/7989809 to your computer and use it in GitHub Desktop.
Save MKorostoff/7989809 to your computer and use it in GitHub Desktop.
<?php
//Suppose we have a file with one function, which we commit in git:
function gfc_update_7001() {
nbcsports_features_revert( array( "gfc_pathauto_settings" ) );
}
<?php
//Now suppose we add a second function
function gfc_update_7001() {
nbcsports_features_revert( array( "gfc_pathauto_settings" ) );
}
function gfc_update_7002() {
nbcsports_features_revert( array( "gfc_news_view" ) );
}
//And run 'git diff':
function gfc_update_7001() {
nbcsports_features_revert( array( "gfc_pathauto_settings" ) );
+}
+
+function gfc_update_7002() {
+ nbcsports_features_revert( array( "gfc_news_view" ) );
}
* The curly bracket on line 5 is regarded as "new," not the curly bracket on line 9.
* Lines 5-8 are regarded as the "insertion" when, realistically, lines 6-9 are the insertion.
* This matters because, in the event of a merge conflict, it breaks the ability to resolve by
choosing 'take from left, then take from right'
Question: how can we signal to git that lines 6-9 are the insertion?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment