From bc60052b519b8b991e50b8ccb30f2b76ad125996 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Fri, 16 Nov 2007 13:24:30 -0800 Subject: updated the docs --- History.txt | 12 +- Rakefile | 2 +- doc/classes/Git.html | 2 +- doc/classes/Git/Base.html | 976 ++++++++++++++++++++--------- doc/classes/Git/Branch.html | 188 +++--- doc/classes/Git/Branches.html | 72 +-- doc/classes/Git/Diff.html | 128 ++-- doc/classes/Git/Diff/DiffFile.html | 24 +- doc/classes/Git/Lib.html | 709 +++++++++++++-------- doc/classes/Git/Object.html | 25 +- doc/classes/Git/Object/AbstractObject.html | 305 +++++++-- doc/classes/Git/Object/Blob.html | 14 +- doc/classes/Git/Object/Commit.html | 158 +++-- doc/classes/Git/Object/Tag.html | 14 +- doc/classes/Git/Object/Tree.html | 80 +-- doc/classes/Git/Path.html | 60 +- doc/classes/Git/Remote.html | 84 +-- doc/created.rid | 2 +- doc/files/README.html | 42 +- doc/files/lib/git/base_rb.html | 2 +- doc/files/lib/git/branch_rb.html | 2 +- doc/files/lib/git/index_rb.html | 2 +- doc/files/lib/git/lib_rb.html | 9 +- doc/files/lib/git/object_rb.html | 2 +- doc/files/lib/git/path_rb.html | 2 +- doc/files/lib/git_rb.html | 2 +- doc/fr_method_index.html | 320 +++++----- lib/git/lib.rb | 12 +- 28 files changed, 2109 insertions(+), 1141 deletions(-) diff --git a/History.txt b/History.txt index 83361b5..b7b7bc3 100644 --- a/History.txt +++ b/History.txt @@ -1,8 +1,16 @@ -== 1.0.1 +== 1.0.3 -* Initial version +* Sped up most of the operations +* Added some predicate functions (commit?, tree?, etc) +* Added a number of lower level operations (read-tree, write-tree, checkout-index, etc) +* Fixed a bug with using bare repositories +* Updated a good amount of the documentation == 1.0.2 * Added methods to the git objects that might be helpful +== 1.0.1 + +* Initial version + diff --git a/Rakefile b/Rakefile index 0d5574a..39be2e0 100644 --- a/Rakefile +++ b/Rakefile @@ -5,7 +5,7 @@ require 'rake/gempackagetask' spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "git" - s.version = "1.0.2" + s.version = "1.0.3" s.author = "Scott Chacon" s.email = "schacon@gmail.com" s.summary = "A package for using Git in Ruby code." diff --git a/doc/classes/Git.html b/doc/classes/Git.html index 523491f..b9a6a0a 100644 --- a/doc/classes/Git.html +++ b/doc/classes/Git.html @@ -205,7 +205,7 @@ Class Git::WorkingDirectory VERSION = - '1.0.2' + '1.0.3' diff --git a/doc/classes/Git/Base.html b/doc/classes/Git/Base.html index 9c994c6..d3dec3d 100644 --- a/doc/classes/Git/Base.html +++ b/doc/classes/Git/Base.html @@ -88,48 +88,62 @@

Methods

- add   - add_remote   - add_tag   - bare   - branch   - branches   - chdir   - checkout   - clone   - commit   - commit_all   - config   - current_branch   - diff   - dir   - fetch   - gblob   - gcommit   - grep   - gtree   - index   - init   - lib   - log   - merge   - new   - object   - open   - pull   - push   - remote   - remotes   - remove   - repack   - repo   - repo_size   - reset   - reset_hard   - revparse   - status   - tag   - tags   + add   + add_remote   + add_tag   + archive   + bare   + branch   + branches   + chdir   + checkout   + checkout_index   + clone   + commit   + commit_all   + commit_tree   + config   + current_branch   + diff   + dir   + fetch   + gblob   + gcommit   + grep   + gtree   + index   + init   + lib   + log   + ls_files   + merge   + new   + object   + open   + pull   + push   + read_tree   + remote   + remotes   + remove   + repack   + repo   + repo_size   + reset   + reset_hard   + revparse   + set_index   + set_working   + status   + tag   + tags   + update_ref   + with_index   + with_temp_index   + with_temp_working   + with_working   + write_and_commit_tree   + write_tree  
@@ -151,11 +165,11 @@

Public Class methods

-
- +
+ @@ -166,10 +180,10 @@ opens a bare Git Repository - no working directory options

[Source]

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

+
-# File lib/git/base.rb, line 10
+# File lib/git/base.rb, line 12
     def self.bare(git_dir)
       self.new :repository => git_dir
     end
@@ -178,11 +192,11 @@ href="Repository.html">Repository - no working directory options
         
-
- +
+ @@ -207,10 +221,10 @@ options: :index_file

[Source]

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

+
-# File lib/git/base.rb, line 58
+# File lib/git/base.rb, line 60
     def self.clone(repository, name, opts = {})
       # run git-clone 
       self.new(Git::Lib.new.clone(repository, name, opts))
@@ -220,11 +234,11 @@ options:
         
-
- +
+ @@ -241,10 +255,10 @@ options: :index_file

[Source]

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

+
-# File lib/git/base.rb, line 29
+# File lib/git/base.rb, line 31
     def self.init(working_dir, opts = {})
       default = {:working_directory => working_dir,
                  :repository => File.join(working_dir, '.git')}
@@ -265,21 +279,21 @@ options:
         
-
- +
+

[Source]

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

+
-# File lib/git/base.rb, line 63
+# File lib/git/base.rb, line 65
     def initialize(options = {})
       if working_dir = options[:working_directory]
         options[:repository] = File.join(working_dir, '.git') if !options[:repository]
@@ -295,11 +309,11 @@ options:
         
-
- +
+ @@ -310,10 +324,10 @@ opens a new Git Project from a working directory you can specify non-standard git_dir and index file in the options

[Source]

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

+
-# File lib/git/base.rb, line 16
+# File lib/git/base.rb, line 18
     def self.open(working_dir, opts={})    
       default = {:working_directory => working_dir}
       git_options = default.merge(opts)
@@ -327,11 +341,11 @@ you can specify non-standard git_dir and index file in the options
 
       

Public Instance methods

-
- +
+ @@ -341,10 +355,10 @@ you can specify non-standard git_dir and index file in the options adds files from the working directory to the git repository

[Source]

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

+
-# File lib/git/base.rb, line 212
+# File lib/git/base.rb, line 234
     def add(path = '.')
       self.lib.add(path)
     end
@@ -353,11 +367,11 @@ adds files from the working directory to the git repository
         
-
- +
+ @@ -373,10 +387,10 @@ href="Base.html">Git::Base object if it’s a local reference @git.merge('scotts_git/master')

[Source]

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

+
-# File lib/git/base.rb, line 290
+# File lib/git/base.rb, line 312
     def add_remote(name, url, opts = {})
       if url.is_a?(Git::Base)
         url = url.repo.path
@@ -389,11 +403,11 @@ href="Base.html">Git::Base object if it’s a local reference
         
-
- +
+ @@ -403,10 +417,10 @@ href="Base.html">Git::Base object if it’s a local reference creates a new git tag (Git::Tag)

[Source]

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

+
-# File lib/git/base.rb, line 309
+# File lib/git/base.rb, line 331
     def add_tag(tag_name)
       self.lib.tag(tag_name)
       tag(tag_name)
@@ -416,11 +430,37 @@ creates a new git tag (Git::Tag)
         
-
- +
+ + +
+

+creates an archive file of the given tree-ish +

+

[Source]

+
+
+# File lib/git/base.rb, line 337
+    def archive(treeish, file = nil, opts = {})
+      self.object(treeish).archive(file, opts)
+    end
+
+
+
+
+ +
+ + + @@ -430,10 +470,10 @@ creates a new git tag (Git::Tag) returns a Git::Branch object for branch_name

[Source]

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

+
-# File lib/git/base.rb, line 167
+# File lib/git/base.rb, line 189
     def branch(branch_name = 'master')
       Git::Branch.new(self, branch_name)
     end
@@ -442,11 +482,11 @@ returns a Git::Branch object for branch_name
         
-
- +
+ @@ -457,10 +497,10 @@ returns a Git::Branches object of all the Git::Branch objects for this repo

[Source]

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

+
-# File lib/git/base.rb, line 162
+# File lib/git/base.rb, line 184
     def branches
       Git::Branches.new(self)
     end
@@ -469,11 +509,11 @@ href="Branch.html">Git::Branch objects for this repo
         
-
- +
+ @@ -493,10 +533,10 @@ example end

[Source]

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

+
-# File lib/git/base.rb, line 102
+# File lib/git/base.rb, line 115
     def chdir
       Dir.chdir(dir.path) do
         yield dir.path
@@ -507,11 +547,11 @@ example
         
-
- +
+ @@ -521,10 +561,10 @@ example checks out a branch as the new git working directory

[Source]

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

+
-# File lib/git/base.rb, line 246
+# File lib/git/base.rb, line 268
     def checkout(branch = 'master', opts = {})
       self.lib.checkout(branch, opts)
     end
@@ -533,11 +573,34 @@ checks out a branch as the new git working directory
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/base.rb, line 364
+    def checkout_index(opts = {})
+      self.lib.checkout_index(opts)
+    end
+
+
+
+
+ +
+ + + @@ -547,10 +610,10 @@ checks out a branch as the new git working directory commits all pending changes in the index file to the git repository

[Source]

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

+
-# File lib/git/base.rb, line 233
+# File lib/git/base.rb, line 255
     def commit(message, opts = {})
       self.lib.commit(message, opts)
     end
@@ -559,11 +622,11 @@ commits all pending changes in the index file to the git repository
         
-
- +
+ @@ -575,10 +638,10 @@ automatically adds all modified files without having to explicitly calling @git.add() on them.

[Source]

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

+
-# File lib/git/base.rb, line 240
+# File lib/git/base.rb, line 262
     def commit_all(message, opts = {})
       opts = {:add_all => true}.merge(opts)
       self.lib.commit(message, opts)
@@ -588,11 +651,34 @@ automatically adds all modified files without having to explicitly calling
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/base.rb, line 376
+    def commit_tree(tree = nil, opts = {})
+      Git::Object::Commit.new(self, self.lib.commit_tree(tree, opts))
+    end
+
+
+
+
+ +
+ + + @@ -605,10 +691,10 @@ value g.config(‘user.name’) # returns ‘Scott Chacon’ g.config # returns whole config hash

[Source]

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

+
-# File lib/git/base.rb, line 121
+# File lib/git/base.rb, line 134
     def config(name = nil, value = nil)
       if(name && value)
         # set value
@@ -626,11 +712,11 @@ Chacon’ g.config # returns whole config hash
         
-
- +
+ @@ -640,10 +726,10 @@ Chacon’ g.config # returns whole config hash returns the name of the branch the working directory is currently on

[Source]

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

+
-# File lib/git/base.rb, line 330
+# File lib/git/base.rb, line 425
     def current_branch
       self.lib.branch_current
     end
@@ -652,11 +738,11 @@ returns the name of the branch the working directory is currently on
         
-
- +
+ @@ -666,10 +752,10 @@ returns the name of the branch the working directory is currently on returns a Git::Diff object

[Source]

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

+
-# File lib/git/base.rb, line 207
+# File lib/git/base.rb, line 229
     def diff(objectish = 'HEAD', obj2 = nil)
       Git::Diff.new(self, objectish, obj2)
     end
@@ -678,11 +764,11 @@ returns a Git::Diff object
         
-
- +
+ @@ -696,10 +782,10 @@ returns a reference to the working directory @git.dir.writeable?

[Source]

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

+
-# File lib/git/base.rb, line 78
+# File lib/git/base.rb, line 80
     def dir
       @working_directory
     end
@@ -708,11 +794,11 @@ returns a reference to the working directory
         
-
- +
+ @@ -723,10 +809,10 @@ fetches changes from a remote branch - this does not modify the working directory, it just gets the changes from the remote if there are any

[Source]

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

+
-# File lib/git/base.rb, line 252
+# File lib/git/base.rb, line 274
     def fetch(remote = 'origin')
       self.lib.fetch(remote)
     end
@@ -735,39 +821,57 @@ directory, it just gets the changes from the remote if there are any
         
-
- +
+
-

-Alias for object -

+

[Source]

+
+
+# File lib/git/base.rb, line 169
+    def gblob(objectish)
+      Git::Object.new(self, objectish, 'blob')
+    end
+
+
-
- +
+
-

-Alias for object -

+

[Source]

+
+
+# File lib/git/base.rb, line 165
+    def gcommit(objectish)
+      Git::Object.new(self, objectish, 'commit')
+    end
+
+
-
- +
+ @@ -802,10 +906,10 @@ so you might use it like this: end

[Source]

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

+
-# File lib/git/base.rb, line 202
+# File lib/git/base.rb, line 224
     def grep(string)
       self.object('HEAD').grep(string)
     end
@@ -814,25 +918,34 @@ so you might use it like this:
         
-
- +
+
-

-Alias for object -

+

[Source]

+
+
+# File lib/git/base.rb, line 161
+    def gtree(objectish)
+      Git::Object.new(self, objectish, 'tree')
+    end
+
+
-
- +
+ @@ -842,10 +955,10 @@ Alias for object returns reference to the git index file

[Source]

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

+
-# File lib/git/base.rb, line 89
+# File lib/git/base.rb, line 91
     def index
       @index
     end
@@ -854,11 +967,11 @@ returns reference to the git index file
         
-
- +
+ @@ -871,23 +984,23 @@ replace the Git::Lib class with one that uses native methods or libgit C bindings

[Source]

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

+
-# File lib/git/base.rb, line 179
+# File lib/git/base.rb, line 201
     def lib
-      Git::Lib.new(self)
+      @lib ||= Git::Lib.new(self)
     end
 
-
- +
+ @@ -897,10 +1010,10 @@ methods or libgit C bindings returns a Git::Log object with count commits

[Source]

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

+
-# File lib/git/base.rb, line 152
+# File lib/git/base.rb, line 174
     def log(count = 30)
       Git::Log.new(self, count)
     end
@@ -909,11 +1022,34 @@ returns a Git::Log object with count commits
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/base.rb, line 390
+    def ls_files
+      self.lib.ls_files
+    end
+
+
+
+
+ +
+ + + @@ -927,10 +1063,10 @@ you can specify more than one branch to merge by passing an array of branches

[Source]

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

+
-# File lib/git/base.rb, line 268
+# File lib/git/base.rb, line 290
     def merge(branch, message = 'merge')
       self.lib.merge(branch, message)
     end
@@ -939,11 +1075,11 @@ branches
         
-
- +
+ @@ -961,10 +1097,10 @@ objectish and determine the type of the object and return an appropriate object for that type

[Source]

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

+
-# File lib/git/base.rb, line 144
+# File lib/git/base.rb, line 157
     def object(objectish)
       Git::Object.new(self, objectish)
     end
@@ -973,11 +1109,11 @@ object for that type
         
-
- +
+ @@ -988,10 +1124,10 @@ fetches a branch from a remote and merges it into the current working branch

[Source]

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

+
-# File lib/git/base.rb, line 273
+# File lib/git/base.rb, line 295
     def pull(remote = 'origin', branch = 'master', message = 'origin pull')
       fetch(remote)
       merge(branch, message)
@@ -1001,11 +1137,11 @@ branch
         
-
- +
+ @@ -1020,10 +1156,10 @@ setup the push parameters: @git.config('remote.remote-name.push', 'refs/heads/master:refs/heads/master')

[Source]

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

+
-# File lib/git/base.rb, line 261
+# File lib/git/base.rb, line 283
     def push(remote = 'origin', branch = 'master')
       self.lib.push(remote, branch)
     end
@@ -1032,11 +1168,34 @@ setup the push parameters:
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/base.rb, line 368
+    def read_tree(treeish, opts = {})
+      self.lib.read_tree(treeish, opts)
+    end
+
+
+
+
+ +
+ + + @@ -1046,10 +1205,10 @@ setup the push parameters: returns a Git::Remote object

[Source]

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

+
-# File lib/git/base.rb, line 172
+# File lib/git/base.rb, line 194
     def remote(remote_name = 'origin')
       Git::Remote.new(self, remote_name)
     end
