diff --git a/README b/README index cad34f6..58d5454 100644 --- a/README +++ b/README @@ -37,13 +37,13 @@ Make sure you don't accidentally encrypt the .gitattributes file itself! Share the repository with others (or with yourself) using GPG: - $ git-crypt add-gpg-key USER_ID + $ git-crypt add-gpg-user USER_ID USER_ID can be a key ID, a full fingerprint, an email address, or anything -else that uniquely identifies a key to GPG (see "HOW TO SPECIFY A USER -ID" in the gpg man page). Note: `git-crypt add-gpg-key` will add and -commit a GPG-encrypted key file in the .git-crypt directory of the root -of your repository. +else that uniquely identifies a public key to GPG (see "HOW TO SPECIFY +A USER ID" in the gpg man page). Note: `git-crypt add-gpg-user` will +add and commit a GPG-encrypted key file in the .git-crypt directory of +the root of your repository. Alternatively, you can export a symmetric secret key, which you must securely convey to collaborators (GPG is not required, and no files diff --git a/README.md b/README.md index 67fafa7..15e5e6f 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ Make sure you don't accidentally encrypt the .gitattributes file itself! Share the repository with others (or with yourself) using GPG: - git-crypt add-gpg-key USER_ID + git-crypt add-gpg-user USER_ID -`USER_ID` can be a key ID, a full fingerprint, an email address, or anything -else that uniquely identifies a key to GPG (see "HOW TO SPECIFY A USER -ID" in the gpg man page). Note: `git-crypt add-gpg-key` will add and -commit a GPG-encrypted key file in the .git-crypt directory of the root -of your repository. +`USER_ID` can be a key ID, a full fingerprint, an email address, or +anything else that uniquely identifies a public key to GPG (see "HOW TO +SPECIFY A USER ID" in the gpg man page). Note: `git-crypt add-gpg-user` +will add and commit a GPG-encrypted key file in the .git-crypt directory +of the root of your repository. Alternatively, you can export a symmetric secret key, which you must securely convey to collaborators (GPG is not required, and no files diff --git a/commands.cpp b/commands.cpp index 47fda6f..22c2337 100644 --- a/commands.cpp +++ b/commands.cpp @@ -964,16 +964,16 @@ int lock (int argc, const char** argv) return 0; } -void help_add_gpg_key (std::ostream& out) +void help_add_gpg_user (std::ostream& out) { // |--------------------------------------------------------------------------------| 80 chars - out << "Usage: git-crypt add-gpg-key [OPTIONS] GPG_USER_ID ..." << std::endl; + out << "Usage: git-crypt add-gpg-user [OPTIONS] GPG_USER_ID ..." << std::endl; out << std::endl; out << " -k, --key-name KEYNAME Add GPG user to given key, instead of default" << std::endl; out << " -n, --no-commit Don't automatically commit" << std::endl; out << std::endl; } -int add_gpg_key (int argc, const char** argv) +int add_gpg_user (int argc, const char** argv) { const char* key_name = 0; bool no_commit = false; @@ -986,7 +986,7 @@ int add_gpg_key (int argc, const char** argv) int argi = parse_options(options, argc, argv); if (argc - argi == 0) { std::clog << "Error: no GPG user ID specified" << std::endl; - help_add_gpg_key(std::clog); + help_add_gpg_user(std::clog); return 2; } @@ -1061,27 +1061,27 @@ int add_gpg_key (int argc, const char** argv) return 0; } -void help_rm_gpg_key (std::ostream& out) +void help_rm_gpg_user (std::ostream& out) { // |--------------------------------------------------------------------------------| 80 chars - out << "Usage: git-crypt rm-gpg-key [OPTIONS] GPG_USER_ID ..." << std::endl; + out << "Usage: git-crypt rm-gpg-user [OPTIONS] GPG_USER_ID ..." << std::endl; out << std::endl; out << " -k, --key-name KEYNAME Remove user from given key, instead of default" << std::endl; out << " -n, --no-commit Don't automatically commit" << std::endl; out << std::endl; } -int rm_gpg_key (int argc, const char** argv) // TODO +int rm_gpg_user (int argc, const char** argv) // TODO { - std::clog << "Error: rm-gpg-key is not yet implemented." << std::endl; + std::clog << "Error: rm-gpg-user is not yet implemented." << std::endl; return 1; } -void help_ls_gpg_keys (std::ostream& out) +void help_ls_gpg_users (std::ostream& out) { // |--------------------------------------------------------------------------------| 80 chars - out << "Usage: git-crypt ls-gpg-keys" << std::endl; + out << "Usage: git-crypt ls-gpg-users" << std::endl; } -int ls_gpg_keys (int argc, const char** argv) // TODO +int ls_gpg_users (int argc, const char** argv) // TODO { // Sketch: // Scan the sub-directories in .git-crypt/keys, outputting something like this: @@ -1097,7 +1097,7 @@ int ls_gpg_keys (int argc, const char** argv) // TODO // To resolve a long hex ID, use a command like this: // gpg --options /dev/null --fixed-list-mode --batch --with-colons --list-keys 0x143DE9B3F7316900 - std::clog << "Error: ls-gpg-keys is not yet implemented." << std::endl; + std::clog << "Error: ls-gpg-users is not yet implemented." << std::endl; return 1; } diff --git a/commands.hpp b/commands.hpp index 2bc603c..32caa0f 100644 --- a/commands.hpp +++ b/commands.hpp @@ -48,9 +48,9 @@ int diff (int argc, const char** argv); int init (int argc, const char** argv); int unlock (int argc, const char** argv); int lock (int argc, const char** argv); -int add_gpg_key (int argc, const char** argv); -int rm_gpg_key (int argc, const char** argv); -int ls_gpg_keys (int argc, const char** argv); +int add_gpg_user (int argc, const char** argv); +int rm_gpg_user (int argc, const char** argv); +int ls_gpg_users (int argc, const char** argv); int export_key (int argc, const char** argv); int keygen (int argc, const char** argv); int migrate_key (int argc, const char** argv); @@ -61,9 +61,9 @@ int status (int argc, const char** argv); void help_init (std::ostream&); void help_unlock (std::ostream&); void help_lock (std::ostream&); -void help_add_gpg_key (std::ostream&); -void help_rm_gpg_key (std::ostream&); -void help_ls_gpg_keys (std::ostream&); +void help_add_gpg_user (std::ostream&); +void help_rm_gpg_user (std::ostream&); +void help_ls_gpg_users (std::ostream&); void help_export_key (std::ostream&); void help_keygen (std::ostream&); void help_migrate_key (std::ostream&); diff --git a/git-crypt.cpp b/git-crypt.cpp index ab107af..c424866 100644 --- a/git-crypt.cpp +++ b/git-crypt.cpp @@ -54,9 +54,9 @@ static void print_usage (std::ostream& out) out << " lock de-configure git-crypt and re-encrypt files in working tree" << std::endl; out << std::endl; out << "GPG commands:" << std::endl; - out << " add-gpg-key USRID add the user with the given GPG user ID as a collaborator" << std::endl; - //out << " rm-gpg-key USRID revoke collaborator status from the given GPG user ID" << std::endl; - //out << " ls-gpg-keys list the GPG key IDs of collaborators" << std::endl; + out << " add-gpg-user ID add the user with the given GPG user ID as a collaborator" << std::endl; + //out << " rm-gpg-user ID revoke collaborator status from the given GPG user ID" << std::endl; + //out << " ls-gpg-users list the GPG key IDs of collaborators" << std::endl; out << " unlock decrypt this repo using the in-repo GPG-encrypted key" << std::endl; out << std::endl; out << "Symmetric key commands:" << std::endl; @@ -86,12 +86,12 @@ static bool help_for_command (const char* command, std::ostream& out) help_unlock(out); } else if (std::strcmp(command, "lock") == 0) { help_lock(out); - } else if (std::strcmp(command, "add-gpg-key") == 0) { - help_add_gpg_key(out); - } else if (std::strcmp(command, "rm-gpg-key") == 0) { - help_rm_gpg_key(out); - } else if (std::strcmp(command, "ls-gpg-keys") == 0) { - help_ls_gpg_keys(out); + } else if (std::strcmp(command, "add-gpg-user") == 0) { + help_add_gpg_user(out); + } else if (std::strcmp(command, "rm-gpg-user") == 0) { + help_rm_gpg_user(out); + } else if (std::strcmp(command, "ls-gpg-users") == 0) { + help_ls_gpg_users(out); } else if (std::strcmp(command, "export-key") == 0) { help_export_key(out); } else if (std::strcmp(command, "keygen") == 0) { @@ -180,14 +180,14 @@ try { if (std::strcmp(command, "lock") == 0) { return lock(argc, argv); } - if (std::strcmp(command, "add-gpg-key") == 0) { - return add_gpg_key(argc, argv); + if (std::strcmp(command, "add-gpg-user") == 0) { + return add_gpg_user(argc, argv); } - if (std::strcmp(command, "rm-gpg-key") == 0) { - return rm_gpg_key(argc, argv); + if (std::strcmp(command, "rm-gpg-user") == 0) { + return rm_gpg_user(argc, argv); } - if (std::strcmp(command, "ls-gpg-keys") == 0) { - return ls_gpg_keys(argc, argv); + if (std::strcmp(command, "ls-gpg-users") == 0) { + return ls_gpg_users(argc, argv); } if (std::strcmp(command, "export-key") == 0) { return export_key(argc, argv);