Browse Source

Allow the user to specify a git commit message for edit-matching

Samuel W. Flint 7 years ago
parent
commit
0d8aca7396
1 changed files with 6 additions and 2 deletions
  1. 6 2
      library.org

+ 6 - 2
library.org

@@ -399,7 +399,7 @@ This handles git as needed, by first checking to see if the first argument is ~i
 
   function do_edit_exp {
       if [[ $# -lt 3 ]] ; then
-          echo "ledger edit-matching match-exp field value"
+          echo "ledger edit-matching match-exp field value [ commit-message  ]"
           exit 1
       fi
       MATCHEXPRESSION=$1
@@ -412,7 +412,11 @@ This handles git as needed, by first checking to see if the first argument is ~i
              -f "${FIELDNAME}" -S "${VALUE}" \
              ${LIBRARYFILE}
       do_git add $(basename ${LIBRARYFILE})
-      do_git commit -m "Edited records"
+      if [[ $1 != "" ]] ; then
+          do_git commit -m "${1}"
+      else
+          do_git commit -m "Bulk edited records"
+      fi
   }
 #+END_SRC