public
Rubygem
Fork of mojombo/grit
Description: Grit is a Ruby library for extracting information from a git repository in an object oriented manner - this fork tries to intergrate as much pure-ruby functionality as possible
Homepage: http://grit.rubyforge.org/
Clone URL: git://github.com/schacon/grit.git
Search Repo:
added some simple write ops : add, remove, commit
schacon (author)
Thu May 29 11:33:09 -0700 2008
commit  28f28c504f3ebb647dadd5d504aaf8133aecadd9
tree    ebf234f8e671f9dc2dae4d6a4e0870434427cd84
parent  1535929b529617192aedeb41ed0373c886bf754e
...
8
9
10
 
11
12
13
...
8
9
10
11
12
13
14
0
@@ -8,6 +8,7 @@ Completed
0
 ** lib/grit/tree.rb:16: output = repo.git.ls_tree({}, treeish, *paths)
0
 
0
 
0
+
0
 lib/grit/commit.rb:74: repo.git.rev_list({}, ref).strip.split("\n").size
0
 lib/grit/commit.rb:92: output = repo.git.rev_list(actual_options, ref)
0
 lib/grit/commit.rb:94: output = repo.git.rev_list(actual_options.merge(:all => true))
...
27
28
29
 
30
31
32
...
27
28
29
30
31
32
33
0
@@ -27,6 +27,7 @@ require 'grit/diff'
0
 require 'grit/config'
0
 require 'grit/repo'
0
 require 'grit/index'
0
+require 'grit/status'
0
 
0
 
0
 module Grit
...
65
66
67
68
 
69
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
72
73
...
65
66
67
 
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
0
@@ -65,9 +65,32 @@ module Grit
0
     #
0
     # Returns true/false if commit worked
0
     def commit_index(message)
0
- self.git.commit({}, a, b, '--', *paths)
0
+ self.git.commit({}, '-m', message)
0
     end
0
 
0
+ # Commits all tracked and modified files
0
+ #
0
+ # Returns true/false if commit worked
0
+ def commit_all(message)
0
+ self.git.commit({}, '-a', '-m', message)
0
+ end
0
+
0
+ # Adds files to the index
0
+ def add(*files)
0
+ self.git.add({}, *files.flatten)
0
+ end
0
+
0
+ # Adds files to the index
0
+ def remove(*files)
0
+ self.git.rm({}, *files.flatten)
0
+ end
0
+
0
+ # Adds files to the index
0
+ def status
0
+ Status.new(self)
0
+ end
0
+
0
+
0
     # An array of Tag objects that are available in this repo
0
     #
0
     # Returns Grit::Tag[] (baked)

Comments

    No one has commented yet.