Skip to content

Commit 879af67

Browse files
committed
[clone] move packet-line code into own crate
This is when I learned that there is also a long-running processes format that uses packet-line to communicate. Thus it doesn't belong in transport anymore, which was the previous 'best fit'. Since it's a serialization format, setting up its own crate makes quite some sense.
1 parent bba0a47 commit 879af67

File tree

27 files changed

+81
-49
lines changed

27 files changed

+81
-49
lines changed

Cargo.lock

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,6 @@ members = [
9191
"git-protocol",
9292
"git-url",
9393
"git-transport",
94+
"git-packetline",
9495
"git-tui",
9596
]

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ check: ## Build all code in suitable configurations
8383
cd git-object && cargo check --all-features
8484
cd git-odb && cargo check --all-features \
8585
&& cargo check
86+
cd git-packetline && cargo check --all-features \
87+
&& cargo check
8688
cd git-protocol && cargo check --all-features \
8789
&& cargo check
8890
cd git-url && cargo check --all-features \

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
142142
* [x] initialize
143143
* [ ] Proper configuration depending on platform (e.g. ignorecase, filemode, …)
144144
* [ ] [Signed commits and tags](https://github.com/Byron/gitoxide/issues/12)
145+
* [ ] sparse checkout support
146+
* [ ] .gitignore handling
147+
* [ ] checkout/stage conversions clean + smudge as in .gitattributes
145148
* [ ] read and write all data types
146149
* [ ] rev-parsing and ref history
147150
* [ ] remotes with push and pull

etc/check-package-size.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ indent cargo diet -n --package-size-limit 25KB
2222
(enter git-object && indent cargo diet -n --package-size-limit 15KB)
2323
(enter git-odb && indent cargo diet -n --package-size-limit 50KB)
2424
(enter git-protocol && indent cargo diet -n --package-size-limit 5KB)
25+
(enter git-packetline && indent cargo diet -n --package-size-limit 7KB)
2526
(enter git-repository && indent cargo diet -n --package-size-limit 10KB)
26-
(enter git-transport && indent cargo diet -n --package-size-limit 10KB)
27+
(enter git-transport && indent cargo diet -n --package-size-limit 5KB)
2728
(enter gitoxide-core && indent cargo diet -n --package-size-limit 10KB)

etc/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -eu -o pipefail
44

55
./etc/check-package-size.sh
66

7-
for crate in git-features git-ref git-object git-odb git-repository gitoxide-core .; do
7+
for crate in git-features git-ref git-object git-odb git-packetline git-transport git-protocol git-repository gitoxide-core .; do
88
(cd $crate && cargo release "$@")
99
done

git-packetline/Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[package]
2+
name = "git-packetline"
3+
version = "0.1.0"
4+
repository = "https://github.com/Byron/git-oxide"
5+
license = "MIT/Apache-2.0"
6+
description = "A WIP crate of the gitoxide project implementing the pkt-line serialization format"
7+
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
8+
edition = "2018"
9+
include = ["src/**/*"]
10+
11+
[lib]
12+
doctest = false
13+
14+
[features]
15+
serde1 = ["serde", "bstr/serde1"]
16+
17+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
18+
19+
[dependencies]
20+
git-features = { version = "^0.3.0", path = "../git-features" }
21+
serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"]}
22+
quick-error = "2.0.0"
23+
hex = "0.4.2"
24+
bstr = { version = "0.2.13", default-features = false, features = ["std"] }
25+
26+
[dev-dependencies]
27+
git-odb = { version = "0.3.0", path = "../git-odb" }

git-transport/src/packet_line/borrowed.rs renamed to git-packetline/src/borrowed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::packet_line::{encode, Channel};
1+
use crate::{encode, Channel};
22
use bstr::BStr;
33
use std::io;
44

git-transport/src/packet_line/decode.rs renamed to git-packetline/src/decode.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use crate::{
2-
packet_line::{
3-
DELIMITER_LINE, ERR_PREFIX, FLUSH_LINE, MAX_DATA_LEN, MAX_LINE_LEN, RESPONSE_END_LINE, U16_HEX_BYTES,
4-
},
5-
PacketLine,
2+
PacketLine, {DELIMITER_LINE, ERR_PREFIX, FLUSH_LINE, MAX_DATA_LEN, MAX_LINE_LEN, RESPONSE_END_LINE, U16_HEX_BYTES},
63
};
74
use bstr::BString;
85
use quick_error::quick_error;

git-transport/src/packet_line/encode.rs renamed to git-packetline/src/encode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::packet_line::{Channel, DELIMITER_LINE, ERR_PREFIX, FLUSH_LINE, MAX_DATA_LEN, RESPONSE_END_LINE};
1+
use crate::{Channel, DELIMITER_LINE, ERR_PREFIX, FLUSH_LINE, MAX_DATA_LEN, RESPONSE_END_LINE};
22
use quick_error::quick_error;
33
use std::io;
44

0 commit comments

Comments
 (0)