或者,對於進一步SVN_EDITOR舒適(如正常在不得不使用SvnBridge的情況下鏈接到TFS工作項目),可以將以下腳本存儲爲〜/ bin/svn_editor:
#!/bin/sh
template_file="${@}"
template_file_new="${template_file}.new"
current_work_item_number_file="${HOME}/tfs_work_item_number_current.txt"
[ -f "${current_work_item_number_file}" ] && work_item=$(cat "${current_work_item_number_file}") || work_item="please fill in!"
# Yes folks, this is the TFS convention (hard, NOT-TO-BE-ALTERED text)
# to properly link to work items via SvnBridge commits!
work_item_prefix_hard_tfs_convention_text="work item: "
work_item_text="${work_item_prefix_hard_tfs_convention_text}${work_item}"
custom_text="${work_item_text}\n\n[this addition above initially placed to ignored content part here,\nto ensure properly abortable empty message by default - please move it to active content as needed]"
sed -e 's/\(will be ignored--\)/\1\n'"${custom_text}"'/' "${template_file}" > "${template_file_new}"
mv -f "${template_file_new}" "${template_file}"
$EDITOR "${@}"
,然後簡單地做
export SVN_EDITOR=~/bin/svn_editor
在〜/ .bashrc或一些這樣的。 用於保持工作項目編號文件更新的加分點,甚至可以從當前工作項目頁面更新,如在Firefox TFS Web界面中所看到的(我認爲可能有與Firefox進行通信以獲取頁面標題等的方法)。 或者簡單地讓這個腳本啓動第一個初始編輯器運行在持久工作項目文件上,然後然後讓它在定製提交模板上運行第二個編輯器。
「受影響的文件」,或許也是「開發者名稱」,不應該是值的信息,因爲它們是* *可靠的內置提交的元數據。 – 2010-05-02 23:38:01