@@ -1058,11 +1217,11 @@ returns a Git::Remote object
         
-
- +
+ @@ -1073,10 +1232,10 @@ returns an array of Git:Remote objects

[Source]

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

+
-# File lib/git/base.rb, line 279
+# File lib/git/base.rb, line 301
     def remotes
       self.lib.remotes.map { |r| Git::Remote.new(self, r) }
     end
@@ -1085,11 +1244,11 @@ href="Remote.html">Remote objects
         
-
- +
+ @@ -1099,10 +1258,10 @@ href="Remote.html">Remote objects removes file(s) from the git repository

[Source]

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

+
-# File lib/git/base.rb, line 217
+# File lib/git/base.rb, line 239
     def remove(path = '.', opts = {})
       self.lib.remove(path, opts)
     end
@@ -1111,11 +1270,11 @@ removes file(s) from the git repository
         
-
- +
+ @@ -1125,10 +1284,10 @@ removes file(s) from the git repository repacks the repository

[Source]

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

+
-# File lib/git/base.rb, line 315
+# File lib/git/base.rb, line 342
     def repack
       self.lib.repack
     end
@@ -1137,11 +1296,11 @@ repacks the repository
         
-
- +
+ @@ -1154,10 +1313,10 @@ returns reference to the git repository directory @git.dir.path

[Source]

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

+
-# File lib/git/base.rb, line 84
+# File lib/git/base.rb, line 86
     def repo
       @repository
     end
@@ -1166,11 +1325,11 @@ returns reference to the git repository directory
         
-
- +
+ @@ -1180,10 +1339,10 @@ returns reference to the git repository directory returns the repository size in bytes

[Source]

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

+
-# File lib/git/base.rb, line 109
+# File lib/git/base.rb, line 122
     def repo_size
       size = 0
       Dir.chdir(repo.path) do
@@ -1196,11 +1355,11 @@ returns the repository size in bytes
         
-
- +
+ @@ -1210,10 +1369,10 @@ returns the repository size in bytes resets the working directory to the provided commitish

[Source]

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

+
-# File lib/git/base.rb, line 222
+# File lib/git/base.rb, line 244
     def reset(commitish = nil, opts = {})
       self.lib.reset(commitish, opts)
     end
@@ -1222,11 +1381,11 @@ resets the working directory to the provided commitish
         
-
- +
+ @@ -1237,10 +1396,10 @@ resets the working directory to the commitish with ’—hard’

[Source]

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

+
-# File lib/git/base.rb, line 227
+# File lib/git/base.rb, line 249
     def reset_hard(commitish = nil, opts = {})
       opts = {:hard => true}.merge(opts)
       self.lib.reset(commitish, opts)
@@ -1250,11 +1409,11 @@ resets the working directory to the commitish with
         
-
- +
+ @@ -1269,10 +1428,10 @@ runs git rev-parse to convert the objectish to a full sha @git.revparse('v2.4:/doc/index.html')

[Source]

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

+
-# File lib/git/base.rb, line 325
+# File lib/git/base.rb, line 420
     def revparse(objectish)
       self.lib.revparse(objectish)
     end
@@ -1281,11 +1440,59 @@ runs git rev-parse to convert the objectish to a full sha
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/base.rb, line 101
+    def set_index(index_file, check = true)
+      @lib = nil
+      @index = Git::Index.new(index_file.to_s, check)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 96
+    def set_working(work_dir, check = true)
+      @lib = nil
+      @working_directory = Git::WorkingDirectory.new(work_dir.to_s, check)
+    end
+
+
+
+
+ +
+ + + @@ -1295,10 +1502,10 @@ runs git rev-parse to convert the objectish to a full sha returns a Git::Status object

[Source]

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

+
-# File lib/git/base.rb, line 157
+# File lib/git/base.rb, line 179
     def status
       Git::Status.new(self)
     end
@@ -1307,11 +1514,11 @@ returns a Git::Status object
         
-
- +
+ @@ -1321,23 +1528,23 @@ returns a Git::Status object returns a Git::Tag object

[Source]

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

+
-# File lib/git/base.rb, line 304
+# File lib/git/base.rb, line 326
     def tag(tag_name)
-      Git::Object.new(self, tag_name, true)
+      Git::Object.new(self, tag_name, 'tag', true)
     end
 
-
- +
+ @@ -1347,10 +1554,10 @@ returns a Git::Tag object returns an array of all Git::Tag objects for this repository

[Source]

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

+
-# File lib/git/base.rb, line 299
+# File lib/git/base.rb, line 321
     def tags
       self.lib.tags.map { |r| tag(r) }
     end
@@ -1359,6 +1566,189 @@ returns an array of all Git::Tag objects for this repository
         
+
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 385
+    def update_ref(branch, commit)
+      branch(branch).update_ref(commit)
+    end
+
+
+
+
+ +
+ + + + +
+

+LOWER LEVEL INDEX OPERATIONS ## +

+

[Source]

+
+
+# File lib/git/base.rb, line 349
+    def with_index(new_index)
+      old_index = @index
+      set_index(new_index, false)
+      return_value = yield @index
+      set_index(old_index)
+      return_value
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 357
+    def with_temp_index &blk
+      tempfile = Tempfile.new('temp-index')
+      temp_path = tempfile.path
+      tempfile.unlink
+      with_index(temp_path, &blk)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 405
+    def with_temp_working &blk
+      tempfile = Tempfile.new("temp-workdir")
+      temp_dir = tempfile.path
+      tempfile.unlink
+      Dir.mkdir(temp_dir, 0700)
+      with_working(temp_dir, &blk)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 394
+    def with_working(work_dir)
+      return_value = false
+      old_working = @working_directory
+      set_working(work_dir) 
+      Dir.chdir work_dir do
+        return_value = yield @working_directory
+      end
+      set_working(old_working)
+      return_value
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 380
+    def write_and_commit_tree(opts = {})
+      tree = write_tree
+      commit_tree(tree, opts)
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/base.rb, line 372
+    def write_tree
+      self.lib.write_tree
+    end
+
+
+
+
+
diff --git a/doc/classes/Git/Branch.html b/doc/classes/Git/Branch.html index 9b392fd..953f7ae 100644 --- a/doc/classes/Git/Branch.html +++ b/doc/classes/Git/Branch.html @@ -88,16 +88,18 @@

Methods

- checkout   - create   - current   - delete   - gcommit   - in_branch   - merge   - new   - to_a   - to_s   + archive   + checkout   + create   + current   + delete   + gcommit   + in_branch   + merge   + new   + to_a   + to_s   + update_ref  
@@ -142,19 +144,19 @@

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/branch.rb, line 9
     def initialize(base, name)
@@ -177,45 +179,68 @@
 
       

Public Instance methods

-
- +
+ + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 33
+    def archive(file, opts = {})
+      @base.lib.archive(@full, file, opts)
+    end
+
+
+
+
+ +
+ + +

[Source]

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

+
 # File lib/git/branch.rb, line 28
     def checkout
       check_if_create
-      @base.checkout(@name)
+      @base.checkout(@full)
     end
 
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 50
+# File lib/git/branch.rb, line 53
     def create
       check_if_create
     end
@@ -224,21 +249,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 58
+# File lib/git/branch.rb, line 61
     def current
       determine_current
     end
@@ -247,21 +272,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 54
+# File lib/git/branch.rb, line 57
     def delete
       @base.lib.branch_delete(@name)
     end
@@ -270,23 +295,23 @@
         
-
- +
+

[Source]

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

+
 # File lib/git/branch.rb, line 23
     def gcommit
-      @gcommit = @base.object(name) if !@gcommit
+      @gcommit = @base.object(@full) if !@gcommit
       @gcommit
     end
 
@@ -294,11 +319,11 @@
-
- +
+ @@ -306,7 +331,7 @@

g.branch(‘new_branch’).in_branch do +href="Branch.html#M000081">in_branch do

   # create new file
@@ -317,10 +342,10 @@ href="Branch.html#M000073">in_branch do
 end
 

[Source]

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

+
-# File lib/git/branch.rb, line 39
+# File lib/git/branch.rb, line 42
     def in_branch (message = 'in branch work')
       old_current = @base.lib.branch_current
       checkout
@@ -336,21 +361,21 @@ end
         
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 62
+# File lib/git/branch.rb, line 65
     def merge(branch = nil, message = nil)
       if branch
         in_branch do 
@@ -368,21 +393,21 @@ end
         
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 75
+# File lib/git/branch.rb, line 82
     def to_a
       [@full]
     end
@@ -391,21 +416,21 @@ end
         
-
- +
+

[Source]

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

+
-# File lib/git/branch.rb, line 79
+# File lib/git/branch.rb, line 86
     def to_s
       @full
     end
@@ -414,6 +439,29 @@ end
         
+
+ + + + +
+

[Source]

+
+
+# File lib/git/branch.rb, line 78
+    def update_ref(commit)
+      @base.lib.update_ref(@full, commit)
+    end
+
+
+
+
+
diff --git a/doc/classes/Git/Branches.html b/doc/classes/Git/Branches.html index e812dd6..994ec65 100644 --- a/doc/classes/Git/Branches.html +++ b/doc/classes/Git/Branches.html @@ -94,12 +94,12 @@ object that holds all the available branches

Methods

- []   - each   - local   - new   - remote   - size   + []   + each   + local   + new   + remote   + size  
@@ -128,19 +128,19 @@ object that holds all the available branches

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/branches.rb, line 10
     def initialize(base)
@@ -159,19 +159,19 @@ object that holds all the available branches
 
       

Public Instance methods

-
- +
+

[Source]

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

+
 # File lib/git/branches.rb, line 40
     def [](symbol)
@@ -182,19 +182,19 @@ object that holds all the available branches
         
-
- +
+

[Source]

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

+
 # File lib/git/branches.rb, line 34
     def each
@@ -207,19 +207,19 @@ object that holds all the available branches
         
-
- +
+

[Source]

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

+
 # File lib/git/branches.rb, line 20
     def local
@@ -230,19 +230,19 @@ object that holds all the available branches
         
-
- +
+

[Source]

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

+
 # File lib/git/branches.rb, line 24
     def remote
@@ -253,11 +253,11 @@ object that holds all the available branches
         
-
- +
+ @@ -267,8 +267,8 @@ object that holds all the available branches array like methods

[Source]

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

+
 # File lib/git/branches.rb, line 30
     def size
diff --git a/doc/classes/Git/Diff.html b/doc/classes/Git/Diff.html
index 63ebee2..21cb953 100644
--- a/doc/classes/Git/Diff.html
+++ b/doc/classes/Git/Diff.html
@@ -94,17 +94,17 @@ object that holds the last X commits on given branch
       

Methods

- []   - deletions   - each   - insertions   - lines   - new   - patch   - path   - size   - stats   - to_s   + []   + deletions   + each   + insertions   + lines   + new   + patch   + path   + size   + stats   + to_s  
@@ -139,19 +139,19 @@ object that holds the last X commits on given branch

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 16
     def initialize(base, from = nil, to = nil)
@@ -166,11 +166,11 @@ object that holds the last X commits on given branch
 
       

Public Instance methods

-
- +
+ @@ -180,8 +180,8 @@ object that holds the last X commits on given branch enumerable methods

[Source]

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

+
 # File lib/git/diff.rb, line 61
     def [](key)
@@ -193,19 +193,19 @@ enumerable methods
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 37
     def deletions
@@ -217,19 +217,19 @@ enumerable methods
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 66
     def each
@@ -243,19 +243,19 @@ enumerable methods
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 42
     def insertions
@@ -267,19 +267,19 @@ enumerable methods
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 32
     def lines
@@ -291,11 +291,11 @@ enumerable methods
         
-
- +
+ @@ -305,8 +305,8 @@ enumerable methods if file is provided and is writable, it will write the patch into the file

[Source]

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

+
 # File lib/git/diff.rb, line 53
     def patch(file = nil)
@@ -318,19 +318,19 @@ if file is provided and is writable, it will write the patch into the file
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 22
     def path(path)
@@ -342,19 +342,19 @@ if file is provided and is writable, it will write the patch into the file
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 27
     def size
@@ -366,19 +366,19 @@ if file is provided and is writable, it will write the patch into the file
         
-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 47
     def stats
@@ -390,8 +390,8 @@ if file is provided and is writable, it will write the patch into the file
         
-
- +
+
to_s(file = nil) @@ -399,7 +399,7 @@ if file is provided and is writable, it will write the patch into the file

-Alias for patch +Alias for patch

diff --git a/doc/classes/Git/Diff/DiffFile.html b/doc/classes/Git/Diff/DiffFile.html index 39139e5..5e9c752 100644 --- a/doc/classes/Git/Diff/DiffFile.html +++ b/doc/classes/Git/Diff/DiffFile.html @@ -86,8 +86,8 @@

Methods

- blob   - new   + blob   + new  
@@ -147,19 +147,19 @@

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 77
       def initialize(base, hash)
@@ -178,19 +178,19 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

+
 # File lib/git/diff.rb, line 87
       def blob(type = :dst)
diff --git a/doc/classes/Git/Lib.html b/doc/classes/Git/Lib.html
index 9c4992e..5875189 100644
--- a/doc/classes/Git/Lib.html
+++ b/doc/classes/Git/Lib.html
@@ -88,45 +88,52 @@
       

Methods

- add   - branch_current   - branch_delete   - branch_new   - branches_all   - checkout   + add   + archive   + branch_current   + branch_delete   + branch_new   + branches_all   + checkout   + checkout_index   clone   - commit   - commit_data   - 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   + grep   init   log_commits   - ls_files   - ls_tree   - merge   + ls_files   + ls_tree   + merge   + namerev   new   - object_contents   - object_size   - object_type   - push   - remote_add   - remote_remove   - remotes   - remove   - repack   - reset   + object_contents   + object_size   + object_type   + push   + read_tree   + remote_add   + remote_remove   + remotes   + remove   + repack   + reset   revparse   - tag   - tag_sha   - tags   + tag   + tag_sha   + tags   + update_ref   + write_tree  
@@ -162,12 +169,12 @@ onclick="toggleCode('M000025-source');return false;">[Source]

-# File lib/git/lib.rb, line 13
+# File lib/git/lib.rb, line 15
     def initialize(base = nil)
       if base.is_a?(Git::Base)
         @git_dir = base.repo.path
-        @git_index_file = base.index.path   
-        @git_work_dir = base.dir.path
+        @git_index_file = base.index.path if base.index
+        @git_work_dir = base.dir.path if base.dir
       elsif base.is_a?(Hash)
         @git_dir = base[:repository]
         @git_index_file = base[:index] 
@@ -181,21 +188,21 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

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

+creates an archive file +

+

+options +

+
+ :format  (zip, tar)
+ :prefix
+ :remote
+ :path
+
+

[Source]

+
+
+# File lib/git/lib.rb, line 399
+    def archive(sha, file = nil, opts = {})
+      opts[:format] = 'zip' if !opts[:format]
+      
+      if opts[:format] == 'tgz'
+        opts[:format] = 'tar' 
+        opts[:add_gzip] = true
+      end
+      
+      if !file
+        file = Tempfile.new('archive').path
+      end
+      
+      arr_opts = []
+      arr_opts << "--format=#{opts[:format]}" if opts[:format]
+      arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
+      arr_opts << "--remote=#{opts[:remote]}" if opts[:remote]
+      arr_opts << sha
+      arr_opts << opts[:path] if opts[:path]
+      arr_opts << '| gzip' if opts[:add_gzip]
+      arr_opts << "> #{file.to_s}"
+      command('archive', arr_opts)
+      return file
+    end
+
+
+
+
+ +
+ + +

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

+
+
+# File lib/git/lib.rb, line 383
+    def checkout_index(opts = {})
+      arr_opts = []
+      arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
+      arr_opts << "--force" if opts[:force]
+      arr_opts << "--all" if opts[:all]
+      arr_opts << ('-- ' + opts[:path_limiter]) if opts[:path_limiter].is_a? String
+      command('checkout-index', arr_opts)
+    end
+
+
+
+
+
@@ -363,7 +453,7 @@ TODO - make this work with SSH password or auth_key onclick="toggleCode('M000027-source');return false;">[Source]

-# File lib/git/lib.rb, line 40
+# File lib/git/lib.rb, line 42
     def clone(repository, name, opts = {})
       @path = opts[:path] || '.'
       opts[:path] ? clone_dir = File.join(@path, name) : clone_dir = name
@@ -383,21 +473,21 @@ TODO - make this work with SSH password or auth_key
         
-
- +
+

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 83
+# File lib/git/lib.rb, line 89
     def commit_data(sha)
       in_message = false
       
@@ -455,23 +545,33 @@ returns useful array of raw commit object data
         
-
- +
+

[Source]

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

+
-# File lib/git/lib.rb, line 232
-    def config_get(name)
-      command('config', ['--get', name])
+# File lib/git/lib.rb, line 365
+    def commit_tree(tree, opts = {})
+      opts[:message] = "commit tree #{tree}" if !opts[:message]
+      t = Tempfile.new('commit-message') do |t|
+        t.write(opts[:message])
+      end
+      
+      arr_opts = []
+      arr_opts << tree
+      arr_opts << "-p #{opts[:parent]}" if opts[:parent]
+      opts[:parents].each { |p| arr_opts << "-p #{p.to_s}" } if opts[:parents]
+      arr_opts << "< #{t.path}"
+      command('commit-tree', arr_opts)
     end
 
@@ -483,7 +583,7 @@ returns useful array of raw commit object data @@ -492,7 +592,30 @@ returns useful array of raw commit object data onclick="toggleCode('M000045-source');return false;">[Source]

-# File lib/git/lib.rb, line 236
+# File lib/git/lib.rb, line 238
+    def config_get(name)
+      command('config', ['--get', name])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 140
+# File lib/git/lib.rb, line 146
     def grep(string, opts = {})
       opts[:object] = 'HEAD' if !opts[:object]
 
@@ -779,7 +902,7 @@ returns hash
             onclick="toggleCode('M000026-source');return false;">[Source]

-# File lib/git/lib.rb, line 25
+# File lib/git/lib.rb, line 27
     def init
       command('init')
     end
@@ -805,7 +928,7 @@ READ COMMANDS ##
             onclick="toggleCode('M000028-source');return false;">[Source]

-# File lib/git/lib.rb, line 59
+# File lib/git/lib.rb, line 61
     def log_commits(opts = {})
       arr_opts = ['--pretty=oneline']
       arr_opts << "-#{opts[:count]}" if opts[:count]
@@ -821,21 +944,21 @@ READ COMMANDS ##
         
-
- +
+

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

+
+
+# File lib/git/lib.rb, line 76
+    def namerev(string)
+      command('name-rev', string).split[1]
+    end
+
+
+
+
+ +
+ + +

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

+reads a tree into the current index file +

+

[Source]

+
+
+# File lib/git/lib.rb, line 354
+    def read_tree(treeish, opts = {})
+      arr_opts = []
+      arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
+      arr_opts << treeish.to_a.join(' ')
+      command('read-tree', arr_opts)
+    end
+
+
+
+
+ +
+ + +

[Source]

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

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

+
-# File lib/git/lib.rb, line 272
+# File lib/git/lib.rb, line 278
     def reset(commit, opts = {})
       arr_opts = []
       arr_opts << '--hard' if opts[:hard]
@@ -1167,7 +1342,7 @@ to get around it some other way later
             onclick="toggleCode('M000029-source');return false;">[Source]

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

+
+
+# File lib/git/lib.rb, line 379
+    def update_ref(branch, commit)
+      command('update-ref', [branch.to_s, commit.to_s])
+    end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/lib.rb, line 361
+    def write_tree
+      command('write-tree')
+    end
+
+
+
+
+
diff --git a/doc/classes/Git/Object.html b/doc/classes/Git/Object.html index cde1e7d..a755c21 100644 --- a/doc/classes/Git/Object.html +++ b/doc/classes/Git/Object.html @@ -94,7 +94,7 @@ represents a git object

Methods

- new   + new  
@@ -126,12 +126,12 @@ Class Git::Object::Tree

Public Class methods

-
- +
+ @@ -141,11 +141,11 @@ if we’re calling this, we don’t know what type it is yet so this is our little factory method

[Source]

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

+
-# File lib/git/object.rb, line 206
-      def new(base, objectish, is_tag = false)
+# File lib/git/object.rb, line 242
+      def new(base, objectish, type = nil, is_tag = false)
         if is_tag
           sha = base.lib.tag_sha(objectish)
           if sha == ''
@@ -153,8 +153,9 @@ this is our little factory method
           end
           return Tag.new(base, sha, objectish)
         else
-          sha = base.lib.revparse(objectish)
-          type = base.lib.object_type(sha) 
+          if !type
+            type = base.lib.object_type(objectish) 
+          end
         end
         
         klass =
@@ -163,7 +164,7 @@ this is our little factory method
           when /commit/: Commit
           when /tree/:   Tree
           end
-        klass::new(base, sha)
+        klass::new(base, objectish)
       end
 
diff --git a/doc/classes/Git/Object/AbstractObject.html b/doc/classes/Git/Object/AbstractObject.html index 222bc67..86529df 100644 --- a/doc/classes/Git/Object/AbstractObject.html +++ b/doc/classes/Git/Object/AbstractObject.html @@ -86,14 +86,21 @@

Methods

- contents   - contents_array   - diff   - grep   - log   - new   - setup   - to_s   + archive   + blob?   + commit?   + contents   + contents_array   + diff   + grep   + log   + new   + setup   + sha   + size   + tag?   + to_s   + tree?  
@@ -119,7 +126,7 @@ - sha + objectish  [RW]  @@ -143,25 +150,24 @@

Public Class methods

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 14
-      def initialize(base, sha)
+# File lib/git/object.rb, line 17
+      def initialize(base, objectish)
         @base = base
-        @sha = sha.to_s
-        @size = @base.lib.object_size(@sha)
+        @objectish = objectish.to_s
         setup
       end
 
@@ -171,44 +177,119 @@

Public Instance methods

-
- +
+ + +
+

+creates an archive of this object (tree) +

+

[Source]

+
+
+# File lib/git/object.rb, line 63
+      def archive(file = nil, opts = {})
+        @base.lib.archive(@objectish, file, opts)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 71
+      def blob?
+        @type == 'blob'
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 75
+      def commit?
+        @type == 'commit'
+      end
+
+
+
+
+ +
+ + +
+

+caches the contents of this call in memory +

[Source]

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

+
-# File lib/git/object.rb, line 21
+# File lib/git/object.rb, line 32
       def contents
-        @base.lib.object_contents(@sha)
+        @contents || @contents = @base.lib.object_contents(@objectish)
       end
 
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 25
+# File lib/git/object.rb, line 36
       def contents_array
         self.contents.split("\n")
       end
@@ -217,46 +298,46 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 43
+# File lib/git/object.rb, line 54
       def diff(objectish)
-        Git::Diff.new(@base, @sha, objectish)
+        Git::Diff.new(@base, @objectish, objectish)
       end
 
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 37
+# File lib/git/object.rb, line 48
       def grep(string, path_limiter = nil, opts = {})
-        default = {:object => @sha, :path_limiter => path_limiter}
+        default = {:object => sha, :path_limiter => path_limiter}
         grep_options = default.merge(opts)
         @base.lib.grep(string, grep_options)
       end
@@ -265,44 +346,44 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 47
+# File lib/git/object.rb, line 58
       def log(count = 30)
-        Git::Log.new(@base, count).object(@sha)
+        Git::Log.new(@base, count).object(@objectish)
       end
 
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 29
+# File lib/git/object.rb, line 40
       def setup
         raise NotImplementedError
       end
@@ -311,23 +392,115 @@
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/object.rb, line 23
+      def sha
+        @sha || @sha = @base.lib.revparse(@objectish)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 27
+      def size
+        @size || @size = @base.lib.object_size(@objectish)
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 79
+     def tag?
+       @type == 'tag'
+     end
+
+
+
+
+ +
+ + +

[Source]

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

+
-# File lib/git/object.rb, line 33
+# File lib/git/object.rb, line 44
       def to_s
-        @sha
+        sha
+      end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 67
+      def tree?
+        @type == 'tree'
       end
 
diff --git a/doc/classes/Git/Object/Blob.html b/doc/classes/Git/Object/Blob.html index 453a324..bf1551a 100644 --- a/doc/classes/Git/Object/Blob.html +++ b/doc/classes/Git/Object/Blob.html @@ -88,7 +88,7 @@

