Skip to content
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

removing auto-commits from subversion and adding some docstrings #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/_blackbox_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@ function vcs_commit_git() {
}
# Subversion
function vcs_commit_svn() {
svn commit -m "$@"
# svn commit -m "$@"
# subversion commits hit the upstream server; best to not commit
:
}
# Perforce
function vcs_commit_p4() {
Expand Down
15 changes: 11 additions & 4 deletions bin/blackbox_deregister_file
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ vcs_remove "$encrypted_file"
vcs_notice "$unencrypted_file"
vcs_add "$BB_FILES"

vcs_commit "Removing from blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file"
echo "========== UPDATING VCS: DONE"
echo "Local repo updated. Please push when ready."
echo " $VCS_TYPE push"
if [[ $VCS_TYPE == "svn" ]]; then
echo "========== UPDATING VCS: DONE"
echo "Local repo updated."
echo "Please commit to subversion server when ready."
echo " svn commit"
else:
vcs_commit "Removing from blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file"
echo "========== UPDATING VCS: DONE"
echo "Local repo updated. Please push when ready."
echo " $VCS_TYPE push"
fi
13 changes: 7 additions & 6 deletions bin/blackbox_initialize
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ vcs_add "${KEYRINGDIR}"
touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"
vcs_add "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"

if [[ $VCS_TYPE = "svn" ]]; then
echo
echo
# Make a suggestion:
# some whitespace
echo
echo
if [[ $VCS_TYPE == "svn" ]]; then
echo '`subversion` automatically tracks the ignored files; you just need to commit.'
echo 'NEXT STEP: You need to manually check these in:'
echo ' ' svn commit -m\'INITIALIZE BLACKBOX\' keyrings
else
IGNOREFILE="$(vcs_ignore_file_path)"
test -f "$IGNOREFILE" && vcs_add "$IGNOREFILE"

# Make a suggestion:
echo
echo
echo 'NEXT STEP: You need to manually check these in:'
echo ' ' $VCS_TYPE commit -m\'INITIALIZE BLACKBOX\' keyrings "$IGNOREFILE"
fi
12 changes: 8 additions & 4 deletions bin/blackbox_register_new_file
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ function register_new_file() {
vcs_ignore "$unencrypted_file"
echo 'NOTE: "already tracked!" messages are safe to ignore.'
vcs_add "$BB_FILES" "$encrypted_file"
vcs_commit "registered in blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file"
if [[ $VCS_TYPE == "svn" ]]; then
echo "registered in blackbox: ${unencrypted_file} as ${encrypted_file}; you must commit to subversion repo."
else
vcs_commit "registered in blackbox: ${unencrypted_file}" "$BB_FILES" "$encrypted_file"
fi
}

for target in "$@"; do
register_new_file "$target"
done

echo "========== UPDATING VCS: DONE"
if [[ $VCS_TYPE = "svn" ]]; then
echo "Local repo updated and file pushed to source control (unless an error was displayed)."
echo "Local repo updated. Please push when ready."
if [[ $VCS_TYPE == "svn" ]]; then
echo " svn commit"
else
echo "Local repo updated. Please push when ready."
echo " $VCS_TYPE push"
fi
14 changes: 11 additions & 3 deletions bin/blackbox_update_all_files
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ done 99<"$BB_FILES"

fail_if_keychain_has_secrets

echo '========== COMMITING TO VCS:'
echo '========== ADDING TO VCS:'
while IFS= read <&99 -r unencrypted_file; do
vcs_add "$unencrypted_file.gpg"
done 99<"$BB_FILES"
vcs_commit 'Re-encrypted keys'

if [[ $VCS_TYPE != "svn" ]]; then
echo '========== COMITTING TO VCS:'
vcs_commit 'Re-encrypted keys'
fi

echo '========== DONE.'
echo 'Likely next step:'
echo " $VCS_TYPE push"
if [[ $VCS_TYPE == "svn" ]]; then
echo " svn commit"
else
echo " $VCS_TYPE push"
fi