From 824ab0ec43a3c9306e75e87537f8e2b3bcc3254e Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Mon, 19 Nov 2007 07:34:25 -0800 Subject: updated docs --- doc/classes/Git/Lib.html | 712 ++++++++++++++++++++++++++--------------------- 1 file changed, 394 insertions(+), 318 deletions(-) (limited to 'doc/classes/Git/Lib.html') diff --git a/doc/classes/Git/Lib.html b/doc/classes/Git/Lib.html index 5875189..57feb6c 100644 --- a/doc/classes/Git/Lib.html +++ b/doc/classes/Git/Lib.html @@ -88,52 +88,54 @@

Methods

- add   - archive   - branch_current   - branch_delete   - branch_new   - branches_all   - checkout   - checkout_index   + add   + archive   + branch_current   + branch_delete   + branch_new   + branches_all   + checkout   + checkout_index   clone   - commit   - commit_data   - commit_tree   - config_get   - config_list   - config_remote   - config_set   - diff_files   - diff_full   - diff_index   - diff_stats   - fetch   - grep   + commit   + commit_data   + commit_tree   + config_get   + config_list   + config_remote   + config_set   + diff_files   + diff_full   + diff_index   + diff_stats   + fetch   + full_log_commits   + grep   init   log_commits   - ls_files   - ls_tree   - merge   - namerev   + ls_files   + ls_tree   + merge   + namerev   new   - object_contents   - object_size   - object_type   - push   - read_tree   - remote_add   - remote_remove   - remotes   - remove   - repack   - reset   - revparse   - tag   - tag_sha   - tags   - update_ref   - write_tree   + object_contents   + object_size   + object_type   + process_commit_data   + push   + read_tree   + remote_add   + remote_remove   + remotes   + remove   + repack   + reset   + revparse   + tag   + tag_sha   + tags   + update_ref   + write_tree  
@@ -188,21 +190,21 @@

Public Instance methods

-
- +
+

[Source]

-
+ onclick="toggleCode('M000050-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 257
+# File lib/git/lib.rb, line 293
     def add(path = '.')
       path = path.join(' ') if path.is_a?(Array)
       command('add', path)
@@ -212,11 +214,11 @@
         
-
- +
+ @@ -235,10 +237,10 @@ options :path

[Source]

-
+ onclick="toggleCode('M000072-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 399
+# File lib/git/lib.rb, line 435
     def archive(sha, file = nil, opts = {})
       opts[:format] = 'zip' if !opts[:format]
       
@@ -267,21 +269,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000039-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 138
+# File lib/git/lib.rb, line 174
     def branch_current
       branches_all.select { |b| b[1] }.first[0] rescue nil
     end
@@ -290,21 +292,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000055-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 290
+# File lib/git/lib.rb, line 326
     def branch_delete(branch)
       command('branch', ['-d', branch])
     end
@@ -313,21 +315,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000054-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 286
+# File lib/git/lib.rb, line 322
     def branch_new(branch)
       command('branch', branch)
     end
@@ -336,21 +338,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000038-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 128
+# File lib/git/lib.rb, line 164
     def branches_all
       arr = []
       command_lines('branch', '-a').each do |b| 
@@ -365,21 +367,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000056-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 294
+# File lib/git/lib.rb, line 330
     def checkout(branch, opts = {})
       arr_opts = []
       arr_opts << '-f' if opts[:force]
@@ -392,21 +394,21 @@ options
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000071-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 383
+# File lib/git/lib.rb, line 419
     def checkout_index(opts = {})
       arr_opts = []
       arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
@@ -473,21 +475,21 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000052-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 272
+# File lib/git/lib.rb, line 308
     def commit(message, opts = {})
       arr_opts = ["-m '#{message}'"]
       arr_opts << '-a' if opts[:add_all]
@@ -498,11 +500,11 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+ @@ -512,54 +514,35 @@ TODO - make this work with SSH password or auth_key returns useful array of raw commit object data

[Source]

-
+ onclick="toggleCode('M000034-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 89
+# File lib/git/lib.rb, line 101
     def commit_data(sha)
-      in_message = false
-      
-      hsh = {'message' => '', 'parent' => []}
-      command_lines('cat-file', ['commit', sha.to_s]).each do |line|
-        if in_message
-          hsh['message'] += line + "\n"
-        end
-        
-        if (line != '') && !in_message
-          data = line.split
-          key = data.shift
-          value = data.join(' ')
-          if key == 'parent'
-            hsh[key] << value
-          else
-            hsh[key] = value
-          end
-        else
-          in_message = true
-        end
-      end
-      hsh
+      sha = sha.to_s
+      cdata = command_lines('cat-file', ['commit', sha])
+      process_commit_data(cdata, sha)
     end
 
-
- +
+

[Source]

