New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pre-push hook. #35
Comments
I'm having difficulty forking the process into the background so that the push doesn't wait for the end of the song before exiting.
None of the above exit before the mp3 (a 10 second sample) has finished. |
Largely courtesy of @OddBloke: Generating the awesome push it clip:
|
I changed the curl/ffmpeg commands into this: |
Sorry that actually doesn't extract the audio from the video |
Another one I want, probably on nosetests not returning an error:
|
I messed around with a bunch of methods to achieve background music playing in the terminal and nothing seemed to work on my machine. My only thought now is doing all these operations in python (import youtube-dl as a library, slicing up the audio using some other library and then playing it) and forking that python script to the background. |
I have this script:
If I run .git/hooks/pre-push directly from the command line it works. As in, the music starts and I am given the console before the music finishes. It's just that from the hook it fails. As in when run with |
Does it fail in the sense that it hangs or in the sense that it doesn't play the clip? |
Yes, sorry - it fails in the sense that it hangs whilst playing the clip - and only returns to the console after that. |
Have you tried running a python script that spawns a subprocess? For example from subprocess import Popen
Popen(["mplayer", "-really-quiet", "vid.mp3"]) I have no idea if this works as a git hook, but this runs in a few milliseconds for me and returns to my shell with the audio playing in the background. I can even kill the shell that ran the python process. |
I can confirm that @ikornaselur's solution works |
@koddsson I beg to differ.
When I run: I have to wait for the tune to play before getting terminal access again. |
Huh, that's weird. Works on my ubuntu 14.04. Maybe you need to upgrade to a better OS. |
All jokes aside maybe we can compare how it works on our different machines tomorrow at work. |
Yeah, I haven't had any problems with backgrounding the hook on my Debian machine. |
One potential solution to try: daemonising the process that calls mplayer. |
Closing on account of impossibility on mac. For reasons that are beyond me. |
Hi, You can use quicktime to snip your mp3 and the native mac command line player to play it from command line. Please see below.
I also created a repo @ https://github.com/jeremykenedy/pushit Yay ! Jeremy :) |
Nice @jeremykenedy - I'll see if afplay suffers from the same behaviour as mplayer when combined with a git hook. |
I want to play "push it" by salt n pepa on every push.
The text was updated successfully, but these errors were encountered: