✨ Add current channel to pijul status output

berkus
Jun 22, 2025, 4:41 PM
YQJRT2UBNF2ILSJZQZUZ73J2HOTMARVEEHXEUN5BDXVD7MVBAFPQC

Dependencies

  • [2] IBLJI7IA ✨ Add `pijul status` subcommand

Change contents

  • edit in pijul/src/commands/status.rs at line 2
    [2.221]
    [2.221]
    use libpijul::TxnT;
    use pijul_repository::Repository;
    use std::io::Write;
  • edit in pijul/src/commands/status.rs at line 30
    [2.1238]
    [2.1238]
    let repo = Repository::find_root(self.repo_path.clone())?;
    let txn = repo.pristine.txn_begin()?;
    let mut stdout = std::io::stdout();
    let current = txn.current_channel().ok();
    writeln!(
    stdout,
    "{}",
    current.map_or_else(|| "Not on a channel".into(), |c| format!("On channel: {c}"))
    )?;
  • edit in pijul/src/commands/status.rs at line 52
    [2.1584]
    [2.1584]