GithubHelp home page GithubHelp logo

disruptek / gittyup Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 4.0 284 KB

higher-level libgit2 bindings that build upon nimgit2

License: MIT License

Nim 100.00%
nim wrapper git libgit2 nimgit2 nimterop api library

gittyup's Introduction

gittyup

Test Matrix GitHub release (latest by date) Minimum supported Nim version License

This is a higher-level and idiomatic abstraction for libgit2 that builds upon the hlibgit2 and hlibssh2 wrappers; the user supplies the underlying libgit2 and libssh2 libraries in the environment.

Usage

We test with libgit2-1.7.1 though earlier versions may work.

This gives some idea for the usage:

import logging
import gittyup
import uri

# a simple example of cloning a repo
block cloning:
  let
    url = parseURI"https://github.com/disruptek/gittyup"
    dir = "/some/where/gitty"

  # perform a clone; repo is a GitRepository object
  repo := clone(url, dir):
    # this is your error handler;
    # code is an enum of GitResultCode
    case code:
    of GIT_EEXISTS:
      error dir, " already exists, i guess"
    of GIT_ENOTFOUND:
      error url, " isn't a git url, maybe"
    else:
      # an error string more specific than $code
      error code.dumpError

    # you don't have to leave, but i recommend it
    break

  # repo is symbol pointing to a GitRepository here

  # "manual" call invocation means you perform your
  # own memory work, but it's sometimes more ideal
  let
    head = repo.headReference

  # using result semantics...
  if head.isErr:
    echo "error code: ", head.error
  else:
    echo "head oid: ", head.get.oid

# repo is now out of scope and will be freed automatically

Installation

$ nimph clone gittyup

or if you're still using Nimble like it's 2012,

$ nimble install https://github.com/disruptek/gittyup

Documentation

See the documentation for the gittyup module as generated directly from the source. I often find the libgit2 reference documentation site useful as well.

License

MIT

gittyup's People

Contributors

alaviss avatar disruptek avatar fbe-work avatar fbpyr avatar genotrance avatar haxscramper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gittyup's Issues

gittyup name

Hello,
I would like to ask if you are up for sharing the Gittyup name.
Right now we are using it for a Git GUI Client https://github.com/Murmele/Gittyup
Most of us (if not all) didn't notice your project before deciding on the name. The projects seem to be different enough that we could just share the name.
I thought I would just ask before we end up upsetting someone by using the name. It's still early days for the project so while we would like to keep the name, it is not set in stone.

pull or fetch available?

maybe a duplicate of #5 (?)
or maybe I have overlooked something,
but I did not find a way to pull l or fetch in gittyup or hlibgit2.
does it exist, or are there plans to support it?
or is it blocked somewhere upstream?

thank you. ๐Ÿ™‚

type mismatch error, when running usage example code

first of: thank you so much for writing this high level git library!
when running (on nim 1.6.4 , debian) the code example from
https://github.com/disruptek/gittyup#usage
(with fixed missing import uri) I get the following error:

image

it tells me that I provided two strings (which I fully agree with)
but apparently it expected a proc. how would I change the
example code to get it working?
Thank you in advance. ๐Ÿ™‚

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.