pre-commit-hook

Git submodule commit hooks

一笑奈何 提交于 2019-12-01 02:42:32
I'm using a git submodule (let's call it SubmoduleRepo) so that I can include my module in couple of projects. I can commit to SubmoduleRepo from any project that uses it. I can update, commit and push to SubmoduleRepo pretty hassle-free. I need to execute a commit hook whenever I commit something while working in a directory in a project that contains the SubmoduleRepo (when I work in SubmoduleRepo, the commit hook executes as expected) There is no .git folder in submodule's dir (only .git file that specifies path to current directory). If you have Git 2.10+ you can get the hooks directory by

How to access file information in a pre-commit hook using SharpSVN

喜你入骨 提交于 2019-12-01 00:54:47
I am new to SharpSVN and SVN in general. I am trying to implement a pre-commit hook that when the user commits a certain type of XML file; I am going to need to intercept the file and analyze it to ensure they included certain elements before I allow the file to be committed. Since it seems that SVN submits two arguments; the repository path and the transaction; I will need to use these two items to intercept the file. Does anyone know what I need to use in SharpSVN to get file information based on these two parameters? Thanks, Flea# Sander Rijken You can do this by using the builtin

How to lint for Typescript compilation issues?

风流意气都作罢 提交于 2019-11-30 09:12:32
问题 Take the following Typescript arrow function: /** * Returns a probably unique component name. * * @param baseName a suggested name to make unique. * @returns a probably unique name. */ export const getUniqueComponentName = ( baseName ): string => { return baseName + Math.round(Math.random() * 10000000) } When Typescript is configured in tsconfig.json as such: "noImplicitAny": true, This correctly results in a compilation error: [ts] Parameter 'baseName' implicitly has an 'any' type. Visual

Are there any good workarounds to the GitHub 100MB file size limit for text files?

我的梦境 提交于 2019-11-30 08:09:07
I have a 190 MB plain text file that I want to track on github. The text file is a pronounciation lexicon file for our text-to-speech engine. We regularly add and modify lines in the text files, and the diffs are fairly small, so it's perfect for git in that sense. However, GitHub has a strict 100 MB file size limit in place. I have tried the GitHub Large File Storage service, but that uploads a new version of the entire 190 MB file every time it changes - so that would quickly grow to many gigabytes if I go down that path. I would like to keep the file as one file instead of splitting it

How to lint for Typescript compilation issues?

吃可爱长大的小学妹 提交于 2019-11-29 13:37:24
Take the following Typescript arrow function: /** * Returns a probably unique component name. * * @param baseName a suggested name to make unique. * @returns a probably unique name. */ export const getUniqueComponentName = ( baseName ): string => { return baseName + Math.round(Math.random() * 10000000) } When Typescript is configured in tsconfig.json as such: "noImplicitAny": true, This correctly results in a compilation error: [ts] Parameter 'baseName' implicitly has an 'any' type. Visual Studio Code is also smart enough to inform you about this issue during development. My goal is to create

AnkhSVN client side pre-commit hook

点点圈 提交于 2019-11-29 11:48:59
Basically I want to do the same thing as the fella over there . It seems that everybody was thinking about server-side hooks (with all their evil potential). I want a client side script be run before commit so astyle can format the code the way my boss likes to see it. Since my IDE (VS2010Pro) automatically checks when a file changed on the disk an opts me in for reloading it, there is no real evil with all that. Is there any (clean) way to accomplish that with AnkhSVN? Maybe there's also a way to extend VisualStudio to call my pre-commit-script... It seems like AnkhSVN is being made to use

Are there any good workarounds to the GitHub 100MB file size limit for text files?

一笑奈何 提交于 2019-11-29 05:42:24
问题 I have a 190 MB plain text file that I want to track on github. The text file is a pronounciation lexicon file for our text-to-speech engine. We regularly add and modify lines in the text files, and the diffs are fairly small, so it's perfect for git in that sense. However, GitHub has a strict 100 MB file size limit in place. I have tried the GitHub Large File Storage service, but that uploads a new version of the entire 190 MB file every time it changes - so that would quickly grow to many

How do I create a SVN Commit Message Template and Hook to Verify

本小妞迷上赌 提交于 2019-11-28 21:12:14
I'm using Visual SVN Server and Tortoise SVN (client) for source control. I would like all developers to standardize on a consistent format for checkin notes. For Example I want their Commit Message to default to... Synopsis: Developer Name: (pre-populated) Reviewed By: [Bug Id]: [Change Bug State]: Known Issues: Affected Files: (pre-populated) In the future I'd like [Bug Id] and [Bug State] to supply the information to trigger an automated update to the Bug Tracking system. Also Developer Name and Affected Files should be prepopulated with the svn user and files that the user is commiting.

Can git pre-receive hooks evaluate the incoming commit?

情到浓时终转凉″ 提交于 2019-11-28 18:59:50
I'm trying to write a server side pre-receive git hook to evaluate commits as they are being pushed. According to the answers here , this should easily be possible by searching git log and filtering out what I want with 'format:'. I've created the following pre-commit script. #!/bin/bash set -x #for debugging, TODO: remove echo "parameters are" $@ echo "1 is " $1 #List of banned users bannedusers=( root ) author_name=$(git show --pretty=oneline --pretty=format:%an | head -n1) author_email=$(git show --pretty=oneline --pretty=format:%ae | head -n1) committer_name=$(git show --pretty=oneline -

setup pre-commit hook jshint

99封情书 提交于 2019-11-28 16:12:53
I recently started a project on github . I've managed to setup automatic testing after each commit using Travis. But now I would like to setup a pre-commit hook with jshint too. So if jshint reports errors, the commit should fail. But is this possible, and if so, how to do this ? James Allardice But is this possible... Yes! This is possible. I recently wrote about it . Note that it's not specific to GitHub, just Git in general - as it's a pre-commit hook, it runs before any data is sent to GitHub. Any appropriately-named executable files in the /.git/hooks directory of your repository will be