Use subcommand-specific repository config paths

finchie
Aug 1, 2025, 8:36 AM
FIMDS32ZN6OCZUBWYNKDHZJ6FNKUC7NRUC37Q45HXQRBSTDM4YSQC

Dependencies

  • [2] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [3] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [4] Q45QHPO4 Feedback on network stuff
  • [5] ZHABNS3S Canonicalize all paths
  • [6] 3KRGVQFU Do not update the mtime of unmodified files
  • [7] QMTANHVN Reset: only output changed files
  • [8] XA23FMQM Reset only files that have been modified
  • [9] LGEJSLTY Fixing output (including its uses in reset and pull)
  • [10] W5HHTRPK Rename the `mv` command to `move`
  • [11] LBVUI6AX Rename `ls` command to `list`
  • [12] QL6K2ZM3 Tags
  • [13] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [14] RUBBHYZ7 Removing unnecessary async/await
  • [15] VGBH3ED6 The Git feature does not need to be async
  • [16] IVLLXQ5Z Improved push/pull reporting
  • [17] OU6JOR3C Add path filtering for log, add json output for log
  • [18] 6F6AAHK4 Simplifying pijul::commands::log, and fixing Broken Pipe errors
  • [19] S4LQTDJI avoid outputting repo multiple times in channel switch
  • [20] 4KJ45IJL Implement new identity management
  • [21] 4OJWMSOW Fully replace crate::Identity
  • [22] VWJ2JL63 Adding a `pijul dependents` command to list the transitive closure of the reverse dependency relation
  • [23] LZOGKBJX new command `pijul client` for authenticating to a HTTP server
  • [24] Y6TBQN7M Automatically format `pijul` crate
  • [25] ABQDWHNG Migrate from `pijul::repository` to `pijul-repository`
  • [26] N26HD5PF Replace `chrono` with `jiff`
  • [27] 56KJGRVO Remove `atty` dependency
  • [28] SCUBUHIA Remove `lazy_static` dependency
  • [29] IBLJI7IA ✨ Add `pijul status` subcommand
  • [30] YQJRT2UB ✨ Add current channel to pijul status output
  • [31] 67GIAQEU Handle named remotes in pijul remote and remote delete
  • [32] 3FNRS6MW Refactor log command's handling of repo and channel
  • [33] K34KD3FT Refactor fork command's handling of repo and channel
  • [34] U45JUYYG Refactor change command's handling of repo and channel
  • [35] Z4PPQZUG Refactor `pijul-config` to support layered configuration
  • [36] YW6NICQV Migrate codebase to refactored `pijul_config` crate
  • [37] HM6QW3CY Handle missing configurations in `pijul_config`
  • [38] 2ZKE4XMJ Replace `pijul_repository::init_dot_ignore` with `pijul_config::Config::dot_ignore_contents`
  • [39] OWO4EWK7 Add global `--config` argument to override configuration values
  • [40] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [41] KKNMDXAI Tweak identity subcommand
  • [42] X243Z3Y5 Recording only the required metadata (can even be changed later!)
  • [43] OQQ4TGEM Printing modifications only once in pijul diff
  • [44] QQS7LII4 Add value hints to arguments
  • [45] I24UEJQL Various post-fire fixes
  • [46] Y7YAFMFF Fix path prefix striping on Windows.
  • [47] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [48] 6YOM7WMH Refactor credit command's handling of repo and channel
  • [49] ZSFJT4SF Allow remotes to have a different push and pull address
  • [50] KWAGWB73 Adding extra dependencies from the config file
  • [51] GKSVBEUW Refactor Repository constructors to take Option<&Path> instead of Option<PathBuf>
  • [52] CQKIS7KR ♻️ Refactor status command's handling of repo and channel
  • [53] OGJFEWHU Fixing missing dependencies on partial clones
  • [54] FVQYZQFL Create dialoguer themes based on global config
  • [55] LYTVEPH3 Avoid cloning into an existing path
  • [56] HGJETVAN Create `pijul_config::global_config_directory()`
  • [57] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [58] JN34NIMJ More specific error for unrecognized subcommands

