bandaid icon indicating copy to clipboard operation
bandaid copied to clipboard

Collaborate with drush-patchfile?

Open davereid opened this issue 10 years ago • 8 comments

It seems I've been working on a very similar Drush tool, https://bitbucket.org/davereid/drush-patchfile since the beginning of this year. I'd love to collaborate where we can to make one awesome Drush patching utility!

Corresponding drush-patchfile issue: https://bitbucket.org/davereid/drush-patchfile/issue/13/collaborate-with-the-bandaid-project

davereid avatar Jul 10 '14 04:07 davereid

Well, they both certainly attack the same problem, but in different ways.

Some of the things I like about Bandaid is the ability to work on raw code without bootstrapping a site, producing patches from local non-patch changes and the test coverage.

I'm a bit split on the idea of using make files. On the one hand, it's spiffy to be able to work from an pre-existing make file, on the other hand I'm wary about pseudo-makefiles that only have patch information. Could have been mighty handy for the sites we've been moving from makefile based to OMG (one massive git-repo), but I fear there's a risk of the make file getting munged in the sense that people update the patches, but not the module version when updating. Or am I missing things in my quick reading of the code?

Anyway, I'm on a vacation for the next couple of weeks so maybe one of my colleagues @naxoc, @danquah or @kallehauge that's been happily using Bandaid could take drush-patchfile for a spin and see what the strengths of the different approaches are?

xendk avatar Jul 14 '14 21:07 xendk

Yeah, I'm not set on using make files either. In fact I'm making the way that patch files are stored pluggable with https://bitbucket.org/davereid/drush-patchfile/pull-request/3/add-support-for-pluggable-patchfile since there has been an interested in storing them in yml files.

davereid avatar Sep 16 '14 04:09 davereid

See also Drush IQ, which has similar features to bandaid, plus commands to submit patches and module releases to drupal.org.

Drush IQ worked great on the Drupal 6 version of drupal.org, and was for a time broken by the D7 upgrade. The most recent version will apply patches just fine, but iq-submit has a problem with posting interdiffs, because I don't have the right goutte code down to submit multiple file uploads to a drupal.org issue. I don't remember the status of iq-release. Most other things should work.

I haven't had a chance to try bandaid yet, but it looks similar to iq-apply-patch.

greg-1-anderson avatar Feb 03 '15 23:02 greg-1-anderson

@greg-1-anderson Bandaid has a different focus from Drush IQ. Bandaid tries to help with patch management on projects locally, for a specific site. Drush IQ focuses on patches for issues.

Bandaid does odd things that neither Drush Patchfile nor Drush IQ is capable of. You can take a module, patch with patches from the issue queue, make local changes, and it'll then be able to make a patch of your local modifications only. It can tell you if a project has been modified beyond the patches applied. And as a bonus, it can change your patched and modified project to a git checkout, without loosing the changes.

I have considered adding a command that would produce a diff, check that it still applies to the base, unpatched, version, and if that checks out, send it to an issue, but it would make more sense to produce the patch and then hand over the file to Drush IQ and let that do the submitting part.

xendk avatar Feb 04 '15 07:02 xendk

With Drush IQ, you can add a patch, make local changes, and then submit a new patch back to the original issue, with an interdiff. The interdiff is broken at the moment, as I mentioned above. Drush IQ does not manage multiple patches on the same project, nor does it have any "hacked"-like behavior.

Drush IQ also does some things that Bandaid doesn't, although some of this code is not working. Your implementation is nicer than Drush IQ, as you have some nice classes for working with git and projects.

I think there's a good amount of overlap here, but I don't blame you if you don't want to maintain iq-submit functionality. If you did, I'd help merge the projects, then abandon drush_iq. (I like "iqi" and "iqa" etc. better, but these could become aliases for the equivalent bandaid commands.)

If you are not in favor of a merge, I am not likely to take the time to add bandaid features to Drush IQ. I could add a feature of iq-submit to submit a specific patch file to an issue; then bandaid could just call drush iq-submit via drush_invoke_process, if you wanted. I need to block out some time to fix my goutte upload code first, though.

greg-1-anderson avatar Feb 04 '15 18:02 greg-1-anderson

@davereid I don't have a bitbucket account yet, but if you are interested in doing any collaboration with Drush IQ and Drush Patchfile, I'd be up for it.

Seems to me that all three of these tools have a lot in common, and could benefit from merging.

greg-1-anderson avatar Feb 04 '15 18:02 greg-1-anderson

I'm definitely using drush-patchfile for patch management in a "entire" website project workflow, not as a contrib module maintainer workflow. The usefulness is helping easily record what patches are applied, and re-applying patches after doing downloading new versions of modules.

davereid avatar Feb 04 '15 18:02 davereid

Like @davereid , I'm more focused on site development rather than contrib development. Drush IQ and Bandaid do complement each other, in some regards. But I can't see Bandaid with the extensive issue support of Drush IQ, that's just not something we do a lot.

I can see a case for making it easy to push local changes up as a patch, but that's stalled on all that would need to be done to actually upload it. So I'd be all for having Bandaid hand over a patchfile to Drush IQ, though it wont be able tell Drush IQ what issue we're talking about.

Another possibility is to have Drush IQ using Bandaid as a patch/diff backend, but it's current behavior of not turning the project worked on into a repo that can be diffed is probably going to be somewhat of a mindfuck to most people. Using bandaid-regit is another option, but I haven't actually tested bandaid-diff when there's a .git folder in the project.

xendk avatar Feb 05 '15 11:02 xendk