Skip to content

Commit dc7908f

Browse files
committed
[clone] update README, improve delegate docs
1 parent 0907771 commit dc7908f

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,19 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
100100
* [ ] API documentation with examples
101101

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

116118
### git-packetline

git-protocol/src/fetch/delegate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub enum Action {
1313

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

27-
/// Called before invoking the 'fetch' interaction, with `arguments` and `features` pre-filled for typical use.
27+
/// Called before invoking the 'fetch' interaction, with `features` pre-filled for typical use
28+
/// and to maximize capabilities.
2829
/// `refs` is a list of known references on the remote, based on the handshake or a prior call to ls_refs.
2930
/// As there will be another call allowing to post arguments conveniently in the correct format, i.e. `want hex-oid`,
3031
/// there is no way to set arguments at this time.

git-protocol/src/fetch/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ pub fn fetch<F: FnMut(credentials::Action) -> credentials::Result>(
129129
transport.close()?;
130130
return Ok(());
131131
}
132+
let mut _fetch_arguments = Command::Fetch.initial_arguments(&fetch_features);
133+
// TODO: negotiation rounds till pack file is received or someone aborts.
132134

133135
transport.close()?;
134136
unimplemented!("rest of fetch or clone")

git-transport/src/client/capabilities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ quick_error! {
2929
}
3030
}
3131

32-
#[derive(Clone)]
32+
#[derive(Debug, Clone)]
3333
pub struct Capabilities {
3434
data: BString,
3535
value_sep: u8,

0 commit comments

Comments
 (0)