git-slack-hook icon indicating copy to clipboard operation
git-slack-hook copied to clipboard

Working with a Locally Hosted Git

Open joseph-devito opened this issue 9 years ago • 9 comments

Would this work with a git repo that is hosted locally? I have this working on a server that I own but I recently started a new project that I'm working on only locally, any chance this could work that way ?

joseph-devito avatar Apr 25 '15 04:04 joseph-devito

I need this as well, any help?

ofek-a avatar Jul 18 '15 11:07 ofek-a

Hey guys yes it should work with locally hosted git as well

abhisheksagi avatar Jul 18 '15 12:07 abhisheksagi

you just need to add it to your post commit hook in locally created git repository

abhisheksagi avatar Jul 18 '15 12:07 abhisheksagi

Exactly. Post-recieve hooks run after a remote gets updates. Post-commit runs after each commit. For some reason, however, my post-commit is not working.

Brendonwbrown avatar Jul 24 '15 17:07 Brendonwbrown

@Brendonwbrown is the hook not executing, or is the script not behaving as expected?

jovandeginste avatar Sep 11 '15 09:09 jovandeginste

I'm also interested in this. I've put the whole code in post-commit but it does not seem to start. It neither gets inside the while on line 311:

while read line; do
  set -- $line
  notify $*
  RET=$?
done

there seems no line to be read. If I add an echo test at the beginning of the script I can see it so I know post-commit is executed. Any suggestions? Thanks.

ivomarino avatar Nov 10 '15 19:11 ivomarino

I think you will need to write a wrapper script to be called from either 'commit-msg' or 'post-commit' - see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

jovandeginste avatar Nov 10 '15 19:11 jovandeginste

Yes, seems so. At this point the question is what we need to pass over to the original script, as arguments, in order to start the while loop? Thanks for feedback.

ivomarino avatar Nov 10 '15 20:11 ivomarino

According to some other hooks: oldrev newrev refname

oldrev will be previous commit, newrev latest commit and refname will be something like refs/heads/master

Met vriendelijke groet, Jo Vandeginste

jovandeginste avatar Nov 10 '15 20:11 jovandeginste