<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,3 +9,4 @@
 * Add Git support to remote_bundle_locations. Define some sort of standard way of listing git repos, checkout how rubygems does it
 * Add some way for the user to configure where they'd prefer to install bundles
 * Add some way to add more custom remotes
+* Clean up installing from GitHub</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -62,8 +62,35 @@ class TextmateInstaller &lt; Thor
             when :svn
               %[svn co #{e_sh location[:url]}/#{e_sh bundle_name}.tmbundle #{e_sh install_bundles_path}/#{e_sh bundle_name}.tmbundle 2&gt;&amp;1]
             when :github
-              repo = find_github_bundles(denormalize_github_repo_name(bundle_name)).first
-              %[git clone #{e_sh repo['url'].sub('http', 'git') + '.git'} #{e_sh install_bundles_path}/#{e_sh bundle_name}.tmbundle 2&gt;&amp;1]
+              repos = find_github_bundles(denormalize_github_repo_name(bundle_name))
+              
+              # Handle possible multiple Repos with the same name
+              case repos.size
+              when 0
+                'echo &quot;Sorry, no such bundle found&quot;'
+              when 1
+                %[git clone #{e_sh repos.first['url'].sub('http', 'git') + '.git'} #{e_sh install_bundles_path}/#{e_sh bundle_name}.tmbundle 2&gt;&amp;1]
+              else
+                puts &quot;Multiple bundles with that name found. Please choose which one you want to install:&quot;
+                repos.each_with_index {|repo, idx|
+                  puts &quot;%d: %s by %s&quot; %
+                  [
+                    idx + 1,
+                    normalize_github_repo_name(repo['name']),
+                    repo['url'][/github\.com\/([a-zA-Z0-9]+)\//, 1]
+                  ]
+                }
+                print &quot;Your choice: &quot;
+                
+                # Since to_i defaults to 0, we have to use Integer
+                choice = Integer(STDIN.gets.chomp) rescue nil
+                until choice &amp;&amp; (0...repos.size).include?( choice - 1 ) do
+                  print &quot;Sorry, invalid choice. Please enter a valid number or Ctrl+C to stop: &quot;
+                  choice = Integer(STDIN.gets.chomp) rescue nil
+                end
+                
+                %[git clone #{e_sh repos[choice - 1]['url'].sub('http', 'git') + '.git'} #{e_sh install_bundles_path}/#{e_sh bundle_name}.tmbundle 2&gt;&amp;1]
+              end
             end
       
       res = %x{#{cmd}}</diff>
      <filename>bin/textmate</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>72dab757e96f0cc66b6bc3f59f608b3b7c72d408</id>
    </parent>
  </parents>
  <author>
    <name>Markus Prinz</name>
    <email>markus.prinz@nuclearsquid.com</email>
  </author>
  <url>http://github.com/subtleGradient/textmate/commit/f5bad1cd05ee670da5ac23aefbd6cbb71342a573</url>
  <id>f5bad1cd05ee670da5ac23aefbd6cbb71342a573</id>
  <committed-date>2008-06-04T06:26:32-07:00</committed-date>
  <authored-date>2008-06-04T06:26:32-07:00</authored-date>
  <message>Ask the user which GitHub bundle he wants to install when there are multiple repos with the same name</message>
  <tree>02186b2fcb3e0048c80ffc352ad3bcd3317c8510</tree>
  <committer>
    <name>Markus Prinz</name>
    <email>markus.prinz@nuclearsquid.com</email>
  </committer>
</commit>
