Skip to content

Instantly share code, notes, and snippets.

@eporama
Last active December 14, 2015 18:19
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 eporama/b04dd4568949ff273bb6 to your computer and use it in GitHub Desktop.
Save eporama/b04dd4568949ff273bb6 to your computer and use it in GitHub Desktop.
Describing my process in http://drupal.org/node/1279910
~/Sites/drupal-7 (7.x) $ wget http://drupal.org/files/shortcut-maxlimitreached-1279910-26_0.patch -O /tmp/shortcut-maxlimitreached-1279910-26_0.patch
~/Sites/drupal-7 (7.x) $ git apply /tmp/shortcut-maxlimitreached-1279910-26_0.patch
error: patch failed: modules/shortcut/shortcut.test:143
error: modules/shortcut/shortcut.test: patch does not apply
Patch doesn't apply due to changes in 7.x since the patch was written. So I followed http://drupal.org/patch/reroll with some bash compacting, got it down to a single line to get my branch rolled back.
~/Sites/drupal-7 (7.x) $ git checkout -b reroll $(git log --before="$(curl -I -s http://drupal.org/files/shortcut-maxlimitreached-1279910-26_0.patch | awk '/^Last-Modified: / {$1="";print}')" -1 --pretty=format:%H)
Switched to a new branch 'reroll'
~/Sites/drupal-7 (reroll) $ git apply /tmp/shortcut-maxlimitreached-1279910-26_0.patch
~/Sites/drupal-7 (reroll) $ git commit -m "Applying patch from http://drupal.org/node/1279910#comment-6388260" modules/shortcut/
[reroll 19693db] Applying patch from http://drupal.org/node/1279910#comment-6388260
2 files changed, 31 insertions(+), 2 deletions(-)
~/Sites/drupal-7 (reroll) $ git rebase 7.x
First, rewinding head to replay your work on top of it...
Applying: Applying patch from http://drupal.org/node/1279910#comment-6388260
Using index info to reconstruct a base tree...
M modules/shortcut/shortcut.admin.inc
M modules/shortcut/shortcut.test
Falling back to patching base and 3-way merge...
Auto-merging modules/shortcut/shortcut.test
Auto-merging modules/shortcut/shortcut.admin.inc
~/Sites/drupal-7 (reroll) $ git diff 7.x > /tmp/shortcut-maxlimitreached-reroll-1279910.patch
So this is the complete reroll of the patch. But doesn't include the comment wrapping fixes from #30 (which is the only thing that we need to fix for that particular review)
So, I fixed the comment wrap and committed
~/Sites/drupal-7 (reroll) $ git commit -m "wrapping comment at 80 chars" modules/shortcut/shortcut.test
Created the new patch:
~/Sites/drupal-7 (reroll) $ git diff 7.x > /tmp/shortcut-maxlimitreached-1279910-43.patch
Created the interdiff:
~/Sites/drupal-7 (reroll) $ git diff HEAD~ > /tmp/interdiff.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment