Skip to content

Commit d976848

Browse files
authored
Merge pull request #2180 from EliahKagan/copy-royal-guidance
Strengthen and adjust `copy-royal` usage guidance and caveats
2 parents 442f800 + 90a3dcb commit d976848

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

tests/it/src/args.rs

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@ pub struct Args {
1616
#[derive(Debug, clap::Subcommand)]
1717
pub enum Subcommands {
1818
/// Generate a shell script that creates a git repository containing all commits that are
19-
/// traversed when a blame is generated.
19+
/// traversed when following a given file through the Git history just as `git blame` would.
2020
///
2121
/// This command extracts the file’s history so that blame, when run on the repository created
2222
/// by the script, shows the same characteristics, in particular bugs, as the original, but in
23-
/// a way that the original source file's content cannot be reconstructed.
23+
/// a way that does not resemble the original source file's content to any greater extent than
24+
/// is useful and necessary.
2425
///
25-
/// The idea is that by obfuscating the file's content we make it easier for people to share
26-
/// the subset of data that's required for debugging purposes from repositories that are not
27-
/// public.
28-
///
29-
/// Note that the obfuscation leaves certain properties of the source intact, so they can still
30-
/// be inferred from the extracted history. Among these properties are directory structure
31-
/// (though not the directories' names), renames, number of lines, and whitespace.
26+
/// Note that this should not be used to redact sensitive information. The obfuscation leaves
27+
/// numerous properties of the source intact, such that it may be feasible to reconstruct the
28+
/// input.
3229
///
3330
/// This command can also be helpful in debugging the blame algorithm itself.
3431
///
@@ -59,15 +56,27 @@ pub enum Subcommands {
5956
file: std::ffi::OsString,
6057
/// Do not use `copy-royal` to obfuscate the content of blobs, but copy it verbatim.
6158
///
62-
/// Note that this should only be done if the source history does not contain information
63-
/// you're not willing to share.
59+
/// Note that, for producing cases for the gitoxide test suite, we usually prefer only to
60+
/// take blobs verbatim if the source repository was purely for testing.
6461
#[clap(long)]
6562
verbatim: bool,
6663
},
67-
/// Copy a tree so that it diffs the same but can't be traced back uniquely to its source.
64+
/// Copy a tree so that it diffs the same but does not resemble the original files' content to
65+
/// any greater extent than is useful and necessary.
66+
///
67+
/// The idea is that this preserves the patterns that are usually sufficient to reproduce cases
68+
/// for tests of diffs, both for making the tests work and for keeping the diffs understandable
69+
/// to developers working on the tests, while avoiding keeping large verbatim fragments of code
70+
/// based on which the test cases were created. The benefits of "reducing" the code to these
71+
/// patterns include that the original meaning and function of code will not be confused with
72+
/// the code of gitoxide itself, will not distract from the effects observed in their diffs,
73+
/// and will not inadvertently be caught up in code cleanup efforts (e.g. attempting to adjust
74+
/// style or fix bugs) that would make sense in code of gitoxide itself but that would subtly
75+
/// break data test fixtures if done on their data.
6876
///
69-
/// The idea is that we don't want to deal with licensing, it's more about patterns in order to
70-
/// reproduce cases for tests.
77+
/// Note that this should not be used to redact sensitive information. The obfuscation leaves
78+
/// numerous properties of the source intact, such that it may be feasible to reconstruct the
79+
/// input.
7180
#[clap(visible_alias = "cr")]
7281
CopyRoyal {
7382
/// Don't really copy anything.
@@ -93,8 +102,8 @@ pub enum Subcommands {
93102
count: usize,
94103
/// Do not use `copy-royal` to degenerate information of blobs, but take blobs verbatim.
95104
///
96-
/// Note that this should only be done if the source repository is purely for testing
97-
/// or was created by yourself.
105+
/// Note that, for producing cases for the gitoxide test suite, we usually prefer only to
106+
/// take blobs verbatim if the source repository was purely for testing.
98107
#[clap(long)]
99108
verbatim: bool,
100109
/// The directory into which the blobs and tree declarations will be written.

0 commit comments

Comments
 (0)