From 38f009d6d0aa35b13d19575611db1c724a9d1a5b Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Tue, 13 Nov 2007 07:36:50 -0800 Subject: updated a bunch of the documentation --- doc/classes/Git/Lib.html | 582 +++++++++++++++++++++++++++-------------------- 1 file changed, 330 insertions(+), 252 deletions(-) (limited to 'doc/classes/Git/Lib.html') diff --git a/doc/classes/Git/Lib.html b/doc/classes/Git/Lib.html index bb507b4..9c4992e 100644 --- a/doc/classes/Git/Lib.html +++ b/doc/classes/Git/Lib.html @@ -88,43 +88,45 @@

Methods

- add   - branch_current   - branch_delete   - branch_new   - branches_all   - checkout   - clone   - commit   - config_get   - config_list   - config_remote   - config_set   - diff_files   - diff_full   - diff_index   - diff_stats   - fetch   - grep   - init   - log_commits   - ls_files   - merge   - new   - object_contents   - object_size   - object_type   - push   - remote_add   - remote_remove   - remotes   - remove   - repack   - reset   - revparse   - tag   - tag_sha   - tags   + add   + branch_current   + branch_delete   + branch_new   + branches_all   + checkout   + clone   + commit   + commit_data   + config_get   + config_list   + config_remote   + config_set   + diff_files   + diff_full   + diff_index   + diff_stats   + fetch   + grep   + init   + log_commits   + ls_files   + ls_tree   + merge   + new   + object_contents   + object_size   + object_type   + push   + remote_add   + remote_remove   + remotes   + remove   + repack   + reset   + revparse   + tag   + tag_sha   + tags  
@@ -146,19 +148,19 @@

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/lib.rb, line 13
     def initialize(base = nil)
@@ -179,21 +181,21 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 215
+# File lib/git/lib.rb, line 251
     def add(path = '.')
       path = path.join(' ') if path.is_a?(Array)
       command('add', path)
@@ -203,21 +205,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 96
+# File lib/git/lib.rb, line 132
     def branch_current
       branches_all.select { |b| b[1] }.first[0] rescue nil
     end
@@ -226,21 +228,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 248
+# File lib/git/lib.rb, line 284
     def branch_delete(branch)
       command('branch', ['-d', branch])
     end
@@ -249,21 +251,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 244
+# File lib/git/lib.rb, line 280
     def branch_new(branch)
       command('branch', branch)
     end
@@ -272,21 +274,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 86
+# File lib/git/lib.rb, line 122
     def branches_all
       arr = []
       command_lines('branch', '-a').each do |b| 
@@ -301,21 +303,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 252
+# File lib/git/lib.rb, line 288
     def checkout(branch, opts = {})
       arr_opts = []
       arr_opts << '-f' if opts[:force]
@@ -328,11 +330,11 @@
         
-
- +
+ @@ -358,8 +360,8 @@ accepts options: TODO - make this work with SSH password or auth_key

[Source]

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

+
 # File lib/git/lib.rb, line 40
     def clone(repository, name, opts = {})
@@ -381,21 +383,21 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 230
+# File lib/git/lib.rb, line 266
     def commit(message, opts = {})
       arr_opts = ["-m '#{message}'"]
       arr_opts << '-a' if opts[:add_all]
@@ -406,21 +408,68 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+ + +
+

+returns useful array of raw commit object data +

+

[Source]

+
+
+# File lib/git/lib.rb, line 83
+    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
+    end
+
+
+
+
+ +
+ + +

[Source]

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

+
-# File lib/git/lib.rb, line 196
+# File lib/git/lib.rb, line 232
     def config_get(name)
       command('config', ['--get', name])
     end
@@ -429,21 +478,21 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 200
+# File lib/git/lib.rb, line 236
     def config_list
       hsh = {}
       command_lines('config', ['--list']).each do |line|
@@ -457,21 +506,21 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 187
+# File lib/git/lib.rb, line 223
     def config_remote(name)
       hsh = {}
       command_lines('config', ['--get-regexp', "remote.#{name}"]).each do |line|
@@ -485,11 +534,11 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+ @@ -499,10 +548,10 @@ TODO - make this work with SSH password or auth_key WRITE COMMANDS ##

[Source]

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

