Re: [gitg] libgit2-glib status and index questions



Hi James,

It's a little bit difficult to see what might be going wrong. My first guess would be that you need to refresh the internal libgit2 cache of the file status. When we use libgit2-glib in gitg we don't see any issues, but we re-read the index each time (ggit_index_read) a new commit is made. You might try to do the same thing. In any case, if you want to have a look at how gitg makes use of the API, have a look at https://git.gnome.org/browse/gitg/tree/libgitg/gitg-stage.vala


Jesse


2013/7/23 James Liggett <jrliggett cox net>
Hi,
Firstly, I hope this is the right place to be asking this, as I don't
see a dedicated list for libgit2-glib anywhere. So I thought I might be
able to reach some of its developers here...

Throughout the 3.10 cycle I've been working on porting Anjuta's git
plugin to use libgit2-glib instead of using command line git. Recently
I've been able to get libgit2-glib up and running, and I can open up a
repository and get some basic file status information out of it.

But, problems arise when I actually try to commit something, either with
the command line or the plugin, which still uses a git process in the
background. The status information that comes back after the commit
isn't accurate: files that I commit show as modified in both the index
and the working tree, while git status from the command line doesn't
show the committed files at all, because they were just committed and
are no longer listed as modified.  Here are some screen grabs showing
what I get before a commit, after a commit, and after I reload the project:

Before commit: http://ubuntuone.com/30XJBBABbIMwq4VEFQWU2r
After commit: http://ubuntuone.com/2f77dzFUeKc9HYelaCJeDM
After reloading the project: http://ubuntuone.com/0BSoqNpiew4v5xYzFQS9ZZ

The status output corrects itself after I reload the project within
Anjuta, which reloads the git repository in libgit2-glib. Has anyone
seen this behavior with libgit2(-glib) before? I have my libgit2-glib
porting work in the libgi2-glib branch on anjuta's repository if you
want to have a look at it. You can also browse it at
https://git.gnome.org/browse/anjuta/log/?h=libgit2-glib

Briefly, I use ggit_repository_file_status_foreach in a thread to get
status output, which seems pretty straightforward, but this behavior
doesn't make much sense. I have libgi2 complied with -DTHREADSAFE=ON,
and I'm depending on libgit2-glib 0.0.6.

If anyone could point me in the right direction on this I would
appreciate it.

Thanks,
James Liggett
_______________________________________________
gitg-list mailing list
gitg-list gnome org
https://mail.gnome.org/mailman/listinfo/gitg-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]