VBASync icon indicating copy to clipboard operation
VBASync copied to clipboard

GistThat integration

Open vdubya opened this issue 8 years ago • 7 comments

First, thanks @chelh for such a fantastic tool, I use VBASync almost daily!

This is a feature request to integrate "GistThat" by @brucemcpherson into VBASync.

I totally understand if this is beyond the scope of what you are interested in including, it just seems like a natural fit with VBASync. VBASync already has the entire framework for extracting and updating code, this would just add the capability to pull updates from GitHubGist snippits to keep reusable VBA code up to date.

GistThat requires that Excel trust settings be modified and also runs from within Excel, both of which VBASync masterfully does not . VBASync could perform the same function that the GistThat bootstrap code in gistThat_.vba does, or even just a subset of it would be very useful.

Thanks for the consideration! -Van

vdubya avatar May 03 '17 19:05 vdubya

I'll first work on providing hooks so that users can execute batch scripts against their entire VBA project:

  • A BeforePublish hook to run immediately before all code gets published to the Office file
  • An AfterExtract hook to run immediately after any files are extracted to the version control folder

How's your C#/VBScript? This would go much faster with me working on the VBASync portion, and someone more familiar with GistThat working on a separate .exe/.vbs to do the GistThat update.

chelh avatar May 04 '17 01:05 chelh

Hello vdubya, chelh,

Could you describe a use-case for this feature? That would help me to understand, and maybe improve the french translation as well. Specifically, "Macros" refers in my mind to "VBA code" when dealing with Office files, but I assume this refers to something else here.

Thank you for any detail you could add :-)

hectorticoli avatar May 08 '17 20:05 hectorticoli

@chelh, I might be able to code it but the limiting factor is time. Given that it is already implemented, in VBA, maybe that simplifies the problem, we'll see. I like your approach of putting the before/after hooks as that will enable a lot of different integrations.

@hectorticoli, the use case still pertains to VBA Code. GistThat provides a way to share code with other VBA users with some neat features to check to see if code that you are reusing has been updated so you can update your project files. @chelh was referring to C#/VBScript for writing the code in VBASync to do the GistThat functionality of checking the GitHub Gist repository and downloading and updating the local code.

The link below has some good information if you are interested in learning more. http://ramblings.mcpher.com/Home/excelquirks/gitthat

vdubya avatar May 08 '17 20:05 vdubya

Hi everyone

FYI, I haven't maintained this for some years, and in fact superseded it with vbagit..

Bruce

Sent from my iPad

On May 8, 2017, at 9:27 PM, Van Woods [email protected] wrote:

@chelh, I might be able to code it but the limiting factor is time. Given that it is already implemented, in VBA, maybe that simplifies the problem, we'll see. I like your approach of putting the before/after hooks as that will enable a lot of different integrations.

@hectorticoli, the use case still pertains to VBA Code. GistThat provides a way to share code with other VBA users with some neat features to check to see if code that you are reusing has been updated so you can update your project files. @chelh was referring to C#/VBScript for writing the code in VBASync to do the GistThat functionality of checking the GitHub Gist repository and downloading and updating the local code.

The link below has some good information if you are interested in learning more. http://ramblings.mcpher.com/Home/excelquirks/gitthat

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

brucemcpherson avatar May 08 '17 21:05 brucemcpherson

Hey @brucemcpherson, thanks for the update. I didn't quite realize that it had been superseded with VBAGit since I still saw GistThat references in some of the VbaGit code. Either way, the thing I was drawn to with VBASync was that it didn't require changing the trust settings which are unfortunately locked down in my environment, so whether it is gist or git based I still really like the concept and approach you developed and was hoping to see if it could be implemented in VBASync so I could use it.

vdubya avatar May 08 '17 21:05 vdubya

@vdubya I am done trying to read the GistThat/vbaGit code. If you still want this integration, I can help you write the parts that modify VBASync files, but will not directly interface with the GistThat/vbaGit parts.

chelh avatar May 11 '17 22:05 chelh

@hectorticoli Sorry for neglecting your message for so long; I've been busy with work.

The basic idea behind hooks is to provide a way for users to modify their VBA code using external executables before VBA Sync does work on it. This enables one to have VBA code in slightly different formats depending on whether it's inside the Office file or in the version-control repository. If I understand correctly, @vdubya wants the code inside the Office file to have a fully fleshed-out and up-to-date version of a VBA module that is stored online, while the code in the version-control repository just has a placeholder. For a completely different example, one simple application could make the code inside the Office file have auto-generated line numbers, while the code in the version-control repository has no line numbers.

Note that this would not have worked if hooks were to work as I originally described, so I changed how they work a little bit – instead of the AfterExtract hook running after VBA Sync has already compared all the VBA modules, it now runs before the comparison, and even before the modules' case is fixed.

chelh avatar May 23 '17 03:05 chelh