Git Product home page Git Product logo

Comments (6)

mroth avatar mroth commented on May 29, 2024

Hrm, good idea. I'll look into this, I'm not quite sure how to approach. Can you please dump the error output you get when it does this?

from lolcommits.

prydonius avatar prydonius commented on May 29, 2024

Well, so long as imagesnap, mplayer and CommandCam fail gracefully when there's no camera, the easiest test would be to just see if the image was saved, if not exit, if so continue.

from lolcommits.

kemitche avatar kemitche commented on May 29, 2024

Here is the output I see when committing without the camera attached. It appears @prydonius' approach might work well, if I'm reading it right.

kemitche@kemi-reddit:~/reddit/public$ git ci -am "Sample commit"
*** Preserving this moment in history.
/usr/lib/ruby/1.8/fileutils.rb:506:in `rename': No such file or directory - /home/kemitche/.lolcommits/public/tmpdir880/00000006.jpg or /home/kemitche/.lolcommits/public/tmp_snapshot.jpg (Errno::ENOENT)
    from /usr/lib/ruby/1.8/fileutils.rb:506:in `mv'
    from /usr/lib/ruby/1.8/fileutils.rb:1402:in `fu_each_src_dest'
    from /usr/lib/ruby/1.8/fileutils.rb:1418:in `fu_each_src_dest0'
    from /usr/lib/ruby/1.8/fileutils.rb:1400:in `fu_each_src_dest'
    from /usr/lib/ruby/1.8/fileutils.rb:495:in `mv'
    from /var/lib/gems/1.8/gems/lolcommits-0.1.2/lib/lolcommits.rb:91:in `capture'
    from /var/lib/gems/1.8/gems/lolcommits-0.1.2/bin/lolcommits:94:in `do_capture'
    from /var/lib/gems/1.8/gems/lolcommits-0.1.2/bin/lolcommits:173
    from /var/lib/gems/1.8/bin/lolcommits:19:in `load'
    from /var/lib/gems/1.8/bin/lolcommits:19
[lolc 4f0d613] Sample commit
 1 files changed, 1 insertions(+), 0 deletions(-)

from lolcommits.

prydonius avatar prydonius commented on May 29, 2024

Another idea would be to use a blank image (like a lolcat), and put the commit message and sha on it so that it doesn't mess up you're lolcommit history.

And once again it would decide to use a blank image if no webcam image is saved.

from lolcommits.

danielmurphy avatar danielmurphy commented on May 29, 2024

I solved this by adding another post-commit hook to set LOLCOMMITS_DEVICE before firing lolcommits.

in .git/hooks/post-commit:

export LOLCOMMITS_DEVICE="$(imagesnap -l | tail -n1)"
lolcommits --capture --stealth --fork

from lolcommits.

matthutchinson avatar matthutchinson commented on May 29, 2024

I think best approach here, is to quit/abort nicely (with a warning) if no camera was detected at all, or a bad LOLCOMMITS_DEVICE has been set..

from lolcommits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.