Rename add-gpg-key command, etc. to add-gpg-user, etc.

While writing the documention, I found that "GPG user" was less confusing
terminology than "GPG key," since you aren't really adding a "key"
to git-crypt, and git-crypt already uses "key" to refer to other concepts
(cf. the -k/--key-name options).
This commit is contained in:
Andrew Ayer
2014-09-15 10:02:22 -07:00
parent 04906c5355
commit e4d1091e97
5 changed files with 44 additions and 44 deletions

10
README
View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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&);

View File

@@ -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);