Skip to content
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

fetch pack #539

Merged
merged 115 commits into from
Sep 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
8b6ecb2
print information about filtered ref-specs as well.
Byron Sep 21, 2022
6df179b
feat: `RefSpecRef::prefix()` to return the two-component prefix of a …
Byron Sep 21, 2022
45394d5
improve docs a little (#450)
Byron Sep 21, 2022
3a38d1b
change: turn `prepare_ls_refs` in `fetch::refs()` into `FnOnce`. (#450)
Byron Sep 21, 2022
278ff7a
fix: `RefSpecRef` instruction uses the correct lifetime. (#450)
Byron Sep 21, 2022
25f0640
feat: `Remote::rem_map()` now specifies ref-prefixes to the remote. (…
Byron Sep 21, 2022
38373bc
Allow to turn remote-filtering off. (#450)
Byron Sep 21, 2022
02245a6
update fetch feature list with `wait-for-done` (#450)
Byron Sep 22, 2022
c3e4b2a
refactor (#450)
Byron Sep 22, 2022
5475cc2
pass extra handshake parameters via options in `ref-map` (#450)
Byron Sep 22, 2022
0dc7206
first sktech of fetch module (#450)
Byron Sep 22, 2022
5bef0a0
FAIL: try to make the transport configurable after being boxed, but… …
Byron Sep 22, 2022
fbb96e4
Revert "FAIL: try to make the transport configurable after being boxe…
Byron Sep 22, 2022
1cf66c4
change!: `client::http::connect()` returns `Transport<Impl>` directly…
Byron Sep 22, 2022
211e65d
Make it easier to connect to http if well-known to allow additional c…
Byron Sep 22, 2022
47d5cd6
don't fail if we can't indicate the end of interaction to the server …
Byron Sep 22, 2022
744ed03
feat: add `client::fetch_pack()` allowing to fetch a pack after a han…
Byron Sep 22, 2022
f87b7eb
remove: `client::fetch_pack()` isn't worth it after all. (#450)
Byron Sep 22, 2022
f0f4db6
sketch of 'Prepare' struct to configure fetch after ref-map was obtai…
Byron Sep 22, 2022
78ad3df
feat!: add `fetch::Transport::configure` to generically configure any…
Byron Sep 22, 2022
e842843
adapt to changes in `git-transport` (#450)
Byron Sep 22, 2022
d1cb6cc
fix build (#450)
Byron Sep 22, 2022
9b86a1f
remove connect_http() method to encourage changing settings using `tr…
Byron Sep 22, 2022
779eefe
Use `&dyn Any` instead of unspecified serialization format, as it's t…
Byron Sep 22, 2022
7993f6a
fix build (#450)
Byron Sep 22, 2022
f8fb04a
refactor (#450)
Byron Sep 23, 2022
d686020
Merge branch 'main' into fetch-pack
Byron Sep 23, 2022
4b1e3b3
feat: add `Repository::find_default_remote()` which works on detached…
Byron Sep 23, 2022
249c54e
allow stopping fetches after preparing it (#450)
Byron Sep 23, 2022
5c24425
be a bit clearer on how configuration should be done. (#450)
Byron Sep 23, 2022
67801a3
sketch the receive() method to finally receive a pack. (#450)
Byron Sep 23, 2022
d2bea00
feat: add `config::SnapshotMut::forget()` to forget all changes befor…
Byron Sep 23, 2022
4367994
feat: add `config::SnapshotMut::commit()` to make clear it's transact…
Byron Sep 23, 2022
591afd5
rename!: `bundle::write::Options::index_kind` -> `::index_version`. (…
Byron Sep 23, 2022
d5254c2
adapt to changes in `git-pack` (#450)
Byron Sep 23, 2022
5a3155a
obtain configuration for index version (with respect for lenient conf…
Byron Sep 23, 2022
8d17dc6
also extract index threads (#450)
Byron Sep 23, 2022
92e082a
A very first version of `gix progress show` (#450)
Byron Sep 23, 2022
317e02a
add support for more types of configurations (#450)
Byron Sep 23, 2022
b42b08a
refactor (#450)
Byron Sep 23, 2022
65e6496
Add tabled for nicer printing (#450)
Byron Sep 23, 2022
5c0d0ab
add more records (#450)
Byron Sep 23, 2022
6abd5a4
complete listing of records based on current usage, probably (#450)
Byron Sep 23, 2022
eade88f
slightly nicer styling of config keys (#450)
Byron Sep 23, 2022
8dadd70
thanks clippy
Byron Sep 23, 2022
97a5e97
complete pack generation options based on configuration (#450)
Byron Sep 24, 2022
5e93ef5
refactor (#450)
Byron Sep 24, 2022
31a7089
feat: make some private methods public to give callers more flexibili…
Byron Sep 24, 2022
3c188b2
Add remotes.<group> as planned feature for remotes (#450)
Byron Sep 24, 2022
4997e56
port part of the negotation logic over, but a lot is still missing (#…
Byron Sep 24, 2022
4850202
Improve docs slightly (#450)
Byron Sep 25, 2022
0b6ed60
fix: `bundle::write::Error` is now publicly available (#450)
Byron Sep 25, 2022
0bcb2fd
feat: `fetch::Arguments::is_empty()` to help decide if arguments shou…
Byron Sep 25, 2022
aad17ba
A first test for validating nothing-new is a no-op (#450)
Byron Sep 25, 2022
72ce7fd
add test to show that empty packs won't be written as expected behavi…
Byron Sep 25, 2022
4d90815
allow git-repository to grow (#450)
Byron Sep 25, 2022
e05c1fe
feat: Allow defaulting `client::Capabilities`. (#450)
Byron Sep 25, 2022
aed93d2
feat: Allow defaulting `fetch::handshake::Outcome`. (#450)
Byron Sep 25, 2022
5f73b25
Don't degenerate information in case there is no update needed. (#450)
Byron Sep 25, 2022
b46347f
rename!: `index::write::Outcome::index_kind` -> `::index_version`. (#…
Byron Sep 26, 2022
474156f
adapt to changes in `git-pack` (#450)
Byron Sep 26, 2022
2962dc2
A first sketch of validating a fetch. (#450)
Byron Sep 26, 2022
8499c3e
thanks clippy
Byron Sep 26, 2022
f8fe6e4
fix journey tests (#450)
Byron Sep 26, 2022
ce1a373
speed up fetch tests by giving them their own repo-fixture (#450)
Byron Sep 26, 2022
d5c1f92
try to make naive negotiation better, but… (#450)
Byron Sep 26, 2022
0387794
improve naieve algorithm to be a bit better in our test-case (#450)
Byron Sep 26, 2022
2ec8175
greatly improved performance for write-test. (#450)
Byron Sep 26, 2022
96f2fd8
refactor (#450)
Byron Sep 26, 2022
1f2d609
lay the ground-works for testing the update of refs (#450)
Byron Sep 26, 2022
4a5d3b4
make `remote::fetch::refs::update()` public to facilitate testing (#450)
Byron Sep 26, 2022
8e1555d
fix build (#450)
Byron Sep 26, 2022
c355823
the first somewhat synthetic test to check for no changes. (#450)
Byron Sep 26, 2022
2828674
more update tests (#450)
Byron Sep 26, 2022
658c125
feat: `FullName::try_from(&BString)` for convenience. (#450)
Byron Sep 26, 2022
c101d50
a big step towards ref updates, now it needs specs (#450)
Byron Sep 26, 2022
d7f63a6
feat: `RefSpec::allow_non_fast_forward()` to get information about 'f…
Byron Sep 26, 2022
a9f2c45
Provide refspecs to refs::update() to obtain force information (#450)
Byron Sep 26, 2022
9f9b610
Make `fetch::refs::update()` private again, move tests accordingly. (…
Byron Sep 26, 2022
e4edc18
the first successful test (#450)
Byron Sep 26, 2022
7ced240
tests for all the cases excluding fast-forwards (#450)
Byron Sep 26, 2022
e25460b
Add failing test to show we need to respect dry-run mode (or the lack…
Byron Sep 27, 2022
7076891
add information about planned lock timeout support (from configuratio…
Byron Sep 27, 2022
8fe4bf4
actually apply ref updates (#450)
Byron Sep 27, 2022
1bb910e
prepare for worktree-aware checked-out branch handling… (#450)
Byron Sep 27, 2022
3a0fb1b
change!: remote `lock_mode` from all methods dealing with reference e…
Byron Sep 27, 2022
e88de0f
change!: All methods editing references don't take the author as para…
Byron Sep 27, 2022
da147bf
auto-update previously cached values after changing the configuration…
Byron Sep 27, 2022
830c450
read core.excludesFile lazily (and don't cache it yet) (#450)
Byron Sep 27, 2022
f47a31d
refactor (#450)
Byron Sep 27, 2022
e699291
change!: `file::Transaction::prepare()` now takes two `git_lock::acqu…
Byron Sep 27, 2022
d40beb3
adapt to changes in `git-ref` (#450)
Byron Sep 27, 2022
fd18320
update progress information to include packedRefsTimeout (#450)
Byron Sep 27, 2022
cc75647
Add test for commit-and-rollback method, and fix it (#450)
Byron Sep 27, 2022
b514966
more robust assignment of re-evaluated cached values (#450)
Byron Sep 27, 2022
dde9e63
more tests for SnapshotMut and now it's working properly (#450)
Byron Sep 27, 2022
005469c
isolate test properly (#450)
Byron Sep 27, 2022
6981b71
more robust tests that depend on time. (#450)
Byron Sep 27, 2022
09da4c5
feat: add `Env::unset()` for convenience (#450)
Byron Sep 27, 2022
25d6106
unset other variables that we know may affect some functions that nee…
Byron Sep 27, 2022
9704c2f
further harden tests to only allow environment variables for those wh…
Byron Sep 27, 2022
2a67531
fix docs (#450)
Byron Sep 27, 2022
870b680
add failing test to validate worktree-checkout check (#450)
Byron Sep 28, 2022
5a6c102
reject updating checked-out branches (#450)
Byron Sep 28, 2022
93917cb
Merge branch 'main' into fetch-pack
Byron Sep 28, 2022
18581d0
refactor (#450)
Byron Sep 29, 2022
ba41b6c
no-clobber special case for tags (#450)
Byron Sep 29, 2022
d79a7a6
assure objects exist before setting them. (#450)
Byron Sep 29, 2022
b521748
thanks clippy
Byron Sep 29, 2022
91859d5
facilities to test reflog messages (#450)
Byron Sep 29, 2022
9a072bd
refactor (#450)
Byron Sep 29, 2022
6ebbbc1
support reflog message prefix (#450)
Byron Sep 30, 2022
2a76908
test all reflog messages that are expected, sans fast-forward (#450)
Byron Sep 30, 2022
370ed3d
feat: `transaction::Change::new_value()` to get easy access to new va…
Byron Sep 30, 2022
ef9fa98
dry-run mode for fetch (#450)
Byron Sep 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support reflog message prefix (#450)
Byron committed Sep 30, 2022

Verified

This commit was signed with the committer’s verified signature.
bukka Jakub Zelenka
commit 6ebbbc153dcf4eedb2afbd561c4d2ce342f6289b
1 change: 1 addition & 0 deletions git-repository/src/remote/connection/fetch/mod.rs
Original file line number Diff line number Diff line change
@@ -177,6 +177,7 @@ where

let update_refs = refs::update(
repo,
"fetch",
&self.ref_map.mappings,
con.remote.refspecs(crate::remote::Direction::Fetch),
fetch::DryRun::No,
Original file line number Diff line number Diff line change
@@ -30,10 +30,12 @@ impl From<update::Mode> for Update {
/// [`update`][Update] corresponding to the [`fetch::Mapping`] of at the same index.
/// If `dry_run` is true, ref transactions won't actually be applied, but are assumed to work without error so the underlying
/// `repo` is not actually changed.
/// `action` is the prefix used for reflog entries, and is typically "fetch".
///
/// It can be used to produce typical information that one is used to from `git fetch`.
pub(crate) fn update(
repo: &Repository,
action: &str,
mappings: &[fetch::Mapping],
refspecs: &[git_refspec::RefSpec],
dry_run: fetch::DryRun,
@@ -91,7 +93,7 @@ pub(crate) fn update(
log: LogChange {
mode: RefLog::AndReference,
force_create_reflog: false,
message: reflog_message.into(),
message: format!("{}: {}", action, reflog_message).into(),
},
expected: PreviousValue::ExistingMustMatch(Target::Peeled(remote_id.into())),
new: Target::Peeled(remote_id.into()),
11 changes: 6 additions & 5 deletions git-repository/src/remote/connection/fetch/update_refs/tests.rs
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ mod update {
// ),
] {
let (mapping, specs) = mapping_from_spec(spec, &repo);
let out = fetch::refs::update(&repo, &mapping, &specs, fetch::DryRun::Yes).unwrap();
let out = fetch::refs::update(&repo, "action", &mapping, &specs, fetch::DryRun::Yes).unwrap();

assert_eq!(
out.updates,
@@ -109,7 +109,8 @@ mod update {
match &edit.change {
Change::Update { log, .. } => {
assert_eq!(
log.message, reflog_message,
log.message,
format!("action: {}", reflog_message),
"reflog messages are specific and we emulate git word for word"
);
}
@@ -137,7 +138,7 @@ mod update {
] {
let spec = format!("refs/heads/main:refs/heads/{}", branch);
let (mappings, specs) = mapping_from_spec(&spec, &repo);
let out = fetch::refs::update(&repo, &mappings, &specs, fetch::DryRun::Yes)?;
let out = fetch::refs::update(&repo, "action", &mappings, &specs, fetch::DryRun::Yes)?;

assert_eq!(
out.updates,
@@ -158,7 +159,7 @@ mod update {
fn symbolic_refs_are_never_written() {
let repo = repo("two-origins");
let (mappings, specs) = mapping_from_spec("refs/heads/main:refs/heads/symbolic", &repo);
let out = fetch::refs::update(&repo, &mappings, &specs, fetch::DryRun::Yes).unwrap();
let out = fetch::refs::update(&repo, "action", &mappings, &specs, fetch::DryRun::Yes).unwrap();

assert_eq!(
out.updates,
@@ -176,7 +177,7 @@ mod update {
fn fast_forward_is_not_implemented_yet_but_should_be_denied() {
let repo = repo("two-origins");
let (mappings, specs) = mapping_from_spec("refs/heads/main:refs/remotes/origin/g", &repo);
let out = fetch::refs::update(&repo, &mappings, &specs, fetch::DryRun::Yes).unwrap();
let out = fetch::refs::update(&repo, "action", &mappings, &specs, fetch::DryRun::Yes).unwrap();

assert_eq!(
out.updates,