<commit_before>namespace :redmine_git_hosting do

  desc 'Reload defaults from init.rb into the redmine_git_hosting settings.'
  task restore_default_settings: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Reloading defaults from init.rb from command line') do
      RedmineGitHosting::Config.reload_from_file!
    end
  end
  task restore_defaults: [:restore_default_settings]


  desc 'Purge expired repositories from Recycle Bin'
  task purge_recycle_bin: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Purging Recycle Bin from command line') do
      RedmineGitHosting::GitoliteAccessor.purge_recycle_bin
    end
  end


  desc 'Update/repair Gitolite configuration'
  task update_repositories: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Performing manual update_repositories operation from command line') do
      RedmineGitHosting::GitoliteAccessor.update_projects('all', { message: "Resync all projects (#{Project.all.length})..." })
    end
  end


  desc 'Fetch commits from gitolite repositories/update gitolite configuration'
  task fetch_changesets: [:environment] do<commit_msg>Rename redmine_git_hosting:restore_defaults task to redmine_git_hosting:update_settings<commit_after>namespace :redmine_git_hosting do

  desc 'Update plugin settings in database (This will read settings from `<redmine_root>/redmine_git_hosting.yml` and `<plugin_root>/settings.yml`)'
  task update_settings: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Reloading defaults settings from command line') do
      RedmineGitHosting::Config.reload_from_file!
    end
  end


  desc 'Purge expired repositories from Recycle Bin'
  task purge_recycle_bin: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Purging Recycle Bin from command line') do
      RedmineGitHosting::GitoliteAccessor.purge_recycle_bin
    end
  end


  desc 'Update/repair Gitolite configuration'
  task update_repositories: [:environment] do
    RedmineGitHosting::ConsoleLogger.title('Performing manual update_repositories operation from command line') do
      RedmineGitHosting::GitoliteAccessor.update_projects('all', { message: "Resync all projects (#{Project.all.length})..." })
    end
  end


  desc 'Fetch commits from gitolite repositories/update gitolite configuration'
  task fetch_changesets: [:environment] do
{'fraction_non_alphanumeric': 0.07832345469940728, 'fraction_numerical': 0.0, 'mean_word_length': 5.582172701949861, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '345801', 'n_tokens_mistral': 718, 'n_tokens_neox': 667, 'n_words': 178}