+
-# File lib/git/lib.rb, line 211
+# File lib/git/lib.rb, line 247
     def config_set(name, value)
       command('config', [name, "'#{value}'"])
     end
@@ -511,11 +560,11 @@ WRITE COMMANDS ##
         
-
- +
+ @@ -525,10 +574,10 @@ WRITE COMMANDS ## compares the index and the working directory

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 123
+# File lib/git/lib.rb, line 159
     def diff_full(obj1 = 'HEAD', obj2 = nil, opts = {})
       diff_opts = ['-p']
       diff_opts << obj1
@@ -572,11 +621,11 @@ compares the index and the working directory
         
-
- +
+ @@ -586,10 +635,10 @@ compares the index and the working directory compares the index and the repository

[Source]

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

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

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 295
+# File lib/git/lib.rb, line 331
     def fetch(remote)
       command('fetch', remote.to_s)
     end
@@ -667,11 +716,11 @@ compares the index and the repository
         
-
- +
+ @@ -689,10 +738,10 @@ returns hash

[Source]

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

+
-# File lib/git/lib.rb, line 104
+# File lib/git/lib.rb, line 140
     def grep(string, opts = {})
       opts[:object] = 'HEAD' if !opts[:object]
 
@@ -716,19 +765,19 @@ returns hash
         
-
- +
+

[Source]

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

+
 # File lib/git/lib.rb, line 25
     def init
@@ -739,11 +788,11 @@ returns hash
         
-
- +
+ @@ -753,8 +802,8 @@ returns hash READ COMMANDS ##

[Source]

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

+
 # File lib/git/lib.rb, line 59
     def log_commits(opts = {})
@@ -772,21 +821,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 176
+# File lib/git/lib.rb, line 212
     def ls_files
       hsh = {}
       command_lines('ls-files', '--stage').each do |line|
@@ -801,21 +850,50 @@ READ COMMANDS ##
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 112
+    def ls_tree(sha)
+      data = {'blob' => {}, 'tree' => {}}
+      command_lines('ls-tree', sha.to_s).each do |line|
+        (info, filenm) = line.split("\t")
+        (mode, type, sha) = info.split
+        data[type][filenm] = {:mode => mode, :sha => sha}
+      end
+      data
+    end
+
+
+
+
+ +
+ + +

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 82
+# File lib/git/lib.rb, line 108
     def object_contents(sha)
       command('cat-file', ['-p', sha])
     end
@@ -850,19 +928,19 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

+
 # File lib/git/lib.rb, line 78
     def object_size(sha)
@@ -873,19 +951,19 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

+
 # File lib/git/lib.rb, line 74
     def object_type(sha)
@@ -896,21 +974,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 299
+# File lib/git/lib.rb, line 335
     def push(remote, branch = 'master')
       command('push', [remote.to_s, branch.to_s])
     end
@@ -919,21 +997,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 267
+# File lib/git/lib.rb, line 303
     def remote_add(name, url, opts = {})
       arr_opts = ['add']
       arr_opts << '-f' if opts[:with_fetch]
@@ -947,11 +1025,11 @@ READ COMMANDS ##
         
-
- +
+ @@ -962,10 +1040,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('M000056-source');return false;">[Source]

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

[Source]

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

+
-# File lib/git/lib.rb, line 282
+# File lib/git/lib.rb, line 318
     def remotes
       command_lines('remote')
     end
@@ -997,21 +1075,21 @@ to get around it some other way later
         
-
- +
+

[Source]

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

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

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 236
+# File lib/git/lib.rb, line 272
     def reset(commit, opts = {})
       arr_opts = []
       arr_opts << '--hard' if opts[:hard]
@@ -1075,19 +1153,19 @@ to get around it some other way later
         
-
- +
+

[Source]

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

+
 # File lib/git/lib.rb, line 70
     def revparse(string)
@@ -1098,21 +1176,21 @@ to get around it some other way later
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 290
+# File lib/git/lib.rb, line 326
     def tag(tag)
       command('tag', tag)
     end
@@ -1121,21 +1199,21 @@ to get around it some other way later
         
-
- +
+

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 286
+# File lib/git/lib.rb, line 322
     def tags
       command_lines('tag')
     end
-- 
cgit