<commit_before>require 'chef_fs/file_system/chef_server_root_dir'
require 'chef_fs/file_system/chef_repository_file_system_root_dir'
require 'chef_fs/file_pattern'
require 'chef_fs/path_utils'
require 'chef/config'

module ChefFS
  class Knife < Chef::Knife
    def self.common_options
      option :repo_mode,
        :long => '--repo-mode MODE',
        :default => "default",
        :description => "Specifies the local repository layout.  Values: default or full"
    end

    def base_path
      @base_path ||= "/" + ChefFS::PathUtils::relative_to(File.absolute_path(Dir.pwd), chef_repo)
    end<commit_msg>Fix display issue: knife diff from top level prints weird "/./..." path sometimes<commit_after>require 'chef_fs/file_system/chef_server_root_dir'
require 'chef_fs/file_system/chef_repository_file_system_root_dir'
require 'chef_fs/file_pattern'
require 'chef_fs/path_utils'
require 'chef/config'

module ChefFS
  class Knife < Chef::Knife
    def self.common_options
      option :repo_mode,
        :long => '--repo-mode MODE',
        :default => "default",
        :description => "Specifies the local repository layout.  Values: default or full"
    end

    def base_path
      @base_path ||= begin
        relative_to_base = ChefFS::PathUtils::relative_to(File.absolute_path(Dir.pwd), chef_repo)
        relative_to_base == '.' ? '/' : "/#{relative_to_base}"
      end
    end
{'fraction_non_alphanumeric': 0.11190817790530846, 'fraction_numerical': 0.0, 'mean_word_length': 3.810344827586207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '311740', 'n_tokens_mistral': 469, 'n_tokens_neox': 457, 'n_words': 97}