0

I use git repositories for various documents and TortoiseGit to handle them.

Sometimes, I have to send a document to somebody else for revision, or if (s)he requests an older version of it.

I can do that by...

  1. Opening the Tortoise git log of the directory.
  2. (If needed) Select the commit.
  3. Right-click the file.
  4. Select "Save revision to".
  5. Save the file somewhere.
  6. Use my mail program to attach it to an email.
  7. Remove the exported file.

I am annoyed by steps 4./5., and I always forget step 7. -- is there any way to add something like "Send revision by mail" into the menu?

2
  • stackoverflow.com/a/2545784/1054225 ?
    – Dallas
    Commented Apr 23, 2021 at 15:35
  • No no, not the entire repository, I just want a single revision of one single file in the repository.
    – Bowi
    Commented Apr 26, 2021 at 7:05

1 Answer 1

0

It's actually quite easy, this small .bat file can do it:

...
PAUSE

The ... has to be replaced with the mail program (e.g. C:\Program Files\MyCoolMailProgram\program.exe /newMail /attachment %~1), the file to attach is in %1 (or %~1 to remove the "s).

In TortoiseGit, you can then choose Open with... and the script. TortoiseGit creates the file revision as a temporary file somewhere and gives the temporary file's path to your script (%1), et voila. :-)

The PAUSE at the end of the script makes sure that the script is open until you press a key inside the cmd window -- I do not know, when TortoiseGit removes the temporary file, so we keep the script open.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .