public
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/Caged/gitnub.git
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
Find commits by specifying a file/path
Caged (author)
Fri Jun 13 01:29:26 -0700 2008
commit  8782859a0a20df930a1e5729382809fc0838aabe
tree    f80068e5453675e065a5bc5940652933b794dc1d
parent  6040395dc9ee34a36fd1ad92802bef9a956b8831
...
91
92
93
 
 
 
 
 
94
95
96
...
116
117
118
 
 
 
119
120
121
...
130
131
132
133
 
134
 
135
136
137
 
138
139
...
91
92
93
94
95
96
97
98
99
100
101
...
121
122
123
124
125
126
127
128
129
...
138
139
140
 
141
142
143
144
145
 
146
147
148
0
@@ -91,6 +91,11 @@ class ApplicationController < OSX::NSObject
0
     @current_search_item = sender.title
0
   end
0
   
0
+  def search_commits(sender)
0
+    @commits_controller.search_commits(@current_search_item, sender.stringValue)
0
+  end
0
+  
0
+  
0
   private
0
     def setup_refs_view_menu
0
       [@local_branches_menu, @remote_branches_menu, @tags_menu].each { |m| m.submenu.setAutoenablesItems(false) }
0
@@ -116,6 +121,9 @@ class ApplicationController < OSX::NSObject
0
     def setup_search_field
0
       @search_menu = NSMenu.alloc.initWithTitle("Search Menu")
0
       @search_field.cell.setSearchMenuTemplate(@search_menu)
0
+      @search_field.cell.setSendsWholeSearchString(true)
0
+      @search_field.setTarget(self)
0
+      @search_field.setAction(:search_commits)
0
       @search_menu.setAutoenablesItems(false)
0
       
0
       add_menu_item = lambda do |title, tooltip, state|
0
@@ -130,10 +138,11 @@ class ApplicationController < OSX::NSObject
0
         end
0
       end
0
       
0
-      add_menu_item.call("Commits", "Search commit messages", true)
0
+      add_menu_item.call("Message", "Search commit messages", true)
0
       add_menu_item.call("SHA1", "Find a commit by its SHA1 hash", false)
0
+      add_menu_item.call("Committer", "Find all all commits by a particular committer", false)
0
       add_menu_item.call("Author", "Find all all commits by a particular author", false)
0
       add_menu_item.call("Path", "Find commits based on a path", false)
0
-
0
+      @search_field.cell.setPlaceholderString("Search commits...")
0
     end
0
 end
...
224
225
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
228
229
...
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
0
@@ -224,6 +224,27 @@ class CommitsController < OSX::NSObject
0
     select_latest_commit
0
   end
0
   
0
+  def search_commits(category, query)
0
+    unless query == ""
0
+      repo = @application_controller.repo
0
+      case category.downcase.to_sym
0
+        when :message
0
+         @commits = Grit::Commit.find_all(repo, nil, {:grep => query, :i => true})
0
+        when :committer
0
+         @commits = Grit::Commit.find_all(repo, nil, {:committer => query})
0
+        when :author
0
+         @commits = Grit::Commit.find_all(repo, nil, {:author => query})
0
+        when :sha1
0
+          @commits = [repo.commit(query)]
0
+        when :path
0
+          @commits = repo.log(@branch, query)
0
+      end
0
+      @commits_table.reloadData
0
+      select_latest_commit
0
+    else
0
+      refresh
0
+    end
0
+  end
0
   
0
   private
0
   
...
519
520
521
522
 
523
524
525
 
526
527
528
 
529
530
531
532
533
 
534
535
536
...
548
549
550
551
552
 
 
553
554
555
...
577
578
579
580
581
 
 
582
583
584
...
1532
1533
1534
1535
 
1536
1537
1538
...
1581
1582
1583
1584
 
1585
1586
1587
...
2211
2212
2213
2214
 
2215
2216
2217
 
2218
2219
2220
2221
2222
2223
2224
 
 
2225
2226
2227
...
519
520
521
 
522
523
524
 
525
526
527
 
528
529
530
531
532
 
533
534
535
536
...
548
549
550
 
 
551
552
553
554
555
...
577
578
579
 
 
580
581
582
583
584
...
1532
1533
1534
 
1535
1536
1537
1538
...
1581
1582
1583
 
1584
1585
1586
1587
...
2211
2212
2213
 
2214
2215
2216
 
2217
2218
2219
2220
2221
2222
 
 
2223
2224
2225
2226
2227
0
@@ -519,18 +519,18 @@
0
                 <int key="NSSegmentStyle">2</int>
