Skip to content

Commit

Permalink
rename verify-pack to pack-verify (keeping it more formal)
Browse files Browse the repository at this point in the history
'Formal' in the sense that this creates a hierarchy of nouns on which to
perform an action, sorting things alphabetically will work better that
way and it will help eventual command-line completions.
  • Loading branch information
Byron committed Jul 25, 2020
1 parent d3c00c8 commit ec8c48a
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ $(linux_repo):

stress: ## Run various algorithms on big repositories
$(MAKE) -j3 $(linux_repo) $(rust_repo) release-lean
time ./target/release/gixp verify-pack --verbose --statistics $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp verify-pack --verbose --algorithm less-memory $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp verify-pack --verbose --re-encode $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp verify-pack --verbose --re-encode $(linux_repo)/objects/pack/*.idx
time ./target/release/gixp pack-verify --verbose --statistics $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp pack-verify --verbose --algorithm less-memory $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp pack-verify --verbose --re-encode $(rust_repo)/.git/objects/pack/*.idx
time ./target/release/gixp pack-verify --verbose --re-encode $(linux_repo)/objects/pack/*.idx

##@ Maintenance

Expand Down
2 changes: 1 addition & 1 deletion git-odb/tests/pack/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mod method {
}
}

/// All hardcoded offsets are obtained via `git verify-pack --verbose tests/fixtures/packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.idx`
/// All hardcoded offsets are obtained via `git pack-verify --verbose tests/fixtures/packs/pack-a2bf8e71d8c18879e499335762dd95119d93d9f1.idx`
mod decode_entry {
use crate::{fixture_path, fixup, pack::file::pack_at, pack::SMALL_PACK};
use bstr::ByteSlice;
Expand Down
10 changes: 5 additions & 5 deletions src/plumbing/lean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ mod options {
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
pub enum SubCommands {
VerifyPack(VerifyPack),
PackVerify(PackVerify),
}

/// Initialize the repository in the current directory.
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "verify-pack")]
pub struct VerifyPack {
#[argh(subcommand, name = "pack-verify")]
pub struct PackVerify {
#[argh(switch)]
/// decode and parse tags, commits and trees to validate their correctness beyond hashing correctly.
///
Expand Down Expand Up @@ -100,15 +100,15 @@ pub fn main() -> Result<()> {
let cli: Args = crate::shared::from_env();
let thread_limit = cli.threads;
match cli.subcommand {
SubCommands::VerifyPack(VerifyPack {
SubCommands::PackVerify(PackVerify {
path,
verbose,
statistics,
algorithm,
decode,
re_encode,
}) => {
let (_handle, progress) = prepare(verbose, "verify-pack");
let (_handle, progress) = prepare(verbose, "pack-verify");
core::verify::pack_or_pack_index(
path,
progress,
Expand Down
6 changes: 3 additions & 3 deletions src/plumbing/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mod options {
pub enum Subcommands {
/// Verify the integrity of a pack or index file
#[structopt(setting = AppSettings::ColoredHelp)]
VerifyPack {
PackVerify {
/// output statistical information about the pack
#[structopt(long, short = "s")]
statistics: bool,
Expand Down Expand Up @@ -180,7 +180,7 @@ pub fn main() -> Result<()> {
let args = Args::from_args();
let thread_limit = args.threads;
match args.cmd {
Subcommands::VerifyPack {
Subcommands::PackVerify {
path,
algorithm,
verbose,
Expand All @@ -191,7 +191,7 @@ pub fn main() -> Result<()> {
progress_keep_open,
statistics,
} => prepare_and_run(
"verify-pack",
"pack-verify",
verbose,
progress,
progress_keep_open,
Expand Down
2 changes: 1 addition & 1 deletion tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* [x] The Rust repo verifies `--decode` and `--re-encode`
* [x] add re-encode to all stress tests
* [x] support easy access to merge-tags and the signature
* **stream pack for verify-pack**
* **stream pack for pack-verify**
* [x] support for multi-threading
* [x] choice of algorithm in pack-verify
* [x] use pack streaming in pack-verify by default
Expand Down
30 changes: 15 additions & 15 deletions tests/stateless-journey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,45 @@ title "CLI ${kind}"
)
)

(when "running 'plumbing verify-pack"
(when "running 'plumbing pack-verify"
(with "a valid pack file"
PACK_FILE="$fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack"
it "verifies the pack successfully and with desired output" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack "$PACK_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-verify "$PACK_FILE"
}
)
(with "a valid pack INDEX file"
PACK_INDEX_FILE="$fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.idx"
(with "no statistics"
it "verifies the pack index successfully and with desired output" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack "$PACK_INDEX_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-verify "$PACK_INDEX_FILE"
}
)
(with "statistics"
it "verifies the pack index successfully and with desired output" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-with-statistics-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack --statistics "$PACK_INDEX_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-with-statistics-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-verify --statistics "$PACK_INDEX_FILE"
}
)
(with "decode"
it "verifies the pack index successfully and with desired output, and decodes all objects" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack --algorithm less-memory --decode "$PACK_INDEX_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-verify --algorithm less-memory --decode "$PACK_INDEX_FILE"
}
)
(with "re-encode"
it "verifies the pack index successfully and with desired output, and re-encodes all objects" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack --algorithm less-time --re-encode "$PACK_INDEX_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-verify --algorithm less-time --re-encode "$PACK_INDEX_FILE"
}
)
if test "$kind" = "max"; then
(with "statistics (JSON)"
it "verifies the pack index successfully and with desired output" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-with-statistics-json-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" --threads 1 verify-pack --statistics --format json "$PACK_INDEX_FILE"
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-with-statistics-json-success" \
expect_run $SUCCESSFULLY "$exe_plumbing" --threads 1 pack-verify --statistics --format json "$PACK_INDEX_FILE"
}
)
fi
Expand All @@ -89,8 +89,8 @@ title "CLI ${kind}"
cp $PACK_INDEX_FILE index.idx
echo $'\0' >> index.idx
it "fails to verify the pack index and with desired output" && {
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-failure" \
expect_run $WITH_FAILURE "$exe_plumbing" verify-pack index.idx
WITH_SNAPSHOT="$snapshot/plumbing-pack-verify-index-failure" \
expect_run $WITH_FAILURE "$exe_plumbing" pack-verify index.idx
}
)
)
Expand Down

0 comments on commit ec8c48a

Please sign in to comment.