Comments (5)
- 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?
- 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.
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.
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.
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:in
spawn'
grit (2.4.1) lib/grit/process.rb:271:in popen4' grit (2.4.1) lib/grit/process.rb:97:in
exec!'
grit (2.4.1) lib/grit/process.rb:68:in initialize' grit (2.4.1) lib/grit/git.rb:301:in
new'
grit (2.4.1) lib/grit/git.rb:301:in native' grit (2.4.1) lib/grit/git.rb:325:in
method_missing'
grit (2.4.1) lib/grit/repo.rb:536:in `archive_tar'
from grit.
Grit is no longer maintained. See #183 and check out libgit2/rugged.
from grit.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grit.