Skip to content

Document what to do with copy-pasted code #4

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

Open
m-ou-se opened this issue Jan 25, 2021 · 3 comments
Open

Document what to do with copy-pasted code #4

m-ou-se opened this issue Jan 25, 2021 · 3 comments

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Jan 25, 2021

It happens sometimes that code gets submitted for inclusion in the standard library which was taken (almost) literally from e.g. itertools or another library. We should document what to do with these w.r.t. copyright and crediting the original author(s).

@KodrAus
Copy link
Contributor

KodrAus commented Feb 1, 2021

Some of our modules have headings like this in them:

// Original implementation taken from rust-memchr.
// Copyright 2015 Andrew Gallant, bluss and Nicolas Koch

@m-ou-se
Copy link
Member Author

m-ou-se commented Feb 3, 2021

Yeah, it'd be good to clarify if that happened with permission, and/or what the license of the original code was. Also, it would be nice to set the git author (or the Co-authored-by field) to the original author(s) when adding copied code, so they get some credit for it too.

For example, the files stat start with that snippet you just mentioned, were originally added in a commit with someone else as the git committer and author.

@KodrAus
Copy link
Contributor

KodrAus commented Feb 4, 2021

We could, say, expect at least the notice in the source itself and recommend the co-authored-by field along with a link back to the original source in the commit?

For contributors who aren't really familiar with git we might want a bit of a "how to use git in the Rust codebase" to help with rebases, squashing, co-authored-by, etc.

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