| @@ -51,9 +51,6 @@ pub struct Args { · 50 unmodified lines |
| 51 | | 51 | |
| 52 | #[derive(Debug, clap::Subcommand)] | 52 | #[derive(Debug, clap::Subcommand)] |
| 53 | pub enum Subcommands { | 53 | pub enum Subcommands { |
| 54 | /// Subcommands for interacting with packs and their indices. | | |
| 55 | #[clap(subcommand)] | | |
| 56 | Pack(pack::Subcommands), | | |
| 57 | /// Subcommands for interacting with git remote server. | 54 | /// Subcommands for interacting with git remote server. |
| 58 | #[clap(subcommand)] | 55 | #[clap(subcommand)] |
| 59 | #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] | 56 | #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] |
| @@ -71,277 +68,280 @@ pub enum Subcommands { · 11 unmodified lines |
| 71 | } | 68 | } |
| 72 | | 69 | |
| 73 | /// | 70 | /// |
| 74 | pub mod pack { | 71 | pub mod free { |
| 75 | use std::{ffi::OsString, path::PathBuf}; | | |
| 76 | | | |
| 77 | use gitoxide_core as core; | | |
| 78 | | | |
| 79 | #[derive(Debug, clap::Subcommand)] | 72 | #[derive(Debug, clap::Subcommand)] |
| 80 | pub enum Subcommands { | 73 | pub enum Subcommands { |
| 81 | /// Subcommands for interacting with pack indices (.idx) | 74 | /// Subcommands for interacting with mailmaps |
| | 75 | Mailmap { |
| | 76 | #[clap(flatten)] |
| | 77 | cmd: mailmap::Platform, |
| | 78 | }, |
| | 79 | /// Subcommands for interacting with pack files and indices |
| 82 | #[clap(subcommand)] | 80 | #[clap(subcommand)] |
| 83 | Index(index::Subcommands), | 81 | Pack(pack::Subcommands), |
| 84 | /// Subcommands for interacting with multi-pack indices (named "multi-pack-index") | 82 | } |
| 85 | MultiIndex(multi_index::Platform), | | |
| 86 | /// Create a new pack with a set of objects. | | |
| 87 | Create { | | |
| 88 | #[clap(long, short = 'r')] | | |
| 89 | /// the directory containing the '.git' repository from which objects should be read. | | |
| 90 | repository: Option<PathBuf>, | | |
| 91 | | 83 | |
| 92 | #[clap(long, short = 'e', possible_values(core::pack::create::ObjectExpansion::variants()))] | 84 | /// |
| 93 | /// the way objects are expanded. They differ in costs. | 85 | pub mod pack { |
| 94 | /// | 86 | use std::{ffi::OsString, path::PathBuf}; |
| 95 | /// Possible values are "none" and "tree-traversal". Default is "none". | | |
| 96 | expansion: Option<core::pack::create::ObjectExpansion>, | | |
| 97 | | 87 | |
| 98 | #[clap(long, default_value_t = 3, requires = "nondeterministic-count")] | 88 | use gitoxide_core as core; |
| 99 | /// The amount of threads to use when counting and the `--nondeterminisitc-count` flag is set, defaulting | | |
| 100 | /// to the globally configured threads. | | |
| 101 | /// | | |
| 102 | /// Use it to have different trade-offs between counting performance and cost in terms of CPU, as the scaling | | |
| 103 | /// here is everything but linear. The effectiveness of each core seems to be no more than 30%. | | |
| 104 | counting_threads: usize, | | |
| 105 | | 89 | |
| 106 | #[clap(long)] | 90 | #[derive(Debug, clap::Subcommand)] |
| 107 | /// if set, the counting phase may be accelerated using multithreading. | 91 | pub enum Subcommands { |
| 108 | /// | 92 | /// Subcommands for interacting with pack indices (.idx) |
| 109 | /// On the flip side, however, one will loose deterministic counting results which affects the | 93 | #[clap(subcommand)] |
| 110 | /// way the resulting pack is structured. | 94 | Index(index::Subcommands), |
| 111 | nondeterministic_count: bool, | 95 | /// Subcommands for interacting with multi-pack indices (named "multi-pack-index") |
| | 96 | MultiIndex(multi_index::Platform), |
| | 97 | /// Create a new pack with a set of objects. |
| | 98 | Create { |
| | 99 | #[clap(long, short = 'r')] |
| | 100 | /// the directory containing the '.git' repository from which objects should be read. |
| | 101 | repository: Option<PathBuf>, |
| 112 | | 102 | |
| 113 | #[clap(long, short = 's')] | 103 | #[clap(long, short = 'e', possible_values(core::pack::create::ObjectExpansion::variants()))] |
| 114 | /// If set statistical information will be presented to inform about pack creation details. | 104 | /// the way objects are expanded. They differ in costs. |
| 115 | /// It's a form of instrumentation for developers to help improve pack generation. | 105 | /// |
| 116 | statistics: bool, | 106 | /// Possible values are "none" and "tree-traversal". Default is "none". |
| | 107 | expansion: Option<core::pack::create::ObjectExpansion>, |
| 117 | | 108 | |
| 118 | #[clap(long)] | 109 | #[clap(long, default_value_t = 3, requires = "nondeterministic-count")] |
| 119 | /// The size in megabytes for a cache to speed up pack access for packs with long delta chains. | 110 | /// The amount of threads to use when counting and the `--nondeterminisitc-count` flag is set, defaulting |
| 120 | /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. | 111 | /// to the globally configured threads. |
| 121 | /// | 112 | /// |
| 122 | /// If unset, no cache will be used. | 113 | /// Use it to have different trade-offs between counting performance and cost in terms of CPU, as the scaling |
| 123 | pack_cache_size_mb: Option<usize>, | 114 | /// here is everything but linear. The effectiveness of each core seems to be no more than 30%. |
| | 115 | counting_threads: usize, |
| 124 | | 116 | |
| 125 | #[clap(long)] | 117 | #[clap(long)] |
| 126 | /// The size in megabytes for a cache to speed up accessing entire objects, bypassing object database access when hit. | 118 | /// if set, the counting phase may be accelerated using multithreading. |
| 127 | /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. | 119 | /// |
| 128 | /// | 120 | /// On the flip side, however, one will loose deterministic counting results which affects the |
| 129 | /// This cache type is currently only effective when using the 'diff-tree' object expansion. | 121 | /// way the resulting pack is structured. |
| 130 | /// | 122 | nondeterministic_count: bool, |
| 131 | /// If unset, no cache will be used. | | |
| 132 | object_cache_size_mb: Option<usize>, | | |
| 133 | | 123 | |
| 134 | #[clap(long)] | 124 | #[clap(long, short = 's')] |
| 135 | /// if set, delta-objects whose base object wouldn't be in the pack will not be recompressed as base object, but instead | 125 | /// If set statistical information will be presented to inform about pack creation details. |
| 136 | /// refer to its base object using its object id. | 126 | /// It's a form of instrumentation for developers to help improve pack generation. |
| 137 | /// | 127 | statistics: bool, |
| 138 | /// This allows for smaller packs but requires the receiver of the pack to resolve these ids before storing the pack. | | |
| 139 | /// Packs produced with this option enabled are only valid in transit, but not at rest. | | |
| 140 | thin: bool, | | |
| 141 | | 128 | |
| 142 | /// The directory into which to write the pack file. | 129 | #[clap(long)] |
| 143 | #[clap(long, short = 'o')] | 130 | /// The size in megabytes for a cache to speed up pack access for packs with long delta chains. |
| 144 | output_directory: Option<PathBuf>, | 131 | /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. |
| | 132 | /// |
| | 133 | /// If unset, no cache will be used. |
| | 134 | pack_cache_size_mb: Option<usize>, |
| 145 | | 135 | |
| 146 | /// The tips from which to start the commit graph iteration, either as fully qualified commit hashes | 136 | #[clap(long)] |
| 147 | /// or as branch names. | 137 | /// The size in megabytes for a cache to speed up accessing entire objects, bypassing object database access when hit. |
| 148 | /// | 138 | /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. |
| 149 | /// If empty, we expect to read objects on stdin and default to 'none' as expansion mode. | 139 | /// |
| 150 | /// Otherwise the expansion mode is 'tree-traversal' by default. | 140 | /// This cache type is currently only effective when using the 'diff-tree' object expansion. |
| 151 | tips: Vec<OsString>, | 141 | /// |
| 152 | }, | 142 | /// If unset, no cache will be used. |
| 153 | /// Use the git-protocol to receive a pack, emulating a clone. | 143 | object_cache_size_mb: Option<usize>, |
| 154 | #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] | | |
| 155 | Receive { | | |
| 156 | /// The protocol version to use. Valid values are 1 and 2 | | |
| 157 | #[clap(long, short = 'p')] | | |
| 158 | protocol: Option<core::net::Protocol>, | | |
| 159 | | 144 | |
| 160 | /// the directory into which to write references. Existing files will be overwritten. | 145 | #[clap(long)] |
| 161 | /// | 146 | /// if set, delta-objects whose base object wouldn't be in the pack will not be recompressed as base object, but instead |
| 162 | /// Note that the directory will be created if needed. | 147 | /// refer to its base object using its object id. |
| 163 | #[clap(long, short = 'd')] | 148 | /// |
| 164 | refs_directory: Option<PathBuf>, | 149 | /// This allows for smaller packs but requires the receiver of the pack to resolve these ids before storing the pack. |
| | 150 | /// Packs produced with this option enabled are only valid in transit, but not at rest. |
| | 151 | thin: bool, |
| 165 | | 152 | |
| 166 | /// The URLs or path from which to receive the pack. | 153 | /// The directory into which to write the pack file. |
| 167 | /// | 154 | #[clap(long, short = 'o')] |
| 168 | /// See here for a list of supported URLs: <https://www.git-scm.com/docs/git-clone#_git_urls> | 155 | output_directory: Option<PathBuf>, |
| 169 | url: String, | | |
| 170 | | 156 | |
| 171 | /// If set once or more times, these references will be fetched instead of all advertised ones. | 157 | /// The tips from which to start the commit graph iteration, either as fully qualified commit hashes |
| 172 | /// | 158 | /// or as branch names. |
| 173 | /// Note that this requires a reasonably modern git server. | 159 | /// |
| 174 | #[clap(long = "reference", short = 'r')] | 160 | /// If empty, we expect to read objects on stdin and default to 'none' as expansion mode. |
| 175 | refs: Vec<String>, | 161 | /// Otherwise the expansion mode is 'tree-traversal' by default. |
| | 162 | tips: Vec<OsString>, |
| | 163 | }, |
| | 164 | /// Use the git-protocol to receive a pack, emulating a clone. |
| | 165 | #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] |
| | 166 | Receive { |
| | 167 | /// The protocol version to use. Valid values are 1 and 2 |
| | 168 | #[clap(long, short = 'p')] |
| | 169 | protocol: Option<core::net::Protocol>, |
| 176 | | 170 | |
| 177 | /// The directory into which to write the received pack and index. | 171 | /// the directory into which to write references. Existing files will be overwritten. |
| 178 | /// | 172 | /// |
| 179 | /// If unset, they will be discarded. | 173 | /// Note that the directory will be created if needed. |
| 180 | directory: Option<PathBuf>, | 174 | #[clap(long, short = 'd')] |
| 181 | }, | 175 | refs_directory: Option<PathBuf>, |
| 182 | /// Dissolve a pack into its loose objects. | | |
| 183 | /// | | |
| 184 | /// Note that this effectively removes delta compression for an average compression of 2x, creating one file per object in the process. | | |
| 185 | /// Thus this should only be done to dissolve small packs after a fetch. | | |
| 186 | Explode { | | |
| 187 | #[clap(long)] | | |
| 188 | /// Read written objects back and assert they match their source. Fail the operation otherwise. | | |
| 189 | /// | | |
| 190 | /// Only relevant if an object directory is set. | | |
| 191 | verify: bool, | | |
| 192 | | 176 | |
| 193 | /// delete the pack and index file after the operation is successful | 177 | /// The URLs or path from which to receive the pack. |
| 194 | #[clap(long)] | 178 | /// |
| 195 | delete_pack: bool, | 179 | /// See here for a list of supported URLs: <https://www.git-scm.com/docs/git-clone#_git_urls> |
| | 180 | url: String, |
| 196 | | 181 | |
| 197 | /// The amount of checks to run | 182 | /// If set once or more times, these references will be fetched instead of all advertised ones. |
| 198 | #[clap( | 183 | /// |
| 199 | long, | 184 | /// Note that this requires a reasonably modern git server. |
| 200 | short = 'c', | 185 | #[clap(long = "reference", short = 'r')] |
| 201 | default_value = "all", | 186 | refs: Vec<String>, |
| 202 | possible_values(core::pack::explode::SafetyCheck::variants()) | | |
| 203 | )] | | |
| 204 | check: core::pack::explode::SafetyCheck, | | |
| 205 | | 187 | |
| 206 | /// Compress bytes even when using the sink, i.e. no object directory is specified | 188 | /// The directory into which to write the received pack and index. |
| | 189 | /// |
| | 190 | /// If unset, they will be discarded. |
| | 191 | directory: Option<PathBuf>, |
| | 192 | }, |
| | 193 | /// Dissolve a pack into its loose objects. |
| 207 | /// | 194 | /// |
| 208 | /// This helps to determine overhead related to compression. If unset, the sink will | 195 | /// Note that this effectively removes delta compression for an average compression of 2x, creating one file per object in the process. |
| 209 | /// only create hashes from bytes, which is usually limited by the speed at which input | 196 | /// Thus this should only be done to dissolve small packs after a fetch. |
| 210 | /// can be obtained. | 197 | Explode { |
| 211 | #[clap(long)] | 198 | #[clap(long)] |
| 212 | sink_compress: bool, | 199 | /// Read written objects back and assert they match their source. Fail the operation otherwise. |
| 213 | | 200 | /// |
| 214 | /// The '.pack' or '.idx' file to explode into loose objects | 201 | /// Only relevant if an object directory is set. |
| 215 | pack_path: PathBuf, | 202 | verify: bool, |
| 216 | | | |
| 217 | /// The path into which all objects should be written. Commonly '.git/objects' | | |
| 218 | object_path: Option<PathBuf>, | | |
| 219 | }, | | |
| 220 | /// Verify the integrity of a pack, index or multi-index file | | |
| 221 | Verify { | | |
| 222 | #[clap(flatten)] | | |
| 223 | args: VerifyOptions, | | |
| 224 | | | |
| 225 | /// The '.pack', '.idx' or 'multi-pack-index' file to validate. | | |
| 226 | path: PathBuf, | | |
| 227 | }, | | |
| 228 | } | | |
| 229 | | 203 | |
| 230 | #[derive(Debug, clap::Parser)] | 204 | /// delete the pack and index file after the operation is successful |
| 231 | pub struct VerifyOptions { | 205 | #[clap(long)] |
| 232 | /// output statistical information | 206 | delete_pack: bool, |
| 233 | #[clap(long, short = 's')] | | |
| 234 | pub statistics: bool, | | |
| 235 | /// The algorithm used to verify packs. They differ in costs. | | |
| 236 | #[clap( | | |
| 237 | long, | | |
| 238 | short = 'a', | | |
| 239 | default_value = "less-time", | | |
| 240 | possible_values(core::pack::verify::Algorithm::variants()) | | |
| 241 | )] | | |
| 242 | pub algorithm: core::pack::verify::Algorithm, | | |
| 243 | | | |
| 244 | #[clap(long, conflicts_with("re-encode"))] | | |
| 245 | /// Decode and parse tags, commits and trees to validate their correctness beyond hashing correctly. | | |
| 246 | /// | | |
| 247 | /// Malformed objects should not usually occur, but could be injected on purpose or accident. | | |
| 248 | /// This will reduce overall performance. | | |
| 249 | pub decode: bool, | | |
| 250 | | 207 | |
| 251 | #[clap(long)] | 208 | /// The amount of checks to run |
| 252 | /// Decode and parse tags, commits and trees to validate their correctness, and re-encode them. | 209 | #[clap( |
| 253 | /// | 210 | long, |
| 254 | /// This flag is primarily to test the implementation of encoding, and requires to decode the object first. | 211 | short = 'c', |
| 255 | /// Encoding an object after decoding it should yield exactly the same bytes. | 212 | default_value = "all", |
| 256 | /// This will reduce overall performance even more, as re-encoding requires to transform zero-copy objects into | 213 | possible_values(core::pack::explode::SafetyCheck::variants()) |
| 257 | /// owned objects, causing plenty of allocation to occour. | 214 | )] |
| 258 | pub re_encode: bool, | 215 | check: core::pack::explode::SafetyCheck, |
| 259 | } | | |
| 260 | | 216 | |
| 261 | /// | 217 | /// Compress bytes even when using the sink, i.e. no object directory is specified |
| 262 | pub mod multi_index { | 218 | /// |
| 263 | use std::path::PathBuf; | 219 | /// This helps to determine overhead related to compression. If unset, the sink will |
| | 220 | /// only create hashes from bytes, which is usually limited by the speed at which input |
| | 221 | /// can be obtained. |
| | 222 | #[clap(long)] |
| | 223 | sink_compress: bool, |
| 264 | | 224 | |
| 265 | #[derive(Debug, clap::Parser)] | 225 | /// The '.pack' or '.idx' file to explode into loose objects |
| 266 | pub struct Platform { | 226 | pack_path: PathBuf, |
| 267 | /// The path to the index file. | | |
| 268 | #[clap(short = 'i', long, default_value = ".git/objects/pack/multi-pack-index")] | | |
| 269 | pub multi_index_path: PathBuf, | | |
| 270 | | 227 | |
| 271 | /// Subcommands | 228 | /// The path into which all objects should be written. Commonly '.git/objects' |
| 272 | #[clap(subcommand)] | 229 | object_path: Option<PathBuf>, |
| 273 | pub cmd: Subcommands, | 230 | }, |
| 274 | } | 231 | /// Verify the integrity of a pack, index or multi-index file |
| | 232 | Verify { |
| | 233 | #[clap(flatten)] |
| | 234 | args: VerifyOptions, |
| 275 | | 235 | |
| 276 | #[derive(Debug, clap::Subcommand)] | 236 | /// The '.pack', '.idx' or 'multi-pack-index' file to validate. |
| 277 | pub enum Subcommands { | 237 | path: PathBuf, |
| 278 | /// Display all entries of a multi-index: <oid> <pack-id> <pack-offset> | | |
| 279 | Entries, | | |
| 280 | /// Print general information about a multi-index file | | |
| 281 | Info, | | |
| 282 | /// Verify a multi-index quickly without inspecting objects themselves | | |
| 283 | Verify, | | |
| 284 | /// Create a multi-pack index from one or more pack index files, overwriting possibloy existing files. | | |
| 285 | Create { | | |
| 286 | /// Paths to the pack index files to read (with .idx extension). | | |
| 287 | /// | | |
| 288 | /// Note for the multi-index to be useful, it should be side-by-side with the supplied `.idx` files. | | |
| 289 | #[clap(required = true)] | | |
| 290 | index_paths: Vec<PathBuf>, | | |
| 291 | }, | 238 | }, |
| 292 | } | 239 | } |
| 293 | } | | |
| 294 | | | |
| 295 | /// | | |
| 296 | pub mod index { | | |
| 297 | use std::path::PathBuf; | | |
| 298 | | 240 | |
| 299 | use gitoxide_core as core; | 241 | #[derive(Debug, clap::Parser)] |
| | 242 | pub struct VerifyOptions { |
| | 243 | /// output statistical information |
| | 244 | #[clap(long, short = 's')] |
| | 245 | pub statistics: bool, |
| | 246 | /// The algorithm used to verify packs. They differ in costs. |
| | 247 | #[clap( |
| | 248 | long, |
| | 249 | short = 'a', |
| | 250 | default_value = "less-time", |
| | 251 | possible_values(core::pack::verify::Algorithm::variants()) |
| | 252 | )] |
| | 253 | pub algorithm: core::pack::verify::Algorithm, |
| 300 | | 254 | |
| 301 | #[derive(Debug, clap::Subcommand)] | 255 | #[clap(long, conflicts_with("re-encode"))] |
| 302 | pub enum Subcommands { | 256 | /// Decode and parse tags, commits and trees to validate their correctness beyond hashing correctly. |
| 303 | /// create a pack index from a pack data file. | 257 | /// |
| 304 | Create { | 258 | /// Malformed objects should not usually occur, but could be injected on purpose or accident. |
| 305 | /// Specify how to iterate the pack, defaults to 'verify' | 259 | /// This will reduce overall performance. |
| 306 | /// | 260 | pub decode: bool, |
| 307 | /// Valid values are | | |
| 308 | /// | | |
| 309 | /// **as-is** do not do anything and expect the pack file to be valid as per the trailing hash, | | |
| 310 | /// **verify** the input ourselves and validate that it matches with the hash provided in the pack, | | |
| 311 | /// **restore** hash the input ourselves and ignore failing entries, instead finish the pack with the hash we computed | | |
| 312 | /// to keep as many objects as possible. | | |
| 313 | #[clap( | | |
| 314 | long, | | |
| 315 | short = 'i', | | |
| 316 | default_value = "verify", | | |
| 317 | possible_values(core::pack::index::IterationMode::variants()) | | |
| 318 | )] | | |
| 319 | iteration_mode: core::pack::index::IterationMode, | | |
| 320 | | 261 | |
| 321 | /// Path to the pack file to read (with .pack extension). | 262 | #[clap(long)] |
| 322 | /// | 263 | /// Decode and parse tags, commits and trees to validate their correctness, and re-encode them. |
| 323 | /// If unset, the pack file is expected on stdin. | 264 | /// |
| 324 | #[clap(long, short = 'p')] | 265 | /// This flag is primarily to test the implementation of encoding, and requires to decode the object first. |
| 325 | pack_path: Option<PathBuf>, | 266 | /// Encoding an object after decoding it should yield exactly the same bytes. |
| | 267 | /// This will reduce overall performance even more, as re-encoding requires to transform zero-copy objects into |
| | 268 | /// owned objects, causing plenty of allocation to occour. |
| | 269 | pub re_encode: bool, |
| | 270 | } |
| 326 | | 271 | |
| 327 | /// The folder into which to place the pack and the generated index file | 272 | /// |
| 328 | /// | 273 | pub mod multi_index { |
| 329 | /// If unset, only informational output will be provided to standard output. | 274 | use std::path::PathBuf; |
| 330 | directory: Option<PathBuf>, | 275 | |
| 331 | }, | 276 | #[derive(Debug, clap::Parser)] |
| | 277 | pub struct Platform { |
| | 278 | /// The path to the index file. |
| | 279 | #[clap(short = 'i', long, default_value = ".git/objects/pack/multi-pack-index")] |
| | 280 | pub multi_index_path: PathBuf, |
| | 281 | |
| | 282 | /// Subcommands |
| | 283 | #[clap(subcommand)] |
| | 284 | pub cmd: Subcommands, |
| | 285 | } |
| | 286 | |
| | 287 | #[derive(Debug, clap::Subcommand)] |
| | 288 | pub enum Subcommands { |
| | 289 | /// Display all entries of a multi-index: <oid> <pack-id> <pack-offset> |
| | 290 | Entries, |
| | 291 | /// Print general information about a multi-index file |
| | 292 | Info, |
| | 293 | /// Verify a multi-index quickly without inspecting objects themselves |
| | 294 | Verify, |
| | 295 | /// Create a multi-pack index from one or more pack index files, overwriting possibloy existing files. |
| | 296 | Create { |
| | 297 | /// Paths to the pack index files to read (with .idx extension). |
| | 298 | /// |
| | 299 | /// Note for the multi-index to be useful, it should be side-by-side with the supplied `.idx` files. |
| | 300 | #[clap(required = true)] |
| | 301 | index_paths: Vec<PathBuf>, |
| | 302 | }, |
| | 303 | } |
| 332 | } | 304 | } |
| 333 | } | | |
| 334 | } | | |
| 335 | | 305 | |
| 336 | /// | 306 | /// |
| 337 | pub mod free { | 307 | pub mod index { |
| 338 | #[derive(Debug, clap::Subcommand)] | 308 | use std::path::PathBuf; |
| 339 | pub enum Subcommands { | 309 | |
| 340 | /// Subcommands for interacting with mailmaps | 310 | use gitoxide_core as core; |
| 341 | Mailmap { | 311 | |
| 342 | #[clap(flatten)] | 312 | #[derive(Debug, clap::Subcommand)] |
| 343 | cmd: mailmap::Platform, | 313 | pub enum Subcommands { |
| 344 | }, | 314 | /// create a pack index from a pack data file. |
| | 315 | Create { |
| | 316 | /// Specify how to iterate the pack, defaults to 'verify' |
| | 317 | /// |
| | 318 | /// Valid values are |
| | 319 | /// |
| | 320 | /// **as-is** do not do anything and expect the pack file to be valid as per the trailing hash, |
| | 321 | /// **verify** the input ourselves and validate that it matches with the hash provided in the pack, |
| | 322 | /// **restore** hash the input ourselves and ignore failing entries, instead finish the pack with the hash we computed |
| | 323 | /// to keep as many objects as possible. |
| | 324 | #[clap( |
| | 325 | long, |
| | 326 | short = 'i', |
| | 327 | default_value = "verify", |
| | 328 | possible_values(core::pack::index::IterationMode::variants()) |
| | 329 | )] |
| | 330 | iteration_mode: core::pack::index::IterationMode, |
| | 331 | |
| | 332 | /// Path to the pack file to read (with .pack extension). |
| | 333 | /// |
| | 334 | /// If unset, the pack file is expected on stdin. |
| | 335 | #[clap(long, short = 'p')] |
| | 336 | pack_path: Option<PathBuf>, |
| | 337 | |
| | 338 | /// The folder into which to place the pack and the generated index file |
| | 339 | /// |
| | 340 | /// If unset, only informational output will be provided to standard output. |
| | 341 | directory: Option<PathBuf>, |
| | 342 | }, |
| | 343 | } |
| | 344 | } |
| 345 | } | 345 | } |
| 346 | | 346 | |
| 347 | /// | 347 | /// |
| @@ -382,7 +382,7 @@ pub mod repo { · 34 unmodified lines |
| 382 | /// Verify the integrity of the entire repository | 382 | /// Verify the integrity of the entire repository |
| 383 | Verify { | 383 | Verify { |
| 384 | #[clap(flatten)] | 384 | #[clap(flatten)] |
| 385 | args: super::pack::VerifyOptions, | 385 | args: super::free::pack::VerifyOptions, |
| 386 | }, | 386 | }, |
| 387 | /// Interact with commit objects. | 387 | /// Interact with commit objects. |
| 388 | Commit { | 388 | Commit { |