University of Oregon

bash function – git-patch()

We’ve been trying to review more Drupal 8 patches on Drupal.org with this workflow:

$ cd #to your local Drupal 8 Dir.
$ curl https://drupal.org/files/patch_url... | git apply --stat
$ curl https://drupal.org/files/patch_url... | git apply --check
$ curl https://drupal.org/files/patch_url... | git apply
# If no errors occur you can use
$git am --signoff < fix_empty_poster.patch

I found that be cumbersome so I created a bash function to simplify this.
Usage example: $ git-patch stat URL.patch
That triggers a

  • wget to retrieve the file,
  • runs $ git apply –stat
  • and prompts you for the next step.

In addition if you call the function with no vars it returns a simple usage message.
It works great, it’s more efficient and I don’t have to refer back to the patching best-practices if I forget*.
(more…)

Adding a button for toggling nested items in activecollab

This is a follow up to Bookmarklets for expanding, collapsing items in activeCollab.

I hacked the activeCollab Checklist module last night. Specifically the ChecklistsController.class.php file, adding the links to toggle the nested items.

Here’s the new button:

Here it is expanded:

I briefly looked at creating a module to override the checklist controller module but wasn’t able to make any headway there so I created a patch: ChecklistsController.class.php_toggle_nested_items_5-5-11_v0.2.patch.
(more…)