Visual Git Safe




Technical Details

  • You configure the program with your name, the root folder of your project and a shared folder everybody can see.
  • You configure the git hooks. All the hook script does is create a small text file with a .git extension on a shared folder.
  • 3 git hooks are used to know if you've checked out or checked in files:
    post-checkoutScript runs when you run git checkout.
    post-commitScript runs when you run git commit.
    post-mergeScript runs when you run git pull.
  • A C# FileSystemWatcher watches the folder (and all subfolders) of your program directory.
    This is how the program knows if a file changed.
  • The Local Fetch Function: The program runs git status --porcelain and saves the output
    (list of files you are currently editing) to a file on the shared drive.
  • The Remote Fetch Function: The program looks on the shared drive for other text files
    to get the list of files other people have changed. Also (optionally) turn on or off read only
    attributes of files on your hard drive that other people are editing.
  • Events:
  • When the program sees that a source code file is changed on your project, it runs The Local Fetch Function.
  • When the program sees that a .git file is created on the shared folder with the name of the person
    running it, it deletes the file, then runs The Local Fetch Function. This .git file was created by one of the 3 git hooks listed above.
  • When the program sees that a .txt file is created or edited on the shared folder, it runs The Remote Fetch Function.
  • If you look on the shared drive, you'll see a .txt file for each user listing what files they are currently editing.