;;; vc-pijul.el --- VC backend for Pijul     -*- lexical-binding: t; -*-

;;; Copyright © 2021 Alexandr Vityazev

;; Author: Alexandr Vityazev <avityazev@posteo.org>
;; Keywords: vc tools
;; Homepage: https://git.omarpolo.com/vc-got/
;; Version: 0.1
;; Package-Requires: ((emacs "27.1"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; This file contains a VC backend for the Pijul version
;; control system.
;;

;; USAGE:
;;     pijul <SUBCOMMAND>

;; FLAGS:
;;     -h, --help       Print help information
;;     -V, --version    Print version information

;; SUBCOMMANDS:
;;     add         Adds a path to the tree
;;     apply       Applies changes to a channel
;;     archive     Creates an archive of the repository
;;     change      Shows information about a particular change
;;     channel     Manages different channels
;;     clone       Clones an existing pijul repository
;;     credit      Shows which patch last affected each line of the every file
;;     debug
;;     diff        Shows difference between two channels/changes
;;     fork        Create a new channel
;;     git         Imports a git repository into pijul
;;     help        Print this message or the help of the given subcommand(s)
;;     init        Initializes an empty pijul repository
;;     key         Key management
;;     list        Lists files tracked by pijul
;;     log         Show the entire log of changes
;;     move        Moves a file in the working copy and the tree
;;     pull        Pulls changes from a remote upstream
;;     push        Pushes changes to a remote upstream
;;     record      Creates a new change
;;     remote      Manages remote repositories
;;     remove      Removes a file from the tree of tracked files (`pijul record` will then record
;;                 this as a deletion)
;;     reset       Resets the working copy to the last recorded change
;;     tag         Manage tags (create tags, check out a tag)
;;     unrecord    Unrecords a list of changes

;;; Code:

(defgroup vc-pijul nil
  "VC Pijul backend."
  :version "0.1"
  :group 'vc)

(defcustom vc-pijul-diff-switches t
  "String or list of strings specifying switches for Pijul diff under VC.
If nil, use the value of `vc-diff-switches'.  If t, use no switches."
  :type '(choice (const :tag "Unspecified" nil)
		 (const :tag "None" t)
		 (string :tag "Argument String")
		 (repeat :tag "Argument List" :value ("") string))
  :version "0.1")

(defcustom vc-pijul-program "pijul"
  "Name of the Pijul executable (excluding any arguments)."
  :version "0.1"
  :type 'string)
(defun vc-pijul-root (file)
  "Return the work tree root for FILE, or nil."
  (vc-find-root file ".pijul"))

(provide 'vc-pijul)
;;; vc-pijul.el ends here