Giter Club home page Giter Club logo

Comments (5)

technoweenie avatar technoweenie commented on July 28, 2024
  1. I'm not a fan of how you're duplicating the logic just for windows. I wonder if Grit should have its own popen method that knew to add the 'b' attribute just for windows? Also, how does this affect other parts of the library? Is there anything else that needs the 'text' file output mode?
  2. We may have to add a top level Grit option for this. Single quotes are important on unix for security reasons. We can't just change them to double quotes. There's already at least one case where the logic is duplicated to accomodate Windows. I'd like to clean that up.

from grit.

mjalil avatar mjalil commented on July 28, 2024

technoweenie wrote:

I wonder if Grit should have its own popen method that knew to add the 'b' attribute just for windows?

Grit usees win32-popen3 for windows. This is done in grit.rb. And the README of win32-popen3 says that the default valus for mode flag is 't' (text). In order to get binary we should use 'b' (binary)

how does this affect other parts of the library?

I think it does not any other parts. At least for our usage, there is no effect.
We use Grit::Repo.new, Repo.heads, Repo.tags, Repo.commits, Repo.archive_tar in gitrevision_download_controller.rb

Is there anything else that needs the 'text' file output mode?

I think no.

Single quotes are important on unix for security reasons.

Yes, they are important in windows too. Code injection is a concern in all platforms. But i think the solution is filtering of undesirable characters in input, sanitizing the input.

Single quotation ' in --prefix='some prefix/' makes file names incorrect in windows and we must use double quotation " , inevitably.

from grit.

mojombo avatar mojombo commented on July 28, 2024

Yeah, I'd prefer to see something that knows how to escape stuff properly for both platforms and everything that needs to escape would call that.

from grit.

bastiao avatar bastiao commented on July 28, 2024

Trunk is not working in win32 anymore :(

NotImplementedError (fork() function is unimplemented on this machine):
grit (2.4.1) lib/grit/process.rb:223:in fork' grit (2.4.1) lib/grit/process.rb:223:inspawn'
grit (2.4.1) lib/grit/process.rb:271:in popen4' grit (2.4.1) lib/grit/process.rb:97:inexec!'
grit (2.4.1) lib/grit/process.rb:68:in initialize' grit (2.4.1) lib/grit/git.rb:301:innew'
grit (2.4.1) lib/grit/git.rb:301:in native' grit (2.4.1) lib/grit/git.rb:325:inmethod_missing'
grit (2.4.1) lib/grit/repo.rb:536:in `archive_tar'

from grit.

bkeepers avatar bkeepers commented on July 28, 2024

Grit is no longer maintained. See #183 and check out libgit2/rugged.

from grit.

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.