repository defaults

12 views
Skip to first unread message

galens

unread,
Mar 18, 2022, 1:41:47 PM3/18/22
to Trac Users
Hi,

I have some questions about git repositories.  <https://trac.edgewall.org/wiki/TracRepositoryAdmin#Repositorycaching> indicates that a git repository is cached by default.  However, if I add a git repository to a new trac environment, when I do a resync I get a "0 revisions cached." message.  I assume this means that caching, at least for git, does in fact default to false.  Is this correct?

If git repositories do indeed default to cached=false, under what circumstances should I consider enabling caching?

Is there some way to view the entire trac configuration (not just the trac.ini file)?  I noticed that there doesn't see to be a trac-admin repository get command. How can the cached state be queried?

thanks,
galen

Ubuntu   21.10
trac     1.5.3+dfsg-1
python   3.9.7
apache2  2.4.48-3.1ubuntu3.3

RjOllos

unread,
Mar 21, 2022, 10:12:36 PM3/21/22
to Trac Users
On Friday, March 18, 2022 at 10:41:47 AM UTC-7 galens wrote:
Hi,

I have some questions about git repositories.  <https://trac.edgewall.org/wiki/TracRepositoryAdmin#Repositorycaching> indicates that a git repository is cached by default.  However, if I add a git repository to a new trac environment, when I do a resync I get a "0 revisions cached." message.  I assume this means that caching, at least for git, does in fact default to false.  Is this correct?

That statement is incorrect. I've edited the page accordingly. Good find!

The default config values are shown here:
 
If git repositories do indeed default to cached=false, under what circumstances should I consider enabling caching?

It's more work to set up caching, but the performance will be better. So definitely if you will have concurrent access to the website and need reasonable performance. Setup a post-receive hook otherwise Trac will "sync on request", which can slow the page load time.

The reason is that the synchronization is not done asynchronous with the page processing, although I suppose that would be easier to do with the new async functionality in Python3:


There are two caching options that work together. There should probably be only one, but it's an artifact of early development of the plugin. I doubt there is a use-case in which you would not enable the persistent_cache if you've done the work to setup the repository hooks,

[git]
cached_repository = enabled
persistent_cache = enabled
 
Is there some way to view the entire trac configuration (not just the trac.ini file)?

The /about page will show you the Trac configuration if you have CONFIG_VIEW (or TRAC_ADMIN).
 
I noticed that there doesn't see to be a trac-admin repository get command. How can the cached state be queried?

$ trac-admin $ENV config get git cached_repository
disabled 

Ryan
Reply all
Reply to author
Forward
0 new messages