Allow remotes to have a different push and pull address
Dependencies
- [2]
A3RM526YIntegrating identity malleability - [3]
IUGP6ZGBAdd support for ~/.config/pijul even on macos - [4]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [5]
5OGOE4VWStore the current channel in the pristine - [6]
KWAGWB73Adding extra dependencies from the config file - [7]
EEBKW7VTKeys and identities - [8]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [9]
76PCXGMLPushing to, and pulling from the local repository - [10]
SEWGHUHQ.pijul/config: simplify remotes and hooks - [*]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [*]
5BB266P6Optional colours in the global config file - [*]
2D7P2VKJChange completions (where the whole progress bar story started)
Change contents
- edit in pijul/src/remote/mod.rs at line 15
use crate::config::*; - edit in pijul/src/remote/mod.rs at line 43
direction: Direction, - replacement in pijul/src/remote/mod.rs at line 48
unknown_remote(self_path, name, channel, no_cert_check, with_path).awaitunknown_remote(self_path,name.with_dir(direction),channel,no_cert_check,with_path,).await - replacement in pijul/src/config.rs at line 97
#[derive(Debug, Serialize, Deserialize, Default)]#[derive(Debug, Deserialize, Default)] - replacement in pijul/src/config.rs at line 103
pub remotes: HashMap<String, String>,pub remotes: HashMap<String, RemoteName>, - edit in pijul/src/config.rs at line 108
}#[derive(Debug)]pub enum RemoteName {Name(String),Split(SplitRemote),}#[derive(Clone, Copy, Debug)]pub enum Direction {Push,Pull,}impl RemoteName {pub fn with_dir(&self, d: Direction) -> &str {match (self, d) {(RemoteName::Name(ref s), _) => s,(RemoteName::Split(ref s), Direction::Pull) => &s.pull,(RemoteName::Split(ref s), Direction::Push) => &s.push,}}}use serde::de::{self, MapAccess, Visitor};use serde::de::{Deserialize, Deserializer};use std::fmt;use std::marker::PhantomData;impl<'de> Deserialize<'de> for RemoteName {fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>whereD: Deserializer<'de>,{struct StringOrStruct(PhantomData<fn() -> RemoteName>);impl<'de> Visitor<'de> for StringOrStruct {type Value = RemoteName;fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {formatter.write_str("string or map")}fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>whereE: de::Error,{Ok(RemoteName::Name(value.to_string()))}fn visit_map<M>(self, map: M) -> Result<Self::Value, M::Error>whereM: MapAccess<'de>,{// `MapAccessDeserializer` is a wrapper that turns a `MapAccess`// into a `Deserializer`, allowing it to be used as the input to T's// `Deserialize` implementation. T then deserializes itself using// the entries from the map visitor.Ok(RemoteName::Split(Deserialize::deserialize(de::value::MapAccessDeserializer::new(map),)?))}}deserializer.deserialize_any(StringOrStruct(PhantomData))} - edit in pijul/src/config.rs at line 174
#[derive(Debug, Deserialize)]pub struct SplitRemote {pub pull: String,pub push: String,} - edit in pijul/src/commands/pushpull.rs at line 15[12.1761][14.4774]
use crate::config::Direction; - edit in pijul/src/commands/pushpull.rs at line 212
Direction::Push, - edit in pijul/src/commands/pushpull.rs at line 376
Direction::Pull, - replacement in pijul/src/commands/key.rs at line 95
.remote(None, &remote, crate::DEFAULT_CHANNEL, no_cert_check, false).remote(None,&remote,crate::DEFAULT_CHANNEL,Direction::Pull,no_cert_check,false,)