Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GistThat integration #27

Open
vdubya opened this issue May 3, 2017 · 7 comments
Open

GistThat integration #27

vdubya opened this issue May 3, 2017 · 7 comments

Comments

@vdubya
Copy link

vdubya commented May 3, 2017

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

@chelh chelh self-assigned this May 4, 2017
@chelh
Copy link
Owner

chelh commented May 4, 2017

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.

@hectorticoli
Copy link

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 :-)

@vdubya
Copy link
Author

vdubya commented May 8, 2017

@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

@brucemcpherson
Copy link

brucemcpherson commented May 8, 2017 via email

@vdubya
Copy link
Author

vdubya commented May 8, 2017

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.

@chelh
Copy link
Owner

chelh commented May 11, 2017

@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
Copy link
Owner

chelh commented May 23, 2017

@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 chelh removed their assignment Jul 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants