Skip to content

Commit

Permalink
Less ambiguous name for 'index-from-pack': 'pack-index-from-data'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 16, 2020
1 parent c9e62c5 commit 386673c
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/src/packet_line/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where
}
}

pub fn to_read_with_sidebands<P: Progress>(&mut self, progress: P) -> ToRead<T, P> {
pub fn as_read_with_sidebands<P: Progress>(&mut self, progress: P) -> ToRead<T, P> {
ToRead::new(self, progress)
}
}
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/tests/packet_line/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion performance-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/lean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
///
Expand Down
6 changes: 3 additions & 3 deletions src/plumbing/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions tests/stateless-journey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand All @@ -97,15 +97,15 @@ 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
(with "--format json and the very same output directory"
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
Expand Down

0 comments on commit 386673c

Please sign in to comment.