[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit to commit staged changes |
Date: |
Thu, 9 Sep 2021 15:58:35 -0400 (EDT) |
branch: externals/vc-got
commit daae979d49408c97d6ed40de4a1aad4c2304c91d
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
implement vc-got-stage-commit to commit staged changes
---
vc-got-stage.el | 18 ++++++++++++++++++
vc-got.el | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/vc-got-stage.el b/vc-got-stage.el
index 489c18f..461b819 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -25,12 +25,14 @@
;;; Code:
+(require 'log-edit)
(require 'rx)
(require 'vc)
(defvar vc-got-program) ;vc-got.el
(declare-function vc-got--diff "vc-got")
(declare-function vc-got--unstage "vc-got" (file))
+(declare-function vc-got-checkin "vc-got" (fileset comment))
(defvar vc-got-stage--process nil
"The got stage process.")
@@ -127,5 +129,21 @@ If FILESET is nil, show the diff for every staged hunks."
(vc-got--diff "-s" file))
(vc-got--diff "-s")))))
+(defun vc-got-stage-commit ()
+ "Commit staged hunks."
+ (interactive)
+ (let ((buf (get-buffer-create "*vc-got-stage-commit*")))
+ (pop-to-buffer buf)
+ (log-edit (lambda ()
+ (interactive)
+ (let ((msg (buffer-substring-no-properties (point-min)
+ (point-max))))
+ (kill-buffer)
+ (vc-got-checkin nil msg)))
+ t
+ ;; TODO: add here an alist of
+ ;; '((vc-log-fileset . (staged-files)))
+ )))
+
(provide 'vc-got-stage)
;;; vc-got-stage.el ends here
diff --git a/vc-got.el b/vc-got.el
index 32a11f7..f088f2d 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -447,6 +447,10 @@ tree."
(defalias 'vc-got-responsible-p #'vc-got-root)
+;; XXX: generally speaking, files cannot be nil. But we have to
+;; handle that case too, because vc-got-stage-commit will call
+;; vc-got-checking with fileset nil to commit the current staged
+;; hunks.
(defun vc-got-checkin (files comment &optional _rev)
"Commit FILES with COMMENT as commit message."
(with-temp-buffer
- [elpa] externals/vc-got 2d83de2 074/145: implement vc-got-dir-printer, (continued)
- [elpa] externals/vc-got 2d83de2 074/145: implement vc-got-dir-printer, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 43c93a8 063/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6eea6cf 075/145: drop unnecessary `:group's directive in defcustom, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8ed796d 062/145: vc-got-dir-status-files: show changes in subdirs, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ffa81a1 067/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6b6c8a7 064/145: fundamentals for staging changes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 93562d9 073/145: fix default directory during stage operation, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 67332ba 076/145: docs fixes, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5b4a6b9 069/145: more docs, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a323f60 071/145: show list of files when committing staged stuff, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit to commit staged changes,
ELPA Syncer <=
- [elpa] externals/vc-got dcb5b83 083/145: extract the filtering to its own function, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 76d978f 082/145: minor tweaks, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got cb97383 085/145: ignore ignored files but not up-to-date ones, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 445e2bd 087/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2d039a2 089/145: fix vc-dir listing on sub-directories, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 2b7241a 086/145: revamp readme, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5fb2f47 099/145: implement revision-completion-table, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 0a3316a 091/145: implement log-view-mode, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 8014bde 101/145: implement half create-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got e9a5df0 098/145: make vc-annotate-show-diff-revision-at-line works, ELPA Syncer, 2021/09/09