Methods

- new   + new  
@@ -110,21 +110,21 @@

Public Class methods

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 56
+# File lib/git/object.rb, line 88
       def initialize(base, sha, mode = nil)
         super(base, sha)
         @mode = mode
diff --git a/doc/classes/Git/Object/Commit.html b/doc/classes/Git/Object/Commit.html
index 3be4f27..5e8e7bb 100644
--- a/doc/classes/Git/Object/Commit.html
+++ b/doc/classes/Git/Object/Commit.html
@@ -88,16 +88,17 @@
       

Methods

- author   - author_date   - committer   - committer_date   - date   - diff_parent   - gtree   - message   - parent   - parents   + author   + author_date   + committer   + committer_date   + date   + diff_parent   + gtree   + message   + name   + parent   + parents  
@@ -119,11 +120,11 @@

Public Instance methods

-
- +
+ @@ -133,10 +134,10 @@ git author

[Source]

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

+
-# File lib/git/object.rb, line 143
+# File lib/git/object.rb, line 179
       def author     
         check_commit
         @author
@@ -146,21 +147,21 @@ git author
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 148
+# File lib/git/object.rb, line 184
       def author_date
         author.date
       end
@@ -169,11 +170,11 @@ git author
         
-
- +
+ @@ -183,10 +184,10 @@ git author git author

[Source]

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

+
-# File lib/git/object.rb, line 153
+# File lib/git/object.rb, line 189
       def committer
         check_commit
         @committer
@@ -196,21 +197,21 @@ git author
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 158
+# File lib/git/object.rb, line 194
       def committer_date 
         committer.date
       end
@@ -219,8 +220,8 @@ git author
         
-
- +
+
date() @@ -228,26 +229,26 @@ git author

-Alias for committer_date +Alias for committer_date

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 163
+# File lib/git/object.rb, line 199
       def diff_parent
         diff(parent)
       end
@@ -256,21 +257,21 @@ Alias for committer_date
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 127
+# File lib/git/object.rb, line 163
       def gtree
         check_commit
         Tree.new(@base, @tree)
@@ -280,21 +281,21 @@ Alias for committer_date
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 122
+# File lib/git/object.rb, line 154
       def message
         check_commit
         @message
@@ -304,21 +305,44 @@ Alias for committer_date
         
-
- +
+ + + + +
+

[Source]

+
+
+# File lib/git/object.rb, line 159
+      def name
+        @base.lib.namerev(sha)
+      end
+
+
+
+
+ +
+

[Source]

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

+
-# File lib/git/object.rb, line 132
+# File lib/git/object.rb, line 168
       def parent
         parents.first
       end
@@ -327,11 +351,11 @@ Alias for committer_date
         
-
- +
+ @@ -341,10 +365,10 @@ Alias for committer_date array of all parent commits

[Source]

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

+
-# File lib/git/object.rb, line 137
+# File lib/git/object.rb, line 173
       def parents
         check_commit
         @parents        
diff --git a/doc/classes/Git/Object/Tag.html b/doc/classes/Git/Object/Tag.html
index 799baaa..309aa0f 100644
--- a/doc/classes/Git/Object/Tag.html
+++ b/doc/classes/Git/Object/Tag.html
@@ -88,7 +88,7 @@
       

Methods

- new   + new  
@@ -123,21 +123,21 @@

Public Class methods

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 190
+# File lib/git/object.rb, line 226
       def initialize(base, sha, name)
         super(base, sha)
         @name = name
diff --git a/doc/classes/Git/Object/Tree.html b/doc/classes/Git/Object/Tree.html
index 72a8a61..d21bc9e 100644
--- a/doc/classes/Git/Object/Tree.html
+++ b/doc/classes/Git/Object/Tree.html
@@ -88,13 +88,13 @@
       

Methods

- blobs   - children   - files   - new   - subdirectories   - subtrees   - trees   + blobs   + children   + files   + new   + subdirectories   + subtrees   + trees  
@@ -116,21 +116,21 @@

Public Class methods

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 73
+# File lib/git/object.rb, line 105
       def initialize(base, sha, mode = nil)
         super(base, sha)
         @mode = mode
@@ -142,21 +142,21 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 82
+# File lib/git/object.rb, line 114
       def blobs
         check_tree
         @blobs
@@ -166,21 +166,21 @@
         
-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 78
+# File lib/git/object.rb, line 110
       def children
         blobs.merge(subtrees)
       end
@@ -189,8 +189,8 @@
         
-
- +
+
files() @@ -198,13 +198,13 @@

-Alias for blobs +Alias for blobs

-
- +
+
subdirectories() @@ -212,13 +212,13 @@ Alias for blobs

-Alias for trees +Alias for trees

-
- +
+
subtrees() @@ -226,26 +226,26 @@ Alias for trees

-Alias for trees +Alias for trees

-
- +
+

[Source]

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

+
-# File lib/git/object.rb, line 88
+# File lib/git/object.rb, line 120
       def trees
         check_tree
         @trees
diff --git a/doc/classes/Git/Path.html b/doc/classes/Git/Path.html
index 1f49a3e..5c18b32 100644
--- a/doc/classes/Git/Path.html
+++ b/doc/classes/Git/Path.html
@@ -88,9 +88,10 @@
       

Methods

- new   - readable?   - writable?   + new   + readable?   + to_s   + writable?  
@@ -125,19 +126,19 @@

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/path.rb, line 6
     def initialize(path, check_path = true)
@@ -154,19 +155,19 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

+
 # File lib/git/path.rb, line 14
     def readable?
@@ -177,19 +178,42 @@
         
-
- +
+ + +
+

[Source]

+
+
+# File lib/git/path.rb, line 22
+    def to_s
+      @path
+    end
+
+
+
+
+ +
+ + +

[Source]

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

+
 # File lib/git/path.rb, line 18
     def writable?
diff --git a/doc/classes/Git/Remote.html b/doc/classes/Git/Remote.html
index ebe825f..7c3c2e6 100644
--- a/doc/classes/Git/Remote.html
+++ b/doc/classes/Git/Remote.html
@@ -88,13 +88,13 @@
       

Methods

- branch   - fetch   - merge   - new   - remove   - remove   - to_s   + branch   + fetch   + merge   + new   + remove   + remove   + to_s  
@@ -139,19 +139,19 @@

Public Class methods

-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 8
     def initialize(base, name)
@@ -168,19 +168,19 @@
 
       

Public Instance methods

-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 29
     def branch(branch = 'master')
@@ -191,19 +191,19 @@
         
-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 20
     def fetch
@@ -214,11 +214,11 @@
         
-
- +
+ @@ -228,8 +228,8 @@ merge this remote locally

[Source]

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

+
 # File lib/git/remote.rb, line 25
     def merge(branch = 'master')
@@ -240,19 +240,19 @@ merge this remote locally
         
-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 16
     def remove
@@ -263,19 +263,19 @@ merge this remote locally
         
-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 33
     def remove
@@ -286,19 +286,19 @@ merge this remote locally
         
-
- +
+

[Source]

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

+
 # File lib/git/remote.rb, line 37
     def to_s
diff --git a/doc/created.rid b/doc/created.rid
index c9a65f9..f785fc6 100644
--- a/doc/created.rid
+++ b/doc/created.rid
@@ -1 +1 @@
-Tue Nov 13 08:54:42 PST 2007
+Fri Nov 16 12:12:50 PST 2007
diff --git a/doc/files/README.html b/doc/files/README.html
index 69d8471..8776a1a 100644
--- a/doc/files/README.html
+++ b/doc/files/README.html
@@ -56,7 +56,7 @@
     
     
       Last Update:
-      Tue Nov 13 08:54:36 PST 2007
+      Fri Nov 16 11:43:31 PST 2007
     
     
   
@@ -305,6 +305,46 @@ And here are the operations that will need to write to your git repository. g.push g.push(g.remote('name'))
+

+Some examples of more low-level index and tree operations +

+
+   g.with_temp_index do
+
+     g.read_tree(tree3) # calls self.index.read_tree
+     g.read_tree(tree1, :prefix => 'hi/')
+
+     c = g.commit_tree('message')
+     # or #
+     t = g.write_tree
+     c = g.commit_tree(t, :message => 'message', :parents => [sha1, sha2])
+
+     g.branch('branch_name').update_ref(c)
+     g.update_ref(branch, c)
+
+     g.with_temp_working do # new blank working directory
+       g.checkout
+       g.checkout(another_index)
+       g.commit # commits to temp_index
+     end
+   end
+
+   g.set_index('/path/to/index')
+
+   g.with_index(path) do
+     # calls set_index, then switches back after
+   end
+
+   g.with_working(dir) do
+   # calls set_working, then switches back after
+   end
+
+   g.with_temp_working(dir) do
+     g.checkout_index(:prefix => dir, :path_limiter => path)
+     # do file work
+     g.commit # commits to index
+   end
+
diff --git a/doc/files/lib/git/base_rb.html b/doc/files/lib/git/base_rb.html index b88352c..ac94e28 100644 --- a/doc/files/lib/git/base_rb.html +++ b/doc/files/lib/git/base_rb.html @@ -56,7 +56,7 @@ Last Update: - Tue Nov 13 07:35:24 PST 2007 + Fri Nov 16 11:38:17 PST 2007
diff --git a/doc/files/lib/git/branch_rb.html b/doc/files/lib/git/branch_rb.html index 2c79e83..6ad83e0 100644 --- a/doc/files/lib/git/branch_rb.html +++ b/doc/files/lib/git/branch_rb.html @@ -56,7 +56,7 @@ Last Update: - Sun Nov 11 17:19:18 PST 2007 + Fri Nov 16 11:34:13 PST 2007
diff --git a/doc/files/lib/git/index_rb.html b/doc/files/lib/git/index_rb.html index c4d1cfa..d940a8b 100644 --- a/doc/files/lib/git/index_rb.html +++ b/doc/files/lib/git/index_rb.html @@ -56,7 +56,7 @@ Last Update: - Wed Nov 07 15:40:20 PST 2007 + Fri Nov 16 11:34:13 PST 2007
diff --git a/doc/files/lib/git/lib_rb.html b/doc/files/lib/git/lib_rb.html index 2462126..880a478 100644 --- a/doc/files/lib/git/lib_rb.html +++ b/doc/files/lib/git/lib_rb.html @@ -56,7 +56,7 @@ Last Update: - Mon Nov 12 17:40:54 PST 2007 + Fri Nov 16 11:42:13 PST 2007
@@ -69,6 +69,13 @@
+
+

Required files

+ +
+ tempfile   +
+
diff --git a/doc/files/lib/git/object_rb.html b/doc/files/lib/git/object_rb.html index b1cfe7d..6493bfe 100644 --- a/doc/files/lib/git/object_rb.html +++ b/doc/files/lib/git/object_rb.html @@ -56,7 +56,7 @@ Last Update: - Tue Nov 13 06:37:18 PST 2007 + Thu Nov 15 17:08:18 PST 2007
diff --git a/doc/files/lib/git/path_rb.html b/doc/files/lib/git/path_rb.html index edc7fbf..f575d7a 100644 --- a/doc/files/lib/git/path_rb.html +++ b/doc/files/lib/git/path_rb.html @@ -56,7 +56,7 @@ Last Update: - Sat Nov 10 15:17:16 PST 2007 + Fri Nov 16 11:34:13 PST 2007
diff --git a/doc/files/lib/git_rb.html b/doc/files/lib/git_rb.html index 192691a..7fac2e8 100644 --- a/doc/files/lib/git_rb.html +++ b/doc/files/lib/git_rb.html @@ -56,7 +56,7 @@ Last Update: - Tue Nov 13 07:04:48 PST 2007 + Fri Nov 16 11:34:13 PST 2007
diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html index 1c86105..6bb821e 100644 --- a/doc/fr_method_index.html +++ b/doc/fr_method_index.html @@ -21,177 +21,209 @@

Methods