Change contents

  • replacement in pijul-config/src/lib.rs at line 21
    [35.4643][38.448:463]()
    use log::warn;
    [35.4643]
    [3.976]
    use log::{info, warn};
  • replacement in pijul-config/src/lib.rs at line 70
    [39.17][39.17:49]()
    repository_path: &Path,
    [39.17]
    [39.49]
    repository_path: Option<&Path>,
  • edit in pijul-config/src/lib.rs at line 73
    [39.137][35.5671:5741](),[35.5671][35.5671:5741](),[35.5903][35.5903:5904]()
    let local_config_path = Local::config_file(&repository_path);
  • replacement in pijul-config/src/lib.rs at line 114
    [38.695][37.700:1083](),[37.700][37.700:1083]()
    let local_config = match Local::read_contents(&local_config_path) {
    Ok(contents) => {
    // Parse the config (and make sure it's valid!)
    let local_config = Local::parse_contents(&local_config_path, &contents)?;
    // Add the configuration layer as a string
    layers = layers.merge(Toml::string(&contents));
    [38.695]
    [37.1083]
    let local_config = match repository_path {
    Some(repository_path) => match Local::read_contents(&repository_path) {
    Ok(contents) => {
    // Parse the config (and make sure it's valid!)
    let local_config = Local::parse_contents(&repository_path, &contents)?;
    // Add the configuration layer as a string
    layers = layers.merge(Toml::string(&contents));
  • replacement in pijul-config/src/lib.rs at line 122
    [37.1084][37.1084:1232]()
    Some(local_config)
    }
    Err(error) => {
    warn!("Unable to read local config file: {error:#?}");
    [37.1084]
    [37.1232]
    Some(local_config)
    }
    Err(error) => {
    warn!("Unable to read global config file: {error:#?}");
    None
    }
    },
    None => {
    info!(
    "Skipping local configuration path - repository path was not supplied by caller"
    );
  • replacement in pijul/src/main.rs at line 221
    [2.88414][36.8020:8072](),[36.8072][39.850:913]()
    let repository_path = std::env::current_dir()?;
    let config = Config::load(&repository_path, opts.config)?;
    [2.88414]
    [36.8122]
    let repository_path = match &opts.subcmd {
    SubCommand::Log(log) => log.repository_path(),
    SubCommand::Init(init) => init.repository_path(),
    SubCommand::Clone(clone) => clone.repository_path(),
    SubCommand::Record(record) => record.repository_path(),
    SubCommand::Diff(diff) => diff.repository_path(),
    SubCommand::Status(status) => status.repository_path(),
    SubCommand::Push(push) => push.repository_path(),
    SubCommand::Pull(pull) => pull.repository_path(),
    SubCommand::Change(change) => change.repository_path(),
    SubCommand::Dependents(deps) => deps.repository_path(),
    SubCommand::Channel(channel) => channel.repository_path(),
    SubCommand::Protocol(protocol) => protocol.repository_path(),
    #[cfg(feature = "git")]
    SubCommand::Git(git) => git.repository_path(),
    SubCommand::Move(move_cmd) => move_cmd.repository_path(),
    SubCommand::List(list) => list.repository_path(),
    SubCommand::Add(add) => add.repository_path(),
    SubCommand::Remove(remove) => remove.repository_path(),
    SubCommand::Reset(reset) => reset.repository_path(),
    SubCommand::Debug(debug) => debug.repository_path(),
    SubCommand::Fork(fork) => fork.repository_path(),
    SubCommand::Unrecord(unrecord) => unrecord.repository_path(),
    SubCommand::Apply(apply) => apply.repository_path(),
    SubCommand::Remote(remote) => remote.repository_path(),
    SubCommand::Archive(archive) => archive.repository_path(),
    SubCommand::Credit(credit) => credit.repository_path(),
    SubCommand::Tag(tag) => tag.repository_path(),
    SubCommand::Identity(identity) => identity.repository_path(),
    SubCommand::Client(client) => client.repository_path(),
    SubCommand::ExternalSubcommand(_) | SubCommand::Completion(_) => None,
    };
    let config = Config::load(repository_path, opts.config)?;
  • edit in pijul/src/commands/unrecord.rs at line 11
    [25.956]
    [2.95785]
    use std::path::Path;
  • edit in pijul/src/commands/unrecord.rs at line 33
    [2.96125]
    [36.9124]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/tag.rs at line 2
    [12.95]
    [12.149]
    use std::path::Path;
  • edit in pijul/src/commands/tag.rs at line 77
    [12.1480]
    [36.9575]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/status.rs at line 5
    [30.74][29.221:245](),[29.221][29.221:245]()
    use std::path::PathBuf;
    [30.74]
    [29.245]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/status.rs at line 27
    [29.1186]
    [36.9988]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/reset.rs at line 2
    [7.42][3.1289:1313](),[19.43][3.1289:1313](),[9.223][3.1289:1313](),[6.588][3.1289:1313](),[2.97650][3.1289:1313]()
    use std::path::PathBuf;
    [19.43]
    [3.1313]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/reset.rs at line 35
    [2.98112]
    [36.10098]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/record.rs at line 2
    [3.1453][5.0:24]()
    use std::path::PathBuf;
    [3.1453]
    [13.4998]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/record.rs at line 63
    [2.102774]
    [36.10263]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/pushpull.rs at line 4
    [31.444]
    [28.1582]
    use std::path::Path;
  • edit in pijul/src/commands/pushpull.rs at line 186
    [2.112203]
    [36.11149]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/pushpull.rs at line 509
    [16.20067]
    [36.12630]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/pushpull.rs at line 696
    [16.21779]
    [16.21779]
    }
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
  • replacement in pijul/src/commands/protocol.rs at line 4
    [3.1889][3.1889:1913]()
    use std::path::PathBuf;
    [3.1889]
    [28.1704]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/protocol.rs at line 51
    [2.124762]
    [14.1476]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/log.rs at line 60
    [18.245][32.187:252]()
    let repo = Repository::find_root(cmd.base.repo_path())?;
    [18.245]
    [18.354]
    let repo = Repository::find_root(cmd.repository_path())?;
  • edit in pijul/src/commands/log.rs at line 498
    [17.14053]
    [18.3783]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/init.rs at line 1
    [2.136543][3.2160:2184]()
    use std::path::PathBuf;
    [2.136543]
    [3.2184]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/init.rs at line 24
    [2.136770]
    [36.13206]
    pub fn repository_path(&self) -> Option<&Path> {
    None
    }
  • edit in pijul/src/commands/identity.rs at line 1
    [20.40825]
    [26.2035]
    use crate::commands::common_opts::RepoPath;
  • edit in pijul/src/commands/identity.rs at line 8
    [21.16901]
    [20.40973]
    use std::path::Path;
  • replacement in pijul/src/commands/identity.rs at line 184
    [20.47007][20.47007:47039]()
    #[derive(Clone, Parser, Debug)]
    [20.47007]
    [20.47039]
    #[derive(Parser, Debug)]
  • edit in pijul/src/commands/identity.rs at line 188
    [20.47116]
    [20.47116]
    #[clap(flatten)]
    repository_path: RepoPath,
  • edit in pijul/src/commands/identity.rs at line 242
    [20.48506]
    [36.13582]
    pub fn repository_path(&self) -> Option<&Path> {
    self.repository_path.repo_path()
    }
  • edit in pijul/src/commands/git.rs at line 45
    [2.138045]
    [15.0]
    pub fn repository_path(&self) -> Option<&Path> {
    self.pijul_path.as_deref()
    }
  • edit in pijul/src/commands/fork.rs at line 1
    [2.167873]
    [33.0]
    use std::path::Path;
  • edit in pijul/src/commands/fork.rs at line 28
    [2.168309]
    [14.1874]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/file_operations.rs at line 28
    [10.109]
    [14.1927]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/file_operations.rs at line 102
    [11.101]
    [14.1984]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/file_operations.rs at line 141
    [2.171335]
    [14.2037]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/file_operations.rs at line 228
    [2.172614]
    [14.2090]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/diff.rs at line 3
    [27.34][2.173714:173738](),[2.173714][2.173714:173738]()
    use std::path::PathBuf;
    [27.34]
    [3.2553]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/diff.rs at line 42
    [2.174051]
    [36.14844]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/dependents.rs at line 4
    [24.1705]
    [22.323]
    use std::path::Path;
  • edit in pijul/src/commands/dependents.rs at line 20
    [22.707]
    [22.707]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/debug.rs at line 7
    [25.1966]
    [2.177836]
    use std::path::Path;
  • edit in pijul/src/commands/debug.rs at line 19
    [2.178019]
    [14.2200]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/credit.rs at line 2
    [3.2786][3.2786:2810]()
    use std::path::PathBuf;
    [3.2786]
    [3.2810]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/credit.rs at line 25
    [2.179133]
    [36.15340]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/clone.rs at line 1
    [6.1892][3.2900:2924](),[4.2317][3.2900:2924](),[2.182891][3.2900:2924]()
    use std::path::PathBuf;
    [2.182891]
    [3.2924]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/clone.rs at line 37
    [2.183813]
    [36.15455]
    pub fn repository_path(&self) -> Option<&Path> {
    None
    }
  • edit in pijul/src/commands/client.rs at line 7
    [23.4644]
    [23.4773]
    use std::path::Path;
  • edit in pijul/src/commands/client.rs at line 19
    [23.4974]
    [23.4974]
    pub fn repository_path(&self) -> Option<&Path> {
    None
    }
  • edit in pijul/src/commands/channel.rs at line 2
    [2.186989]
    [2.187013]
    use std::path::Path;
  • edit in pijul/src/commands/channel.rs at line 56
    [2.187383]
    [14.2361]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/change.rs at line 1
    [2.189306]
    [34.0]
    use std::path::Path;
  • edit in pijul/src/commands/change.rs at line 22
    [2.189681]
    [36.15782]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • edit in pijul/src/commands/archive.rs at line 5
    [3.3268]
    [2.191246]
    use std::path::Path;
  • edit in pijul/src/commands/archive.rs at line 41
    [2.191803]
    [36.15921]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }
  • replacement in pijul/src/commands/apply.rs at line 1
    [8.552][3.3337:3361](),[3.3337][3.3337:3361]()
    use std::path::PathBuf;
    [2.194289]
    [3.3361]
    use std::path::{Path, PathBuf};
  • edit in pijul/src/commands/apply.rs at line 27
    [2.194761]
    [14.2496]
    pub fn repository_path(&self) -> Option<&Path> {
    self.base.repo_path()
    }