forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 145
PATH WALK II: Add --path-walk option to 'git pack-objects' #1819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
derrickstolee
wants to merge
13
commits into
gitgitgadget:master
from
derrickstolee:path-walk-upstream
+620
−66
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
57c1cc2
pack-objects: extract should_attempt_deltas()
derrickstolee e3ea17e
pack-objects: add --path-walk option
derrickstolee 6d65fce
pack-objects: update usage to match docs
derrickstolee ad65148
p5313: add performance tests for --path-walk
derrickstolee 6ed6d4e
pack-objects: introduce GIT_TEST_PACK_PATH_WALK
derrickstolee 19c6651
t5538: add tests to confirm deltas in shallow pushes
derrickstolee 7f9e6a0
repack: add --path-walk option
derrickstolee b98e71d
pack-objects: enable --path-walk via config
derrickstolee 8e1d141
scalar: enable path-walk during push via config
derrickstolee 2c1d847
pack-objects: refactor path-walk delta phase
derrickstolee 623913f
pack-objects: thread the path-based compression
derrickstolee a14d447
path-walk: add new 'edge_aggressive' option
derrickstolee 18241d3
pack-objects: allow --shallow and --path-walk
derrickstolee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,13 @@ SYNOPSIS | |
-------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Taylor Blau wrote (reply to this): On Mon, Mar 10, 2025 at 01:50:45AM +0000, Derrick Stolee via GitGitGadget wrote:
> ---
> Documentation/git-pack-objects.adoc | 14 +++++++-------
> builtin/pack-objects.c | 10 ++++++++--
> t/t0450/adoc-help-mismatches | 1 -
> 3 files changed, 15 insertions(+), 10 deletions(-)
Thanks for cleaning these up.
Thanks,
Taylor |
||
[verse] | ||
'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied] | ||
[--no-reuse-delta] [--delta-base-offset] [--non-empty] | ||
[--local] [--incremental] [--window=<n>] [--depth=<n>] | ||
[--revs [--unpacked | --all]] [--keep-pack=<pack-name>] | ||
[--cruft] [--cruft-expiration=<time>] | ||
[--stdout [--filter=<filter-spec>] | <base-name>] | ||
[--shallow] [--keep-true-parents] [--[no-]sparse] | ||
[--name-hash-version=<n>] < <object-list> | ||
[--no-reuse-delta] [--delta-base-offset] [--non-empty] | ||
[--local] [--incremental] [--window=<n>] [--depth=<n>] | ||
[--revs [--unpacked | --all]] [--keep-pack=<pack-name>] | ||
[--cruft] [--cruft-expiration=<time>] | ||
[--stdout [--filter=<filter-spec>] | <base-name>] | ||
[--shallow] [--keep-true-parents] [--[no-]sparse] | ||
[--name-hash-version=<n>] [--path-walk] < <object-list> | ||
|
||
|
||
DESCRIPTION | ||
|
@@ -375,6 +375,17 @@ many different directories. At the moment, this version is not allowed | |
when writing reachability bitmap files with `--write-bitmap-index` and it | ||
will be automatically changed to version `1`. | ||
|
||
--path-walk:: | ||
Perform compression by first organizing objects by path, then a | ||
second pass that compresses across paths as normal. This has the | ||
potential to improve delta compression especially in the presence | ||
of filenames that cause collisions in Git's default name-hash | ||
algorithm. | ||
+ | ||
Incompatible with `--delta-islands`, `--shallow`, or `--filter`. The | ||
`--use-bitmap-index` option will be ignored in the presence of | ||
`--path-walk.` | ||
|
||
|
||
DELTA ISLANDS | ||
------------- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ SYNOPSIS | |
[verse] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Taylor Blau wrote (reply to this): On Mon, Mar 24, 2025 at 03:22:43PM +0000, Derrick Stolee via GitGitGadget wrote:
> diff --git a/Documentation/git-repack.adoc b/Documentation/git-repack.adoc
> index 5852a5c9736..2199eb3b94f 100644
> --- a/Documentation/git-repack.adoc
> +++ b/Documentation/git-repack.adoc
> @@ -11,7 +11,7 @@ SYNOPSIS
> [verse]
> 'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [-m]
> [--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>]
> - [--write-midx] [--name-hash-version=<n>]
> + [--write-midx] [--name-hash-version=<n>] [--path-walk]
>
> DESCRIPTION
> -----------
> @@ -255,6 +255,18 @@ linkgit:git-multi-pack-index[1]).
> Provide this argument to the underlying `git pack-objects` process.
> See linkgit:git-pack-objects[1] for full details.
>
> +--path-walk::
> + This option passes the `--path-walk` option to the underlying
> + `git pack-options` process (see linkgit:git-pack-objects[1]).
> + By default, `git pack-objects` walks objects in an order that
> + presents trees and blobs in an order unrelated to the path they
> + appear relative to a commit's root tree. The `--path-walk` option
> + enables a different walking algorithm that organizes trees and
> + blobs by path. This has the potential to improve delta compression
> + especially in the presence of filenames that cause collisions in
> + Git's default name-hash algorithm. Due to changing how the objects
> + are walked, this option is not compatible with `--delta-islands`
> + or `--filter`.
I was going to make a similar comment here as I did in an earlier commit
message about describing the direct effect of a command-line flag
instead of describing it in contrast to the default behavior. But I
think here that I would recommend instead abbreviating the description
to just:
--path-walk::
Pass the `--path-walk` option to `git pack-objects`, see
linkgit:git-pack-objects[1].
, which is consistent with options like `-l`, `-f`, -F`, etc.
Does it makes sense to have a separate `--[no-]cruft-path-walk` here to
let callers determine separate behavior when repack is tasked with
generating cruft packs?
Thanks,
Taylor |
||
'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [-m] | ||
[--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>] | ||
[--write-midx] [--name-hash-version=<n>] | ||
[--write-midx] [--name-hash-version=<n>] [--path-walk] | ||
|
||
DESCRIPTION | ||
----------- | ||
|
@@ -255,6 +255,9 @@ linkgit:git-multi-pack-index[1]). | |
Provide this argument to the underlying `git pack-objects` process. | ||
See linkgit:git-pack-objects[1] for full details. | ||
|
||
--path-walk:: | ||
Pass the `--path-walk` option to the underlying `git pack-objects` | ||
process. See linkgit:git-pack-objects[1] for full details. | ||
|
||
CONFIGURATION | ||
------------- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Taylor Blau wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Derrick Stolee wrote (reply to this):