mojombo/grit

Namegrit
Description**Grit is no longer maintained. Check out libgit2/rugged.** Grit gives you object oriented read/write access to Git repositories via Ruby.
LanguageRuby
Topics
Watchers1,944
Forks538
Open issues27
Last push10/1/2020 3:55:32 AM +00:00
Github URLhttps://github.com/mojombo/grit
Clone URLhttps://github.com/mojombo/grit.git
SSH URL[email protected]:mojombo/grit.git

Most active issues

Topic# Comments
In an exist git repository, I visit http://localhost:4567, then I write a first wiki, then submit it, and I got exception below:

Grit::GitRuby::Internal::LooseObjectError - size mismatch:
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/internal/loose.rb:59:in `get_raw_object'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/internal/loose.rb:32:in`[]'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:84:in `block in get_raw_object_by_sha1'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:83:in`each'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:83:in `get_raw_object_by_sha1'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:105:in`get_object_by_sha1'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:155:in `cat_file'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby.rb:27:in`block in cat_file'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby.rb:224:in `block in try_run'
/Users/qichunren/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/timeout.rb:57:in`timeout'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby.rb:223:in `try_run'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/git-ruby.rb:27:in`cat_file'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/grit-2.4.1/lib/grit/blob.rb:43:in `data'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/page.rb:151:in`raw_data'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/page.rb:160:in `text_data'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/markup.rb:14:in`initialize'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/page.rb:171:in `new'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/page.rb:171:in`formatted_data'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/frontend/app.rb:188:in `show_page_or_file'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/lib/gollum/frontend/app.rb:42:in`block in class:App'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1126:in `call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1126:in`block in compile!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:709:in `instance_eval'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:709:in`route_eval'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:693:in `block (2 levels) in route!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:741:in`block in process_route'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:738:in `catch'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:738:in`process_route'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:692:in `block in route!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:691:in`each'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:691:in `route!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:826:in`dispatch!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:619:in `block in call!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:791:in`instance_eval'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:791:in `block in invoke'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:791:in`catch'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:791:in `invoke'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:619:in`call!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:604:in `call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/showexceptions.rb:21:in`call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1245:in `block in call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1276:in`synchronize'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1245:in `call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.2/lib/rack/content_length.rb:13:in`call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.2/lib/rack/chunked.rb:15:in `call'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/connection.rb:84:in`block in pre_process'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/connection.rb:82:in `catch'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/connection.rb:82:in`pre_process'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/connection.rb:57:in `process'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/connection.rb:42:in`receive_data'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in`run'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/backends/base.rb:61:in `start'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/thin-1.2.8/lib/thin/server.rb:159:in`start'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.2/lib/rack/handler/thin.rb:14:in `run'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.2.1/lib/sinatra/base.rb:1208:in`run!'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/gems/gollum-1.3.0/bin/gollum:125:in `'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/bin/gollum:19:in`load'
/Users/qichunren/.rvm/gems/ruby-1.9.2-p0/bin/gollum:19:in `
'


Read comments
31
grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:314: stack level too deep (SystemStackError)

the referenced line is
zstr = Zlib::Inflate.new

I can provide more details if you tell me what you need.
Judging by the comments in issue #41 this is not a duplicate.


Read comments
12
After running a commit listing on a repository (linux 2.6.38 for my tests) i got this:

text
D, [2011-06-10T19:45:40.124701 #11551] DEBUG -- :
D, [2011-06-10T19:50:57.074719 #11551] DEBUG -- : /usr/bin/git --git-dir=/home/marc/src/linux-2.6.38.y/.git command
D, [2011-06-10T19:50:57.156341 #11551] DEBUG -- :
D, [2011-06-10T19:50:57.156704 #11551] DEBUG -- : git: 'command' is not a git command. See 'git --help'.


I've wrote a 'test' here: https://gist.github.com/1019440
And i use it with the linux 2.6.38 (linux-2.6.38.y) repository, any ideas about this problem ?

I'm using Grit 2.4.1 and ruby 1.9.2-p180.


Read comments
11
ruby-1.8.7-p249

Full example details here:
http://www.redmine.org/issues/6566#note-3


Read comments
10
I was trying to use the new Gollum project recently on 1.9 and ran into an encoding issue inside of Grit. Digging into it the fix was rather simple and I made a topic branch [here](http://github.com/op4g/grit/commits/1.9_compat).


Read comments
10
This patch only adds pre and post commit hooks.


Read comments
9
In addition to --git-dir, otherwise the current working tree will be used (if a .git directory is present, even if the --git-dir points elsewhere)


Read comments
9
ruby
[1] pry(main)> require'grit'
=> true
[2] pry(main)> Grit::Repo.new('../rails')
=> #
[3] pry(main)> repo=_
=> #
[4] pry(main)> repo.commits
Grit::GitRuby::Internal::PackFormatError: pack /Users/saito/Develop/rails/.git/objects/pack/pack-6ca3f2932648224dbf874aa14f8fce8d54e3a198.pack has discontinuous index 1
from /Users/saito/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:135:in `block (2 levels) in init_pack'



Read comments
9
Hi all,
Im trying to use gollum as a private wiki on my windows machine. When editing and saving an existing item git tells me that the tree file is corrupt. im assuming this is something in grit and not gollum.

fatal: corrupt tree file
this is verified on Windows only.
64,32bit, winxp, win2003, ruby187, ruby192, and jruby


Read comments
9
When there are special (eg. UTF-8) characters in filenames,
git double-quotes them in diff output.
- New regular expression to grab quoted filenames
- Then gsub gets rid of the double escaped bytes
- Force UTF-8 encoding on the string


Read comments
8