Msysgit hooks using Lua

Source: Internet
Author: User
Background

Recently I want to make some configuration for the entire git server in my company. Looking at the *. Sample folder in the. Git/hooks/folder, I am very puzzled. Can I run it by removing ". sample?

It turns out that the following code can be put into the pre-commit file, and "hello git!" Can be output at commit! "Message

#!/bin/shecho "Hello Git!"
Lua

Although I will have a little Bash script, it is actually not much different from it ~~

In view of the ease-of-use of Lua and the elegant use of wxlua on the Windows platform, Lua is ready to be widely used in subsequent daily work for some simple automated operations.

Therefore, I want to use the Lua script to write git hooks. First we have to install Lua,

  • Resource home: http://code.google.com/p/luaforwindows/ (possibly walled)
  • : Http://luaforwindows.googlecode.com/files/LuaForWindows_v5.1.4-45.exe

Then, write the pre-commit file.

#!/bin/env lua.exeprint "Hello Git From Lua!"

The volume is lua.exe, not Lua.

PS: I just opened my head. It seems that it will be a little difficult to call git log to obtain various information, but I will try again later ~

Other links

Msysgit: http://msysgit.googlecode.com/files/Git-1.7.8-preview20111206.exe

Tortoisegit: http://tortoisegit.googlecode.com/files/TortoiseGit-1.7.6.0-32bit.msi

Tortoise redmine Plugin: http://redmine-projects.googlecode.com/files/TortoiseRedminePlugin_32bit_1.1.0.8.msi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.