From 386673ccc99d18d023c7df3fcd40e86d71960b25 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 16 Aug 2020 10:29:59 +0800 Subject: [PATCH] Less ambiguous name for 'index-from-pack': 'pack-index-from-data' --- CHANGELOG.md | 2 +- Makefile | 2 +- git-protocol/src/packet_line/read.rs | 2 +- git-protocol/tests/packet_line/read.rs | 2 +- performance-tasks.md | 2 +- src/plumbing/lean.rs | 2 +- src/plumbing/pretty.rs | 6 +++--- .../no-output-dir-as-json-success | 0 .../no-output-dir-success | 0 .../output-dir-content | 0 .../output-dir-restore-as-json-success | 0 .../output-dir-restore-success | 0 .../output-dir-success | 0 tests/stateless-journey.sh | 16 ++++++++-------- 14 files changed, 17 insertions(+), 17 deletions(-) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/no-output-dir-as-json-success (100%) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/no-output-dir-success (100%) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/output-dir-content (100%) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/output-dir-restore-as-json-success (100%) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/output-dir-restore-success (100%) rename tests/snapshots/plumbing/{index-from-pack => pack-index-from-data}/output-dir-success (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93daae6d9c6..ab5010770e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ### v0.3 -* add `pack-explode` and `index-from-pack` sub-commands +* add `pack-explode` and `pack-index-from-data` sub-commands * massive speed improvements for `pack-verify` Many small and possibly breaking changes are not mentioned here. diff --git a/Makefile b/Makefile index 082f0a8fee9..bf8ff558f57 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ $(linux_repo): stress: ## Run various algorithms on big repositories $(MAKE) -j3 $(linux_repo) $(rust_repo) release-lean time ./target/release/gixp --verbose pack-verify --re-encode $(linux_repo)/objects/pack/*.idx - mkdir out && time ./target/release/gixp --verbose index-from-pack -p $(linux_repo)/objects/pack/*.pack out/ + mkdir out && time ./target/release/gixp --verbose pack-index-from-data -p $(linux_repo)/objects/pack/*.pack out/ time ./target/release/gixp --verbose pack-verify out/*.idx time ./target/release/gixp --verbose pack-verify --statistics $(rust_repo)/objects/pack/*.idx diff --git a/git-protocol/src/packet_line/read.rs b/git-protocol/src/packet_line/read.rs index 6ce5f5deacc..64db6d0a1a3 100644 --- a/git-protocol/src/packet_line/read.rs +++ b/git-protocol/src/packet_line/read.rs @@ -68,7 +68,7 @@ where } } - pub fn to_read_with_sidebands(&mut self, progress: P) -> ToRead { + pub fn as_read_with_sidebands(&mut self, progress: P) -> ToRead { ToRead::new(self, progress) } } diff --git a/git-protocol/tests/packet_line/read.rs b/git-protocol/tests/packet_line/read.rs index 51adee08573..25aa703b209 100644 --- a/git-protocol/tests/packet_line/read.rs +++ b/git-protocol/tests/packet_line/read.rs @@ -22,7 +22,7 @@ mod to_read { assert_eq!(exhaust(&mut rd), 2); rd.reset(); assert_eq!(rd.read_line()??.to_text().0.as_bstr(), b"NAK".as_bstr()); - let pack_read = rd.to_read_with_sidebands(git_features::progress::Discard); + let pack_read = rd.as_read_with_sidebands(git_features::progress::Discard); let pack_entries = pack::data::Iter::new_from_header( pack_read, pack::data::iter::Mode::Verify, diff --git a/performance-tasks.md b/performance-tasks.md index fde49e4d456..32da42dae14 100644 --- a/performance-tasks.md +++ b/performance-tasks.md @@ -11,7 +11,7 @@ that could be used for the improved cache. With the current cache and no sorted offsets, the time nearly triples. * [ ] _progress measuring costs when using 96 cores_ (see [this comment][josh-aug-12]) * potential savings: low -* [ ] Add '--chunk|batch-size' flag to `pack-verify` and `index-from-pack` to allow tuning sizes for large amounts of cores +* [ ] Add '--chunk|batch-size' flag to `pack-verify` and `pack-index-from-data` to allow tuning sizes for large amounts of cores * @joshtriplett write: "I did find that algorithm when I was looking for the chunk size, though I didn't dig into the details. As a quick hack, I tried dropping the upper number from 1000 to 250, which made no apparent difference in performance." * potential savings: ~~medium~~ unclear * [ ] On 96 core machines, it takes visible time until all threads are started and have work. Is it because starting 100 threads takes so long? Or is it contention to get work? diff --git a/src/plumbing/lean.rs b/src/plumbing/lean.rs index 6da42c4709b..152f378743a 100644 --- a/src/plumbing/lean.rs +++ b/src/plumbing/lean.rs @@ -36,7 +36,7 @@ mod options { /// /// This command can also be used to stream packs to standard input or to repair partial packs. #[derive(FromArgs, PartialEq, Debug)] - #[argh(subcommand, name = "index-from-pack")] + #[argh(subcommand, name = "pack-index-from-data")] pub struct IndexFromPack { /// specify how to iterate the pack, defaults to 'verify' /// diff --git a/src/plumbing/pretty.rs b/src/plumbing/pretty.rs index b7a2b525caa..0c095742bdc 100644 --- a/src/plumbing/pretty.rs +++ b/src/plumbing/pretty.rs @@ -56,7 +56,7 @@ mod options { /// This command can also be used to stream packs to standard input or to repair partial packs. #[clap(setting = AppSettings::ColoredHelp)] #[clap(setting = AppSettings::DisableVersion)] - IndexFromPack { + PackIndexFromData { /// Specify how to iterate the pack, defaults to 'verify' /// /// Valid values are @@ -280,12 +280,12 @@ pub fn main() -> Result<()> { git_features::interrupt::init_handler(std::io::stderr()); match cmd { - Subcommands::IndexFromPack { + Subcommands::PackIndexFromData { iteration_mode, pack_path, directory, } => prepare_and_run( - "index-from-pack", + "pack-index-from-data", verbose, progress, progress_keep_open, diff --git a/tests/snapshots/plumbing/index-from-pack/no-output-dir-as-json-success b/tests/snapshots/plumbing/pack-index-from-data/no-output-dir-as-json-success similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/no-output-dir-as-json-success rename to tests/snapshots/plumbing/pack-index-from-data/no-output-dir-as-json-success diff --git a/tests/snapshots/plumbing/index-from-pack/no-output-dir-success b/tests/snapshots/plumbing/pack-index-from-data/no-output-dir-success similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/no-output-dir-success rename to tests/snapshots/plumbing/pack-index-from-data/no-output-dir-success diff --git a/tests/snapshots/plumbing/index-from-pack/output-dir-content b/tests/snapshots/plumbing/pack-index-from-data/output-dir-content similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/output-dir-content rename to tests/snapshots/plumbing/pack-index-from-data/output-dir-content diff --git a/tests/snapshots/plumbing/index-from-pack/output-dir-restore-as-json-success b/tests/snapshots/plumbing/pack-index-from-data/output-dir-restore-as-json-success similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/output-dir-restore-as-json-success rename to tests/snapshots/plumbing/pack-index-from-data/output-dir-restore-as-json-success diff --git a/tests/snapshots/plumbing/index-from-pack/output-dir-restore-success b/tests/snapshots/plumbing/pack-index-from-data/output-dir-restore-success similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/output-dir-restore-success rename to tests/snapshots/plumbing/pack-index-from-data/output-dir-restore-success diff --git a/tests/snapshots/plumbing/index-from-pack/output-dir-success b/tests/snapshots/plumbing/pack-index-from-data/output-dir-success similarity index 100% rename from tests/snapshots/plumbing/index-from-pack/output-dir-success rename to tests/snapshots/plumbing/pack-index-from-data/output-dir-success diff --git a/tests/stateless-journey.sh b/tests/stateless-journey.sh index 500189860dd..17bb1bb998f 100755 --- a/tests/stateless-journey.sh +++ b/tests/stateless-journey.sh @@ -50,27 +50,27 @@ title "CLI ${kind}" title plumbing snapshot="$snapshot/plumbing" -(when "running 'index-from-pack" - snapshot="$snapshot/index-from-pack" +(when "running 'pack-index-from-data" + snapshot="$snapshot/pack-index-from-data" PACK_FILE="$fixtures/packs/pack-11fdfa9e156ab73caae3b6da867192221f2089c2.pack" (with "a valid and complete pack file" (with "NO output directory specified" (with "pack file passed as file" it "generates an index into a sink and outputs pack and index information" && { WITH_SNAPSHOT="$snapshot/no-output-dir-success" \ - expect_run $SUCCESSFULLY "$exe_plumbing" index-from-pack -p "$PACK_FILE" + expect_run $SUCCESSFULLY "$exe_plumbing" pack-index-from-data -p "$PACK_FILE" } ) (with "pack file passed from stdin" it "generates an index into a sink and outputs pack and index information" && { WITH_SNAPSHOT="$snapshot/no-output-dir-success" \ - expect_run $SUCCESSFULLY "$exe_plumbing" index-from-pack < "$PACK_FILE" + expect_run $SUCCESSFULLY "$exe_plumbing" pack-index-from-data < "$PACK_FILE" } if test "$kind" = "max"; then (with "--format json" it "generates the index into a sink and outputs information as JSON" && { WITH_SNAPSHOT="$snapshot/no-output-dir-as-json-success" \ - expect_run $SUCCESSFULLY "$exe_plumbing" --format json index-from-pack < "$PACK_FILE" + expect_run $SUCCESSFULLY "$exe_plumbing" --format json pack-index-from-data < "$PACK_FILE" } ) fi @@ -80,7 +80,7 @@ snapshot="$snapshot/plumbing" (with "with an output directory specified" it "generates an index and outputs information" && { WITH_SNAPSHOT="$snapshot/output-dir-success" \ - expect_run $SUCCESSFULLY "$exe_plumbing" index-from-pack -p "$PACK_FILE" "$PWD" + expect_run $SUCCESSFULLY "$exe_plumbing" pack-index-from-data -p "$PACK_FILE" "$PWD" } it "writes the index and pack into the directory (they have the same names, different suffixes)" && { WITH_SNAPSHOT="$snapshot/output-dir-content" \ @@ -97,7 +97,7 @@ snapshot="$snapshot/plumbing" it "generates an index and outputs information (instead of failing)" && { WITH_SNAPSHOT="$snapshot/output-dir-restore-success" \ - expect_run $SUCCESSFULLY "$exe_plumbing" index-from-pack -i restore -p "$PACK_FILE" "$PWD" + expect_run $SUCCESSFULLY "$exe_plumbing" pack-index-from-data -i restore -p "$PACK_FILE" "$PWD" } if test "$kind" = "max"; then @@ -105,7 +105,7 @@ snapshot="$snapshot/plumbing" it "generates the index, overwriting existing files, and outputs information as JSON" && { WITH_SNAPSHOT="$snapshot/output-dir-restore-as-json-success" \ SNAPSHOT_FILTER=remove-paths \ - expect_run $SUCCESSFULLY "$exe_plumbing" --format json index-from-pack -i restore $PWD < "$PACK_FILE" + expect_run $SUCCESSFULLY "$exe_plumbing" --format json pack-index-from-data -i restore $PWD < "$PACK_FILE" } ) fi