Permalink
Browse files

don't try to sync with self

  • Loading branch information...
1 parent 701f27e commit 0a509d79a257935464a794d109caa0fdabaa2b89 @technomancy committed Jul 24, 2008
Showing with 6 additions and 3 deletions.
  1. +2 −2 README.rdoc
  2. +3 −1 lib/conspire.rb
  3. +1 −0 lib/conspire/gitjour_exts.rb
View
@@ -28,10 +28,10 @@ directory as its first argument to have it initialize a repository in
that directory. From there you should open up your editor and invoke
conspire from there.
-TODO: you still have to manually <tt>git add</tt> files at first.
-
See lib/conspire/support to see which editors are supported.
+Repository history is cleared in between conspiracy sessions.
+
When using Avahi for your ZeroConf implementation, you will not be
able to do anything unless you have an active network connection. So
disconnected conspirancy sessions on the same machine are not possible
View
@@ -11,6 +11,7 @@
module Conspire
VERSION = '0.0.1'
DEFAULTS = { :port => 7456, :name => 'conspiracy', :sync_interval => 0.5 }
+ HOSTNAME = `hostname`.chomp
@conspirators = Set.new
@@ -31,7 +32,8 @@ def start(path, options)
def discover(wait = 5)
Gitjour::Application.discover(wait) do |service|
next if service.name !~ /conspiracy/ # TODO: better way of choosing names
- next if service.port.to_i == @options.port.to_i # TODO: and local
+ next if(service.port.to_i == @options.port.to_i and
+ service.host.gsub(/\.local\.$/, '') == HOSTNAME)
# No-op if we've got it already, since @conspirators is a Set
@conspirators << Conspirator.new(service.host, service.port, service.name)
@@ -5,6 +5,7 @@ class << self
def init(path)
abort "Repository already exists: #{path}" if File.exist? path + '/.git'
+ at_exit { FileUtils.rm_rf path + '/.git' }
`mkdir -p #{path} && cd #{path} && git init`
`touch #{path}/.git/git-daemon-export-ok`
end

0 comments on commit 0a509d7

Please sign in to comment.