summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar http://identi.ca/cwebber/ <cwebber@web>2012-11-27 21:24:49 +0000
committerGravatar admin <admin@branchable.com>2012-11-27 21:24:49 +0000
commit111ca0340ba3029acb0e58befad7d008323a5549 (patch)
tree4358ebdab7b0cc4b83ad11fe42beff84437cc37b
parent2bc86a0314722a536e6d18b7fa817bac4d238de5 (diff)
Added a comment: Reasonable solution?
-rw-r--r--doc/forum/The_ability_to_leave_a_file_unlocked_for_a_bit_while_committing_it_repeatedly__63__/comment_1_3cbe520b184d323219cb402ff046c3b4._comment29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/forum/The_ability_to_leave_a_file_unlocked_for_a_bit_while_committing_it_repeatedly__63__/comment_1_3cbe520b184d323219cb402ff046c3b4._comment b/doc/forum/The_ability_to_leave_a_file_unlocked_for_a_bit_while_committing_it_repeatedly__63__/comment_1_3cbe520b184d323219cb402ff046c3b4._comment
new file mode 100644
index 000000000..fac362892
--- /dev/null
+++ b/doc/forum/The_ability_to_leave_a_file_unlocked_for_a_bit_while_committing_it_repeatedly__63__/comment_1_3cbe520b184d323219cb402ff046c3b4._comment
@@ -0,0 +1,29 @@
+[[!comment format=mdwn
+ username="http://identi.ca/cwebber/"
+ nickname="cwebber"
+ subject="Reasonable solution?"
+ date="2012-11-27T21:24:49Z"
+ content="""
+I think I have built a reasonable solution... this function checks a specific file into git and then immediately unlocks it.
+
+ function git-annex-unlocked-commit {
+ if [ $# -ne 2 ]; then
+ echo \"Wrong number of args.\"
+ return 1
+ fi
+
+ if [ ! -e \"$1\" ]; then
+ echo \"Need a filename!\"
+ return 1
+ fi
+
+ read -p \"Really do an unlocked commit? (y/n): \"
+ if [ \"$REPLY\" == \"y\" ]; then
+ git commit $1 -m \"$2\" && git annex unlock $1
+ fi
+ }
+
+Use it like:
+
+ git-annex-unlocked-commit mediagoblin_postcard.xcf \"Starting to fill in spencer\"
+"""]]