Description
To reproduce, I assume josh r23.12.04 is installed via
RUSTFLAGS="--cap-lints=warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r23.12.04
and is running as josh-proxy --local ~/.cache/rust-analyzer-josh --remote https://github.com --port 42042 --no-background
.
I prepare a branch sync-from-ra
in my rustc fork that is at commit 84e729a59f216cc64755788a470f165429a731f4.
Then I check out this branch (commit d39b00da8bd89741250eda3350450ffa6bd03565), and do
$ git push 'http://localhost:42042/RalfJung/rust.git:rev(f5a9250147f6569d8d89334dc9cca79c0322729f:prefix=src/tools/rust-analyzer):/src/tools/rust-analyzer.git' HEAD:sync-from-ra
Enumerating objects: 3930, done.
Counting objects: 100% (2465/2465), done.
Delta compression using up to 20 threads
Compressing objects: 100% (512/512), done.
Writing objects: 100% (1572/1572), 326.55 KiB | 108.85 MiB/s, done.
Total 1572 (delta 1035), reused 1546 (delta 1016), pack-reused 0
remote: Resolving deltas: 100% (1035/1035), completed with 286 local objects.
remote: josh-proxy
remote: response from upstream:
remote: To github.com:RalfJung/rust.git
remote: 84e729a59f2..f1430d6b25b JOSH_PUSH -> sync-from-ra
remote: REWRITE(6efdf26a001b6baf2ad169c489bd37a7d1d16ad5 -> ec575f8bae97b13f75c3724e2a42d072025066f0)
remote:
remote:
To http://localhost:42042/RalfJung/rust.git:rev(f5a9250147f6569d8d89334dc9cca79c0322729f:prefix=src/tools/rust-analyzer):/src/tools/rust-analyzer.git
93a578e30b..6efdf26a00 HEAD -> sync-from-ra
However, now when I fetch that branch again, I do not get my commit back out -- I expected d39b00da8bd89741250eda3350450ffa6bd03565, but I got 4037ab599d4e50aefbf476a9d492b57834b7ae4a:
$ git fetch 'http://localhost:42042/RalfJung/rust.git:rev(f5a9250147f6569d8d89334dc9cca79c0322729f:prefix=src/tools/rust-analyzer):/src/tools/rust-analyzer.git' sync-from-ra
From http://localhost:42042/RalfJung/rust.git:rev(f5a9250147f6569d8d89334dc9cca79c0322729f:prefix=src/tools/rust-analyzer):/src/tools/rust-analyzer
* branch sync-from-ra -> FETCH_HEAD
$ git rev-parse FETCH_HEAD
4037ab599d4e50aefbf476a9d492b57834b7ae4a
These commits have the same tree, but not the same history.
Usually this means something went very wrong and we'll duplicate history if we now merge this into the rustc master branch and keep synchronizing, so I stopped here.
d39b00da8bd89741250eda3350450ffa6bd03565 was created by pulling 84e729a59f216cc64755788a470f165429a731f4 from rustc and merging the result, but somehow even pushing back that merged branch to the exact same rustc commit produces an invalid result.
Cc @lnicola