remotes.set(rn.substring(11), rh.get_oid());
remotes_used.set(rn.substring(11), false);
- }
+ }
+
+
} catch (Error e) {
GLib.debug("Failed to fetch remotes continuing on ");
}
+ rem.disconnect();
+
-
var r = repo.repo.enumerate_branches(Ggit.BranchType.LOCAL);
while (r.next()) {
br.active = gbr.is_head();
br.name = gbr.get_name();
br.lastrev = gbr.get_target().to_string();
- string rname ;
+ string rname ="";
+ /*
+
+ THIS IS DISABLED, and get_upstream has a major memor leak.
try {
rname = gbr.get_upstream() != null ? gbr.get_upstream().get_name() : "";
} catch(Error e) {
GLib.debug("Skip branch = got error");
continue;
}
+ */
repo.branches.set(gbr.get_name(), br);
if (rname.has_prefix("refs/remotes/origin/")) {
rname = rname.substring(20);
this.repo = Ggit.Repository.open(GLib.File.new_for_path(path));
- var r = this.repo.lookup_remote("origin");
+ //var r = this.repo.lookup_remote("origin");
//var r = this.git({ "remote" , "get-url" , "--push" , "origin"});
- var uri = new Soup.URI(r.get_url());
- this.host = uri.get_host();
+ //var uri = new Soup.URI(r.get_url());
+ //this.host = uri.get_host();
this.init_config();
this.loadBranches();
var options = new Ggit.FetchOptions();
options.set_remote_callbacks( new GitCallbacks(this));
r.download(far, options);
+ r.disconnect();
}
this.loadStatus();
var cb = new GitCallbacks(this);
r.connect(Ggit.Direction.FETCH, cb, null, null);
this.remote_heads = r.list();
+ r.disconnect();
}
fm.changed.connect( this.onEvent );
this.monitors.append_val(fm);
+
+
+ total_monitors++;
+ GLib.debug("Total Monitors this: %d, All:%d: %s", (int)this.monitors.length, total_monitors, path);
+
} catch (Error e) {
GLib.debug("Error adding monitor: %s\n", e.message);
--- /dev/null
+
+/**
+valac --vapidir=. --pkg fanotify --pkg posix -o /tmp/fanotify fanotify.vala fanotify-helper.c
+
+*/
+
+
+extern void fanotify_read (int fh);
+
+void main (string[] args) {
+
+
+ // root version?
+ //var fan = Fanotify.init(Fanotify.InitFlag.CLOEXEC | Fanotify.InitFlag.CLASS_CONTENT , Posix.O_RDONLY );
+
+ //non-root (not content?)
+ // var fan = Fanotify.init(Fanotify.InitFlag.CLOEXEC | Fanotify.InitFlag.CLASS_NOTIF | Fanotify.InitFlag.REPORT_FID , Posix.O_RDONLY );
+ var fan = Fanotify.init(
+ Fanotify.InitFlag.CLOEXEC | Fanotify.InitFlag.CLASS_NOTIF | Fanotify.InitFlag.REPORT_DIR_FID | Fanotify.InitFlag.REPORT_NAME ,
+ Posix.O_RDONLY );
+ if(fan == -1){
+ Posix.perror("fanotify_init");
+ Posix.exit(Posix.EXIT_FAILURE);
+ }
+ /*
+ // root version.
+ var ret = Fanotify.mark(
+ fan,
+ Fanotify.Mark.ADD | Fanotify.Mark.MOUNT,
+ Fanotify.EventType.OPEN_PERM | Fanotify.EventType.CLOSE_WRITE ,
+ Posix.AT_FDCWD, "/home/"
+ );
+ */
+ // not root version?
+ var ret = Fanotify.mark(
+ fan,
+ Fanotify.Mark.ADD ,
+ Fanotify.EventType.CREATE | Fanotify.EventType.DELETE | Fanotify.EventType.MODIFY | Fanotify.EventType.EVENT_ON_CHILD,
+ Posix.AT_FDCWD, "/home/alan/gitlive/gitlive/fanotify"
+ );
+
+ if(ret == -1){
+ Posix.perror("fanotify_mark");
+ Posix.exit(Posix.EXIT_FAILURE);
+ }
+ Posix.printf("got mark %d", ret);
+ fanotify_read(fan);
+
+}
\ No newline at end of file