Skip to content

Commit

Permalink
[clone] update README, improve delegate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 3, 2020
1 parent 0907771 commit dc7908f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,19 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
* [ ] API documentation with examples

### git-protocol
* _abstract over protocol versions to allow delegates to deal only with a single way of doing things_
* [x] **credentials**
* [x] via git-credentials
* [ ] via pure Rust implementation if no git is installed
* [ ] fetch & clone
* [x] control credentials provider to fill, approve and reject
* [x] ls-ref
* [x] command: ls-ref
* [x] parse V1 refs as provided during handshake
* [x] parse V2 refs
* [x] initialize and validate command arguments and features sanely
* [x] abort early for ls-remote capabilities
* [ ] packfile negotiation
* [ ] push
* [ ] shallow clones
* [ ] API documentation with examples

### git-packetline
Expand Down
5 changes: 3 additions & 2 deletions git-protocol/src/fetch/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum Action {

pub trait Delegate {
/// Called before invoking ls-refs to allow providing it with additional `arguments` and to enable `features`.
/// Note that some arguments are preset based on typical usage.
/// Note that some arguments are preset based on typical use, and `features` are preset to maximize options.
/// The `server` capabilities can be used to see which additional capabilities the server supports as per the handshake.
/// Note that this is called only if we are using protocol version 2.
fn prepare_ls_refs(
Expand All @@ -24,7 +24,8 @@ pub trait Delegate {
) {
}

/// Called before invoking the 'fetch' interaction, with `arguments` and `features` pre-filled for typical use.
/// Called before invoking the 'fetch' interaction, with `features` pre-filled for typical use
/// and to maximize capabilities.
/// `refs` is a list of known references on the remote, based on the handshake or a prior call to ls_refs.
/// As there will be another call allowing to post arguments conveniently in the correct format, i.e. `want hex-oid`,
/// there is no way to set arguments at this time.
Expand Down
2 changes: 2 additions & 0 deletions git-protocol/src/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ pub fn fetch<F: FnMut(credentials::Action) -> credentials::Result>(
transport.close()?;
return Ok(());
}
let mut _fetch_arguments = Command::Fetch.initial_arguments(&fetch_features);
// TODO: negotiation rounds till pack file is received or someone aborts.

transport.close()?;
unimplemented!("rest of fetch or clone")
Expand Down
2 changes: 1 addition & 1 deletion git-transport/src/client/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ quick_error! {
}
}

#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct Capabilities {
data: BString,
value_sep: u8,
Expand Down

0 comments on commit dc7908f

Please sign in to comment.