0
               </object>
0
             </object>
0
-            <object class="NSSearchField" id="444059892">
0
+            <object class="NSSearchField" id="349599463">
0
               <reference key="NSNextResponder" ref="831824449"/>
0
               <int key="NSvFlags">292</int>
0
-              <string key="NSFrame">{{292, 11}, {154, 22}}</string>
0
+              <string key="NSFrame">{{347, 11}, {189, 22}}</string>
0
               <reference key="NSSuperview" ref="831824449"/>
0
               <bool key="NSEnabled">YES</bool>
0
-              <object class="NSSearchFieldCell" key="NSCell" id="534219204">
0
+              <object class="NSSearchFieldCell" key="NSCell" id="508547132">
0
                 <int key="NSCellFlags">343014976</int>
0
                 <int key="NSCellFlags2">268436480</int>
0
                 <string key="NSContents"/>
0
                 <reference key="NSSupport" ref="98627494"/>
0
-                <reference key="NSControlView" ref="444059892"/>
0
+                <reference key="NSControlView" ref="349599463"/>
0
                 <bool key="NSDrawsBackground">YES</bool>
0
                 <int key="NSTextBezelStyle">1</int>
0
                 <object class="NSColor" key="NSBackgroundColor">
0
@@ -548,8 +548,8 @@
0
                   <int key="NSCellFlags2">0</int>
0
                   <string key="NSContents">search</string>
0
                   <string key="NSAction">_searchFieldSearch:</string>
0
-                  <reference key="NSTarget" ref="534219204"/>
0
-                  <reference key="NSControlView" ref="444059892"/>
0
+                  <reference key="NSTarget" ref="508547132"/>
0
+                  <reference key="NSControlView" ref="349599463"/>
0
                   <int key="NSButtonFlags">138690815</int>
0
                   <int key="NSButtonFlags2">0</int>
0
                   <string key="NSKeyEquivalent"/>
0
@@ -577,8 +577,8 @@
0
                     </object>
0
                   </object>
0
                   <string key="NSAction">_searchFieldCancel:</string>
0
-                  <reference key="NSTarget" ref="534219204"/>
0
-                  <reference key="NSControlView" ref="444059892"/>
0
+                  <reference key="NSTarget" ref="508547132"/>
0
+                  <reference key="NSControlView" ref="349599463"/>
0
                   <int key="NSButtonFlags">138690815</int>
0
                   <int key="NSButtonFlags2">0</int>
0
                   <string key="NSKeyEquivalent"/>
0
@@ -1532,7 +1532,7 @@
0
           <object class="IBOutletConnection" key="connection">
0
             <string key="label">search_field</string>
0
             <reference key="source" ref="620275248"/>
0
-            <reference key="destination" ref="444059892"/>
0
+            <reference key="destination" ref="349599463"/>
0
           </object>
0
           <int key="connectionID">555</int>
0
         </object>
0
@@ -1581,7 +1581,7 @@
0
               <reference ref="869639466"/>
0
               <reference ref="1049027428"/>
0
               <reference ref="637722390"/>
0
-              <reference ref="444059892"/>
0
+              <reference ref="349599463"/>
0
             </object>
0
             <reference key="parent" ref="469667931"/>
0
           </object>
0
@@ -2211,17 +2211,17 @@
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">553</int>
0
-            <reference key="object" ref="444059892"/>
0
+            <reference key="object" ref="349599463"/>
0
             <object class="NSMutableArray" key="children">
0
               <bool key="EncodedWithXMLCoder">YES</bool>
0
-              <reference ref="534219204"/>
0
+              <reference ref="508547132"/>
0
             </object>
0
             <reference key="parent" ref="831824449"/>
0
           </object>
0
           <object class="IBObjectRecord">
0
             <int key="objectID">554</int>
0
-            <reference key="object" ref="534219204"/>
0
-            <reference key="parent" ref="444059892"/>
0
+            <reference key="object" ref="508547132"/>
0
+            <reference key="parent" ref="349599463"/>
0
           </object>
0
         </object>
0
       </object>
...
44
45
46
47
 
48
49
50
...
44
45
46
 
47
48
49
50
0
@@ -44,7 +44,7 @@ class NetworkController < OSX::NSObject
0
           <h2>If this is a Github repository you can set your credentials to view your network</h2>
0
           <pre>
0
             git config github.user  REPO_USER
0
-            git config githuser.repo REPO_NAME
0
+            git config githubV.repo REPO_NAME
0
           </pre>
0
         </body>
0
         </html>

Comments