Giter VIP home page Giter VIP logo

Comments (4)

robertodecurnex avatar robertodecurnex commented on June 3, 2024

👍

I agree with you in that we should have a way to support options in a more flexible way.

It won't be an easy change since its a modification over the design of the current version.

Let's see what we can do.

from ruby-git.

patcon avatar patcon commented on June 3, 2024

👍 Ditto. Not currently any easy way to clone with --reference=file://blah

What about just deleting the opts keys as they're used, and use the remaining ones to directly create the remaining?
https://github.com/schacon/ruby-git/blob/master/lib/git/lib.rb#L58-L67

Perhaps we could use an approach something like this (see link above for original)?

      arr_opts = []
      arr_opts << "--bare" if opts.delete(:bare)
      arr_opts << "--recursive" if opts.delete(:recursive)
      arr_opts << "-o" << opts.delete(:remote) if opts[:remote]
      arr_opts << "--depth" << opts.delete(:depth).to_i if opts[:depth] && opts[:depth].to_i > 0
      arr_opts << "--config" << opts.delete(:config) if opts[:config]

      # Do something with remaining `opts` hash...
      opts.each do |opt, val|
        arr_opts << "--#{opt} #{val}".strip
      end

      arr_opts << '--'
      arr_opts << repository
      arr_opts << clone_dir

#delete passed the value we might need as it throws it away. The downside is that it's not clear to read, but maybe we could extend the hash and alias some clearer method for #delete... maybe #pop_opt or something.

So here, if I passed in (above and beyond the currently accepted stuff) this:

{:reference => "/path/to/ref/repo", :something => nil}

It would further append this to the command --reference /path/to/ref/repo --something

from ruby-git.

klausmeyer avatar klausmeyer commented on June 3, 2024

👍 would also need it for --mirror :)

from ruby-git.

stale avatar stale commented on June 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from ruby-git.

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.