[] (Git::Status)
- [] (Git::Branches)
- [] (Git::Diff)
- add (Git::Base)
- add (Git::Lib)
- add_remote (Git::Base)
- add_tag (Git::Base)
+ [] (Git::Branches)
+ [] (Git::Diff)
+ add (Git::Lib)
+ add (Git::Base)
+ add_remote (Git::Base)
+ add_tag (Git::Base)
added (Git::Status)
- author (Git::Object::Commit)
- author_date (Git::Object::Commit)
- bare (Git::Base)
+ archive (Git::Object::AbstractObject)
+ archive (Git::Branch)
+ archive (Git::Lib)
+ archive (Git::Base)
+ author (Git::Object::Commit)
+ author_date (Git::Object::Commit)
bare (Git)
+ bare (Git::Base)
between (Git::Log)
+ blob (Git::Diff::DiffFile)
blob (Git::Status::StatusFile)
- blob (Git::Diff::DiffFile)
- blobs (Git::Object::Tree)
- branch (Git::Remote)
- branch (Git::Base)
- branch_current (Git::Lib)
- branch_delete (Git::Lib)
- branch_new (Git::Lib)
- branches (Git::Base)
- branches_all (Git::Lib)
+ blob? (Git::Object::AbstractObject)
+ blobs (Git::Object::Tree)
+ branch (Git::Base)
+ branch (Git::Remote)
+ branch_current (Git::Lib)
+ branch_delete (Git::Lib)
+ branch_new (Git::Lib)
+ branches (Git::Base)
+ branches_all (Git::Lib)
changed (Git::Status)
- chdir (Git::Base)
- checkout (Git::Lib)
- checkout (Git::Branch)
- checkout (Git::Base)
- children (Git::Object::Tree)
+ chdir (Git::Base)
+ checkout (Git::Lib)
+ checkout (Git::Branch)
+ checkout (Git::Base)
+ checkout_index (Git::Lib)
+ checkout_index (Git::Base)
+ children (Git::Object::Tree)
clone (Git::Lib)
- clone (Git::Base)
clone (Git)
- commit (Git::Base)
- commit (Git::Lib)
- commit_all (Git::Base)
- commit_data (Git::Lib)
- committer (Git::Object::Commit)
- committer_date (Git::Object::Commit)
- config (Git::Base)
- config_get (Git::Lib)
- config_list (Git::Lib)
- config_remote (Git::Lib)
- config_set (Git::Lib)
- contents (Git::Object::AbstractObject)
- contents_array (Git::Object::AbstractObject)
- create (Git::Branch)
- current (Git::Branch)
- current_branch (Git::Base)
- date (Git::Object::Commit)
- delete (Git::Branch)
+ clone (Git::Base)
+ commit (Git::Base)
+ commit (Git::Lib)
+ commit? (Git::Object::AbstractObject)
+ commit_all (Git::Base)
+ commit_data (Git::Lib)
+ commit_tree (Git::Base)
+ commit_tree (Git::Lib)
+ committer (Git::Object::Commit)
+ committer_date (Git::Object::Commit)
+ config (Git::Base)
+ config_get (Git::Lib)
+ config_list (Git::Lib)
+ config_remote (Git::Lib)
+ config_set (Git::Lib)
+ contents (Git::Object::AbstractObject)
+ contents_array (Git::Object::AbstractObject)
+ create (Git::Branch)
+ current (Git::Branch)
+ current_branch (Git::Base)
+ date (Git::Object::Commit)
+ delete (Git::Branch)
deleted (Git::Status)
- deletions (Git::Diff)
- diff (Git::Object::AbstractObject)
- diff (Git::Base)
- diff_files (Git::Lib)
- diff_full (Git::Lib)
- diff_index (Git::Lib)
- diff_parent (Git::Object::Commit)
- diff_stats (Git::Lib)
- dir (Git::Base)
+ deletions (Git::Diff)
+ diff (Git::Object::AbstractObject)
+ diff (Git::Base)
+ diff_files (Git::Lib)
+ diff_full (Git::Lib)
+ diff_index (Git::Lib)
+ diff_parent (Git::Object::Commit)
+ diff_stats (Git::Lib)
+ dir (Git::Base)
+ each (Git::Diff)
each (Git::Log)
- each (Git::Diff)
each (Git::Status)
- each (Git::Branches)
- fetch (Git::Base)
- fetch (Git::Remote)
- fetch (Git::Lib)
- files (Git::Object::Tree)
+ each (Git::Branches)
+ fetch (Git::Base)
+ fetch (Git::Lib)
+ fetch (Git::Remote)
+ files (Git::Object::Tree)
first (Git::Log)
- gblob (Git::Base)
- gcommit (Git::Branch)
- gcommit (Git::Base)
- grep (Git::Base)
- grep (Git::Lib)
- grep (Git::Object::AbstractObject)
- gtree (Git::Object::Commit)
- gtree (Git::Base)
- in_branch (Git::Branch)
- index (Git::Base)
+ gblob (Git::Base)
+ gcommit (Git::Base)
+ gcommit (Git::Branch)
+ grep (Git::Base)
+ grep (Git::Object::AbstractObject)
+ grep (Git::Lib)
+ gtree (Git::Base)
+ gtree (Git::Object::Commit)
+ in_branch (Git::Branch)
+ index (Git::Base)
init (Git)
- init (Git::Base)
+ init (Git::Base)
init (Git::Lib)
- insertions (Git::Diff)
- lib (Git::Base)
- lines (Git::Diff)
- local (Git::Branches)
- log (Git::Object::AbstractObject)
- log (Git::Base)
+ insertions (Git::Diff)
+ lib (Git::Base)
+ lines (Git::Diff)
+ local (Git::Branches)
+ log (Git::Base)
+ log (Git::Object::AbstractObject)
log_commits (Git::Lib)
- ls_files (Git::Lib)
- ls_tree (Git::Lib)
- merge (Git::Base)
- merge (Git::Remote)
- merge (Git::Branch)
- merge (Git::Lib)
- message (Git::Object::Commit)
- new (Git::Object)
- new (Git::Remote)
- new (Git::Diff)
- new (Git::Object::Tree)
+ ls_files (Git::Lib)
+ ls_files (Git::Base)
+ ls_tree (Git::Lib)
+ merge (Git::Branch)
+ merge (Git::Remote)
+ merge (Git::Base)
+ merge (Git::Lib)
+ message (Git::Object::Commit)
+ name (Git::Object::Commit)
+ namerev (Git::Lib)
+ new (Git::Object::Tree)
+ new (Git::Diff)
+ new (Git::Branches)
+ new (Git::Log)
new (Git::Lib)
- new (Git::Object::Blob)
- new (Git::Object::Tag)
- new (Git::Object::AbstractObject)
- new (Git::Branches)
new (Git::Status::StatusFile)
- new (Git::Log)
- new (Git::Base)
- new (Git::Diff::DiffFile)
new (Git::Author)
+ new (Git::Object::AbstractObject)
+ new (Git::Diff::DiffFile)
+ new (Git::Remote)
+ new (Git::Branch)
+ new (Git::Object::Tag)
+ new (Git::Object)
new (Git::Status)
- new (Git::Path)
- new (Git::Branch)
+ new (Git::Path)
+ new (Git::Base)
+ new (Git::Object::Blob)
object (Git::Log)
- object (Git::Base)
- object_contents (Git::Lib)
- object_size (Git::Lib)
- object_type (Git::Lib)
+ object (Git::Base)
+ object_contents (Git::Lib)
+ object_size (Git::Lib)
+ object_type (Git::Lib)
+ open (Git::Base)
open (Git)
- open (Git::Base)
- parent (Git::Object::Commit)
- parents (Git::Object::Commit)
- patch (Git::Diff)
+ parent (Git::Object::Commit)
+ parents (Git::Object::Commit)
+ patch (Git::Diff)
+ path (Git::Diff)
path (Git::Log)
- path (Git::Diff)
pretty (Git::Status)
- pull (Git::Base)
- push (Git::Lib)
- push (Git::Base)
- readable? (Git::Path)
- remote (Git::Base)
- remote (Git::Branches)
- remote_add (Git::Lib)
- remote_remove (Git::Lib)
- remotes (Git::Base)
- remotes (Git::Lib)
- remove (Git::Base)
- remove (Git::Lib)
- remove (Git::Remote)
- remove (Git::Remote)
- repack (Git::Base)
- repack (Git::Lib)
- repo (Git::Base)
- repo_size (Git::Base)
- reset (Git::Lib)
- reset (Git::Base)
- reset_hard (Git::Base)
+ pull (Git::Base)
+ push (Git::Lib)
+ push (Git::Base)
+ read_tree (Git::Lib)
+ read_tree (Git::Base)
+ readable? (Git::Path)
+ remote (Git::Base)
+ remote (Git::Branches)
+ remote_add (Git::Lib)
+ remote_remove (Git::Lib)
+ remotes (Git::Base)
+ remotes (Git::Lib)
+ remove (Git::Remote)
+ remove (Git::Remote)
+ remove (Git::Lib)
+ remove (Git::Base)
+ repack (Git::Base)
+ repack (Git::Lib)
+ repo (Git::Base)
+ repo_size (Git::Base)
+ reset (Git::Base)
+ reset (Git::Lib)
+ reset_hard (Git::Base)
+ revparse (Git::Base)
revparse (Git::Lib)
- revparse (Git::Base)
- setup (Git::Object::AbstractObject)
+ set_index (Git::Base)
+ set_working (Git::Base)
+ setup (Git::Object::AbstractObject)
+ sha (Git::Object::AbstractObject)
since (Git::Log)
- size (Git::Diff)
- size (Git::Branches)
+ size (Git::Object::AbstractObject)
+ size (Git::Branches)
size (Git::Log)
- stats (Git::Diff)
- status (Git::Base)
- subdirectories (Git::Object::Tree)
- subtrees (Git::Object::Tree)
- tag (Git::Lib)
- tag (Git::Base)
- tag_sha (Git::Lib)
- tags (Git::Lib)
- tags (Git::Base)
- to_a (Git::Branch)
+ size (Git::Diff)
+ stats (Git::Diff)
+ status (Git::Base)
+ subdirectories (Git::Object::Tree)
+ subtrees (Git::Object::Tree)
+ tag (Git::Lib)
+ tag (Git::Base)
+ tag? (Git::Object::AbstractObject)
+ tag_sha (Git::Lib)
+ tags (Git::Base)
+ tags (Git::Lib)
+ to_a (Git::Branch)
to_s (Git::Log)
- to_s (Git::Diff)
- to_s (Git::Branch)
- to_s (Git::Object::AbstractObject)
- to_s (Git::Remote)
- trees (Git::Object::Tree)
+ to_s (Git::Branch)
+ to_s (Git::Object::AbstractObject)
+ to_s (Git::Diff)
+ to_s (Git::Path)
+ to_s (Git::Remote)
+ tree? (Git::Object::AbstractObject)
+ trees (Git::Object::Tree)
untracked (Git::Status)
- writable? (Git::Path)
+ update_ref (Git::Lib)
+ update_ref (Git::Branch)
+ update_ref (Git::Base)
+ with_index (Git::Base)
+ with_temp_index (Git::Base)
+ with_temp_working (Git::Base)
+ with_working (Git::Base)
+ writable? (Git::Path)
+ write_and_commit_tree (Git::Base)
+ write_tree (Git::Lib)
+ write_tree (Git::Base)
diff --git a/lib/git/lib.rb b/lib/git/lib.rb index dbd3d69..76223de 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -427,11 +427,11 @@ module Git end def command(cmd, opts = {}) - ENV['GIT_DIR'] = @git_dir - ENV['GIT_INDEX_FILE'] = @git_index_file - ENV['GIT_WORK_DIR'] = @git_work_dir - path = @git_work_dir || @git_dir || @path - Dir.chdir(path) do + ENV['GIT_DIR'] = @git_dir if (@git_dir != ENV['GIT_DIR']) + ENV['GIT_INDEX_FILE'] = @git_index_file if (@git_index_file != ENV['GIT_INDEX_FILE']) + ENV['GIT_WORK_DIR'] = @git_work_dir if (@git_work_dir != ENV['GIT_WORK_DIR']) + #path = @git_work_dir || @git_dir || @path + #Dir.chdir(path) do opts = opts.to_a.join(' ') git_cmd = "git #{cmd} #{opts}" out = `git #{cmd} #{opts} 2>&1`.chomp @@ -449,7 +449,7 @@ module Git raise Git::GitExecuteError.new(git_cmd + ':' + out.to_s) end out - end + #end end end -- cgit