Skip to content

Commit dff475d

Browse files
committed
Provide more context in comment
1 parent 88d1aa0 commit dff475d

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

tests/it/src/args.rs

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,34 @@ pub struct Args {
1414

1515
#[derive(Debug, clap::Subcommand)]
1616
pub enum Subcommands {
17-
/// Extract a file’s history so that its blame shows the same characteristics, in particular
18-
/// bugs, as the original, but in a way that can't be traced back uniquely to its source.
17+
/// Generate a shell script that creates a git repository containing all commits that are
18+
/// traversed when a blame is generated.
1919
///
20-
/// The idea is that we don't want to deal with licensing, it's more about patterns in order to
21-
/// reproduce cases for tests.
20+
/// This command extracts the file’s history so that blame, when run on the repository created
21+
/// by the script, shows the same characteristics, in particular bugs, as the original, but in
22+
/// a way that the original source file's content cannot be reconstructed.
23+
///
24+
/// The idea is that by obfuscating the file's content we make it easier for people to share
25+
/// the subset of data that's required for debugging purposes from repositories that are not
26+
/// public.
27+
///
28+
/// Note that the obfuscation leaves certain properties of the source intact, so they can still
29+
/// be inferred from the extracted history. Among these properties are directory structure
30+
/// (though not the directories' names), renames, number of lines, and whitespace.
31+
///
32+
/// This command can also be helpful in debugging the blame algorithm itself.
33+
///
34+
/// ### Terminology
35+
///
36+
/// A **blame history** is the set of commits that the blame algorithm, at some point, treated
37+
/// as potential suspects for any line in a file. It is a subset of all commits that ever
38+
/// changed a file in its history.
39+
///
40+
/// With respect to branches and merge commits, the **blame history** will not necessarily be
41+
/// identical to the file's history in the source repository. This is because the blame
42+
/// algorithm will stop following a file's history for branches that only touch lines for which
43+
/// the source has already been found. The **blame history**, thus, looks likely "cleaner" and
44+
/// "simpler" than the source history.
2245
#[clap(visible_alias = "bcr")]
2346
BlameCopyRoyal {
2447
/// Don't really copy anything.
@@ -32,9 +55,8 @@ pub enum Subcommands {
3255
file: std::ffi::OsString,
3356
/// Do not use `copy-royal` to obfuscate the content of blobs, but copy it verbatim.
3457
///
35-
/// Note that this should only be done if the source repository only contains information
36-
/// you’re willing to share. Also note that the obfuscation leaves the structure of the
37-
/// source intact, so a few of its properties can still be inferred.
58+
/// Note that this should only be done if the source history does not contain information
59+
/// you're not willing to share.
3860
#[clap(long)]
3961
verbatim: bool,
4062
},

0 commit comments

Comments
 (0)