Commits

Michele Bini committed 8b9b401

Added --remote option.

Comments (0)

Files changed (1)

     puts
     puts "Options:"
     puts "  --all          Include all local branches"
+    puts "  --remote       Include remote branches"
     puts "  --max-depth N  Show branch history up to N commits deep"
     puts "  --graphviz     Raw graphviz output, no display via eog"
     # puts "  --svg       SVG output"
   def __all
     $all_branches = true
   end
+  def __remote
+    $all_remote_branches = true
+  end
   def __graphviz
     $raw_graphviz = true
   end
 #   end
 # end
 
+add_head = (ARGV.empty?)
+
+if $all_remote_branches
+  g.branches.remote.each do |o|
+    processlog(o.gcommit)
+  end
+  add_head = false
+end
+  
 if $all_branches
   g.branches.local.each do |o|
     processlog(o.gcommit)
   end
-  ARGV.each do |o|
-    processlog(g.gcommit(o))
-  end
-elsif (ARGV.empty?)
-  processlog(g)
-else
-  ARGV.each do |o|
-    processlog(g.gcommit(o))
-  end
+  add_head = false
 end
 
+ARGV.each do |o|
+  processlog(g.gcommit(o))
+end
+
+processlog(g) if add_head
+
 puts "}"
 
 # $stdout.close