-
+ onclick="toggleCode('M000069-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 365
+# File lib/git/lib.rb, line 401
     def commit_tree(tree, opts = {})
       opts[:message] = "commit tree #{tree}" if !opts[:message]
       t = Tempfile.new('commit-message') do |t|
@@ -578,21 +561,21 @@ returns useful array of raw commit object data
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000047-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 238
+# File lib/git/lib.rb, line 274
     def config_get(name)
       command('config', ['--get', name])
     end
@@ -601,21 +584,21 @@ returns useful array of raw commit object data
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000048-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 242
+# File lib/git/lib.rb, line 278
     def config_list
       hsh = {}
       command_lines('config', ['--list']).each do |line|
@@ -629,21 +612,21 @@ returns useful array of raw commit object data
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000046-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 229
+# File lib/git/lib.rb, line 265
     def config_remote(name)
       hsh = {}
       command_lines('config', ['--get-regexp', "remote.#{name}"]).each do |line|
@@ -657,11 +640,11 @@ returns useful array of raw commit object data
         
-
- +
+ @@ -671,10 +654,10 @@ returns useful array of raw commit object data WRITE COMMANDS ##

[Source]

-
+ onclick="toggleCode('M000049-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 253
+# File lib/git/lib.rb, line 289
     def config_set(name, value)
       command('config', [name, "'#{value}'"])
     end
@@ -683,11 +666,11 @@ WRITE COMMANDS ##
         
-
- +
+ @@ -697,10 +680,10 @@ WRITE COMMANDS ## compares the index and the working directory

[Source]

-
+ onclick="toggleCode('M000043-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 195
+# File lib/git/lib.rb, line 231
     def diff_files
       hsh = {}
       command_lines('diff-files').each do |line|
@@ -716,21 +699,21 @@ compares the index and the working directory
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000041-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 165
+# File lib/git/lib.rb, line 201
     def diff_full(obj1 = 'HEAD', obj2 = nil, opts = {})
       diff_opts = ['-p']
       diff_opts << obj1
@@ -744,11 +727,11 @@ compares the index and the working directory
         
-
- +
+ @@ -758,10 +741,10 @@ compares the index and the working directory compares the index and the repository

[Source]

-
+ onclick="toggleCode('M000044-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 207
+# File lib/git/lib.rb, line 243
     def diff_index(treeish)
       hsh = {}
       command_lines('diff-index', treeish).each do |line|
@@ -777,21 +760,21 @@ compares the index and the repository
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000042-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 174
+# File lib/git/lib.rb, line 210
     def diff_stats(obj1 = 'HEAD', obj2 = nil, opts = {})
       diff_opts = ['--numstat']
       diff_opts << obj1
@@ -816,21 +799,21 @@ compares the index and the repository
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000063-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 337
+# File lib/git/lib.rb, line 373
     def fetch(remote)
       command('fetch', remote.to_s)
     end
@@ -839,11 +822,42 @@ compares the index and the repository
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 72
+    def full_log_commits(opts = {})
+      arr_opts = ['--pretty=raw']
+      arr_opts << "-#{opts[:count]}" if opts[:count]
+      arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
+      arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
+      arr_opts << opts[:object] if opts[:object].is_a? String
+      arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
+      
+      full_log = command_lines('log', arr_opts, true)
+      process_commit_data(full_log)
+    end
+
+
+
+
+ +
+ + + @@ -861,10 +875,10 @@ returns hash

[Source]

-
+ onclick="toggleCode('M000040-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 146
+# File lib/git/lib.rb, line 182
     def grep(string, opts = {})
       opts[:object] = 'HEAD' if !opts[:object]
 
@@ -933,32 +947,32 @@ READ COMMANDS ##
       arr_opts = ['--pretty=oneline']
       arr_opts << "-#{opts[:count]}" if opts[:count]
       arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
-      arr_opts << "#{opts[:between][0]}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
+      arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
       arr_opts << opts[:object] if opts[:object].is_a? String
       arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
       
-      command_lines('log', arr_opts).map { |l| l.split.first }
+      command_lines('log', arr_opts, true).map { |l| l.split.first }
     end
 
-
- +
+

[Source]

-
+ onclick="toggleCode('M000045-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 218
+# File lib/git/lib.rb, line 254
     def ls_files
       hsh = {}
       command_lines('ls-files', '--stage').each do |line|
@@ -973,21 +987,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000037-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 118
+# File lib/git/lib.rb, line 154
     def ls_tree(sha)
       data = {'blob' => {}, 'tree' => {}}
       command_lines('ls-tree', sha.to_s).each do |line|
@@ -1002,21 +1016,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000057-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 302
+# File lib/git/lib.rb, line 338
     def merge(branch, message = nil)      
       arr_opts = []
       arr_opts << ["-m '#{message}'"] if message
@@ -1028,21 +1042,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000031-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 76
+# File lib/git/lib.rb, line 88
     def namerev(string)
       command('name-rev', string).split[1]
     end
@@ -1051,21 +1065,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000036-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 114
+# File lib/git/lib.rb, line 150
     def object_contents(sha)
       command('cat-file', ['-p', sha])
     end
@@ -1074,21 +1088,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000033-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 84
+# File lib/git/lib.rb, line 96
     def object_size(sha)
       command('cat-file', ['-s', sha]).to_i
     end
@@ -1097,21 +1111,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000032-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 80
+# File lib/git/lib.rb, line 92
     def object_type(sha)
       command('cat-file', ['-t', sha])
     end
@@ -1120,21 +1134,83 @@ READ COMMANDS ##
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 107
+    def process_commit_data(data, sha = nil)
+      in_message = false
+      
+      if sha
+        hsh = {'sha' => sha, 'message' => '', 'parent' => []}
+      else
+        hsh_array = []        
+      end
+    
+      data.each do |line|
+        if in_message && line != ''
+          hsh['message'] += line + "\n"
+        end
+
+        if (line != '') && !in_message
+          data = line.split
+          key = data.shift
+          value = data.join(' ')
+          if key == 'commit'
+            sha = value
+            hsh_array << hsh if hsh
+            hsh = {'sha' => sha, 'message' => '', 'parent' => []}
+          end
+          if key == 'parent'
+            hsh[key] << value
+          else
+            hsh[key] = value
+          end
+        elsif in_message && line == ''
+          in_message = false
+        else
+          in_message = true
+        end
+      end
+      
+      if hsh_array
+        hsh_array << hsh if hsh
+        hsh_array
+      else
+        hsh
+      end
+    end
+
+
+
+
+ +
+ + +

[Source]

-
+ onclick="toggleCode('M000064-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 341
+# File lib/git/lib.rb, line 377
     def push(remote, branch = 'master')
       command('push', [remote.to_s, branch.to_s])
     end
@@ -1143,11 +1219,11 @@ READ COMMANDS ##
         
-
- +
+ @@ -1157,10 +1233,10 @@ READ COMMANDS ## reads a tree into the current index file

[Source]

-
+ onclick="toggleCode('M000067-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 354
+# File lib/git/lib.rb, line 390
     def read_tree(treeish, opts = {})
       arr_opts = []
       arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
@@ -1172,21 +1248,21 @@ reads a tree into the current index file
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000058-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 309
+# File lib/git/lib.rb, line 345
     def remote_add(name, url, opts = {})
       arr_opts = ['add']
       arr_opts << '-f' if opts[:with_fetch]
@@ -1200,11 +1276,11 @@ reads a tree into the current index file
         
-
- +
+ @@ -1215,10 +1291,10 @@ this is documented as such, but seems broken for some reason i’ll try to get around it some other way later

[Source]

-
+ onclick="toggleCode('M000059-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 320
+# File lib/git/lib.rb, line 356
     def remote_remove(name)
       command('remote', ['rm', name])
     end
@@ -1227,21 +1303,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000060-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 324
+# File lib/git/lib.rb, line 360
     def remotes
       command_lines('remote')
     end
@@ -1250,21 +1326,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000051-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 262
+# File lib/git/lib.rb, line 298
     def remove(path = '.', opts = {})
       path = path.join(' ') if path.is_a?(Array)
 
@@ -1279,21 +1355,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000066-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 349
+# File lib/git/lib.rb, line 385
     def repack
       command('repack', ['-a', '-d'])
     end
@@ -1302,21 +1378,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000053-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 278
+# File lib/git/lib.rb, line 314
     def reset(commit, opts = {})
       arr_opts = []
       arr_opts << '--hard' if opts[:hard]
@@ -1328,21 +1404,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000030-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 72
+# File lib/git/lib.rb, line 84
     def revparse(string)
       command('rev-parse', string)
     end
@@ -1351,21 +1427,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000062-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 332
+# File lib/git/lib.rb, line 368
     def tag(tag)
       command('tag', tag)
     end
@@ -1374,21 +1450,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000065-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 345
+# File lib/git/lib.rb, line 381
     def tag_sha(tag_name)
       command('show-ref',  ['--tags', '-s', tag_name])
     end
@@ -1397,21 +1473,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000061-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 328
+# File lib/git/lib.rb, line 364
     def tags
       command_lines('tag')
     end
@@ -1420,21 +1496,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000070-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 379
+# File lib/git/lib.rb, line 415
     def update_ref(branch, commit)
       command('update-ref', [branch.to_s, commit.to_s])
     end
@@ -1443,21 +1519,21 @@ to get around it some other way later
         
-
- +
+

[Source]

-
+ onclick="toggleCode('M000068-source');return false;">[Source]

+
-# File lib/git/lib.rb, line 361
+# File lib/git/lib.rb, line 397
     def write_tree
       command('write-tree')
     end
-- 
cgit