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

Moving rand_distr code from rand repository #1

Open
9 tasks done
benjamin-lieser opened this issue Feb 5, 2025 · 16 comments
Open
9 tasks done

Moving rand_distr code from rand repository #1

benjamin-lieser opened this issue Feb 5, 2025 · 16 comments

Comments

@benjamin-lieser
Copy link
Member

benjamin-lieser commented Feb 5, 2025

To-Do for rust-random/rand#1394

  • Move code from rand_distr and distr_test
  • Set up CI
  • Set up github settings (protected branches, templates, etc ...)
  • Decide if the have a separate bench crate or it can life in rand_distr
  • Some information how to find old issues and PR because they are not in this repo
  • Moving the open issues related to rand_distr
  • Delete the code from rand
  • v0.5.0 tag

I hope it is ok that I went ahead and created the repo, it is private right now, at some point we have to

  • Make this repo public
@benjamin-lieser
Copy link
Member Author

As an alternative for copying the code we can take the git history of rand and remove all the non rand_distr code. This will keep all the attributions but also a lot of unrelated commits.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

Thanks for getting started on this.

We should aim to keep history: https://stackoverflow.com/a/17864475/314345
Yes, there is bound to be some unrelated stuff but the above will filter a lot of it.

The benches crate is slightly problematic; I'd suggest keeping both but removing any bench using rand_distr from the rand repo and the others from this repo (e.g. generators should not use rand_distr code).

@benjamin-lieser
Copy link
Member Author

It seems not straight forward how to do this with multiple directories. Do you have experience with this? If not I can probably figure something out.

Right now I have: Split the 3 directories we want to keep (rand_distr, distr_test, benches) and then use git subtree add to import the other two into the one of rand_distr

This seems to retain all the commits. After splitting rand_distr I only have 300 commits which seems good.

@benjamin-lieser
Copy link
Member Author

benjamin-lieser commented Feb 5, 2025

It seems splitting out benches retains most of the history https://github.com/benjamin-lieser/rand/tree/benches
distr_test only contains 9 commits, which makes sense.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

Maybe move distr_test and benches into rand_distr first?

@benjamin-lieser
Copy link
Member Author

Maybe move distr_test and benches into rand_distr first?

This does work, not sure why the splitting of benches does not work

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

This does work, not sure why the splitting of benches does not work

That would only retain history related to benches, I think?

It looks like what you just pushed is a rebase of sorts? Compare b0bd0f7 to rust-random/rand@e06370c and notice that the changes to distr_test are omitted.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

I repeated what you did — it seems that git subtree split rewrites history in the order seen, ignoring any content outside the directory in question at the time, hence the last commit appears to be pulling distr_test and benches from nowhere. I'll try playing with filter-branch filter-repo.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

I have a filtered history. You haven't pushed much here so far — can I overwrite it?

@benjamin-lieser
Copy link
Member Author

If you find a better solution it would be nice. I think the move first option is good enough.

It is fine if you force push to main right now.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

Done. We now have main and master... I made the latter the primary branch. We can delete the other soon.

I didn't move anything yet — I'll make a PR for that now.

@benjamin-lieser
Copy link
Member Author

Look good :)
I will rebase the PR and make some more changes

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

I ticked off some items above. I think once #3 is merged we can make this public, and then start tidying up the rand repo.

@benjamin-lieser
Copy link
Member Author

I ticked off some items above. I think once #3 is merged we can make this public, and then start tidying up the rand repo.

I agree

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

We're now public.

@dhardy
Copy link
Member

dhardy commented Feb 5, 2025

I transferred what I thought were appropriate issues. rust-random/rand#1193 and rust-random/rand#1459 are less obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants