Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

v

v is for versioned. It's is currently only a threaded wrapper for the git commands or procedures. In the future it should provide a generic interface for diverse VCSs.

This Project does not have a separate test suite. This projects version-tracks itself when everything works as expected.

All operations are designed to be reimplemented as pure ruby version and their interface is almost 1:1 mapped to their ruby derivate.

Install

gem install v

or unless you installed gemcutter

gem install gemcutter
gem tumble
gem install v

Interface

require 'v'

V.git do
  add '.'
  commit 'Initial commit!'
end

Git::Environment uses git returned by which git by default (*n*ix).

Change the git executable globally

V::Adapters::Git::Environment.which_git = '/usr/local/bin/git'

Change the git executable locally

env = V.git :which_git => '/usr/local/bin/git'

# or

V.git do
  @which_git = '/usr/local/bin/git'
  # ...
end

Working with futures...

V.git do
  # initialize repository and return environment (as future)
  init == self

  # add root to index return a index future
  proxy = add '.'
  # wait for result and return index
  proxy.value == index
  # shortcut for add '.'
  index == index << '.'

  # commit index and return commit future
  proxy = commit 'initial commit' 
  # wait for result and return commit
  commit = proxy.value

  # Queries:
  init.add('.').commit 'First argument is always the message!'
end

See auto_commit.rb for more examples.

Supported Operations

  • add
  • branch
  • commit
  • diff-index => diff_index (partially)
  • init
  • ls-files => ls_files (what does -v mean?)
  • ls-tree => ls_tree (alias for args)
  • push
  • rm
  • reset
  • log (partially)
  • show
  • tag

Git Objects

  • normal git objects
    • Blob
    • Commit
    • Tag
    • Tree
  • convenience objects
    • Head
    • Index
    • Branch
    • Branches
    • Commits

TODO

  • implement global cache / branch && git_dir flag expired by branch mtime
  • implement non-blocking queries
  • implement all git operations
  • ALL operations should return raw results which can be used by the convenience objects
  • implement Convenience objects (git objects call commands with arguments set, ...)
  • add Documentation and Examples
  • Long-Term: reimplement all ops in ruby, starting with plumbing

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Required

  • git 1.6.3+
  • fastthread

Thanks

Linus, matz and mojombo.

Copyright (c) 2009 Florian Aßmann, Fork Unstable Medie, Oniversus Media. See LICENSE for details.

FAQs

Package last updated on 06 Dec 2009

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc