diff --git a/gpm b/gpm index 95b556a..54dc8d2 100755 --- a/gpm +++ b/gpm @@ -9,14 +9,19 @@ import Turtle main :: IO () main = do - echo "Git Project Manager" - echo "create a new branch gpm (be sure the branch gpm doesn't already exists)" - debug "git checkout --orphan gpm" - echo "cleanup the branch" - debug "git rm --cached -r ." + echo "# -- Git Project Manager" + mkNewEmptyBranch "gpm" initIssues initDocs +mkNewEmptyBranch :: Text -> IO () +mkNewEmptyBranch br = do + putText $ "create a new branch " <> br <> " (be sure the branch " <> br <> " doesn't already exists)" + debug $ "git checkout --orphan " <> br + echo "cleanup the branch" + debug "git rm --cached -r ." + +debug :: Text -> IO () debug cmd = do putText cmd stdout $ inshell cmd empty @@ -39,4 +44,4 @@ initReview = do mktree "reviews" putText $ format ("* "%fp) fic input ("templates" "review.org") - & output fic \ No newline at end of file + & output fic diff --git a/gpm-review-0.0.1/gpm-review.el b/gpm-review-0.0.1/gpm-review.el index c8e4d3d..a518e6a 100644 --- a/gpm-review-0.0.1/gpm-review.el +++ b/gpm-review-0.0.1/gpm-review.el @@ -43,15 +43,23 @@ (review-dir "~/.reviews/") (local-review (concat "file:../reviews/" review-file-name)) (global-review (concat review-dir review-file-name))) - (url-copy-file local-review global-review) + (if (file-exists-p local-review) + (url-copy-file local-review global-review) + (shell-command (concat "touch " global-review))) (setq org-capture-templates - `(("c" "Change requested" entry (file+headline global-review) - "* CHANGE_REQUESTED %?\n %i\n %a") - ("q" "question" entry (file+headline global-review) - "* QUESTION %?\n %i\n %a") - ("r" "refused" entry (file+headline global-review) - "* REFUSED %?\n %i\n %a"))) - (setq org-default-notes-file global-review))) + (backquote (("f" "feedback" + entry (file (lambda () ,global-review)) + "* FEEDBACK %?\n %i\n %a") + ("q" "question" + entry (file (lambda () ,global-review)) + "* QUESTION %?\n %i\n %a") + ("c" "change requested" + entry (file (lambda () ,global-review)) + "* CHANGE_REQUESTED %?\n %i\n %a") + ("r" "refused" + entry (file (lambda () ,global-review)) + "* REFUSED %?\n %i\n %a")))) + (setq org-default-notes-file global-review))) (defun end-review () "to be call when the reviewer ends its review." diff --git a/templates/issues.org b/templates/issues.org index 77d4bb0..19ca7ef 100644 --- a/templates/issues.org +++ b/templates/issues.org @@ -4,9 +4,9 @@ #+PROPERTY: ASSIGNEE #+PROPERTY: REVIEWERS #+PROPERTY: BRANCH -#+TODO: FEEDBACK(f) TODO(t) STARTED(s) WAITING(w) LGTM(l) | DONE(d) CANCELLED(c) +#+TODO: TODO(t) STARTED(s) WAITING(w) LGTM(l) | DONE(d) CANCELLED(c) #+TODO: REVIEW(r) | MERGED(m) ABORTED(a) -#+TODO: ACCEPTED(l) CHANGE_REQUESTED(c) QUESTION(q) | REFUSED(r) +#+TODO: ACCEPTED(l) CHANGE_REQUESTED(c) QUESTION(q) FEEDBACK(f) | REFUSED(r) #+COLUMNS: %38ITEM(Details) %TAGS(Context) %7TODO(To Do) %8ASSIGNEE %5Effort(Time){:} #+TAGS: bug(b) doc(d) ops(o) #+STARTUP: content diff --git a/templates/review.org b/templates/review.org index 036d27a..516f0b5 100644 --- a/templates/review.org +++ b/templates/review.org @@ -1,24 +1,9 @@ -* [[file:src/Main.hs::27]] - - Remove the direct usage of the file inside and prefer to load templates. If - possible compressed one. +* FEEDBACK -#+BEGIN_SRC elisp -(org-remember-insinuate) -(define-key global-map "\C-cr" 'org-remember) -(setq org-remember-templates - '(("Code Review High" ?h "* TODO [#A] %?\n %i\n %a" "~/Review.org" "Issues") - ("Code Review Medium" ?m "* TODO [#B] %?\n %i\n %a" "~/Review.org" "Issues") - ("Code Review Low" ?l "* TODO [#C] %?\n %i\n %a" "~/Review.org" "Issues") - ("Code Review Question" ?? "* TODO %?\n %i\n %a" "~/Review.org" "Questions"))) - -(defun my/linenum() - "Use line number as the file linking item" -;; Optionally, predicate this technique to -;; only certain modes -;; e.g. -;; (when (eq major-mode 'cperl-mode) ... - (number-to-string (org-current-line))) -(add-hook 'org-create-file-search-functions - 'my/linenum) -#+END_SRC + [[file:~/y/gpm/gpm::initDocs]] +* QUESTION What about creating a new branch for doc? + [[file:~/y/gpm/gpm::initDocs]] +* FEEDBACK something + [[file:~/y/gpm/gpm::mkNewEmptyBranch%20"gpm"]] +* QUESTION some question + [[file:~/y/gpm/gpm::initDocs]]