summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-git.el
Commit message (Collapse)AuthorAgeFilesLines
* Tweak window handling in vc-pull-and-pushLars Ingebrigtsen2022-09-241-2/+2
| | | | | | | | | | * lisp/vc/vc-dispatcher.el (vc--inhibit-async-window): Rename variable. (vc-do-async-command): Allow inhibiting all window changes. * lisp/vc/vc-git.el (vc-git-pull-and-push): Don't pop up the window asynchronously on the "pull" because that gets in the way of doing other things.
* ; Drop two obsolete defvarsSean Whitton2022-09-241-1/+0
| | | | | * lisp/vc/vc-git.el (vc-want-edit-command-p) * lisp/vc/vc.el (vc-want-edit-command-p): Drop obsolete defvar.
* Generalize & simplify implementation of user edits to VC commandsSean Whitton2022-09-241-13/+13
| | | | | | | | | | | * lisp/vc/vc-dispatcher.el (vc-pre-command-functions) (vc-want-edit-command-p): Delete. (vc-filter-command-function): New variable. (vc-user-edit-command): Factor out of vc-do-command. (vc-do-command, vc-do-async-command) * lisp/vc/vc-git.el (vc-git--pushpull) * lisp/vc/vc.el (vc-print-branch-log): Use vc-filter-command-function in place of vc-pre-command-functions and vc-want-edit-command-p.
* Add a new command vc-pull-and-pushLars Ingebrigtsen2022-09-241-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-svn.el (vc-exec-after): * lisp/vc/vc-hg.el (vc-exec-after): * lisp/vc/vc-git.el (vc-exec-after): * lisp/vc/vc-cvs.el (vc-exec-after): * lisp/vc/vc-bzr.el (vc-exec-after): * lisp/org/org-macro.el (vc-exec-after): * lisp/obsolete/vc-mtn.el (vc-exec-after): * lisp/obsolete/vc-arch.el (vc-exec-after): Update declaration. * lisp/vc/vc-dispatcher.el (vc--process-sentinel): Allow running code only on success. (vc-exec-after): Ditto. (vc--inhibit-change-window-start): New variable. (vc-do-async-command): Use it to allow chaining commands without moving window point. Return the process instead of the buffer, since the process may have exited already, and then we can't get at the process. * lisp/vc/vc-git.el (vc-git--pushpull): Return the process object. (vc-git-pull-and-push): New function. * lisp/vc/vc.el (vc-pull-and-push): New command (bug#51964).
* vc-git--pushpull: Restore handling of vc-git-programSean Whitton2022-09-231-4/+7
| | | | | | | * lisp/vc/vc-git.el (vc-git--pushpull): Restore handling of vc-git-program before recent change: respect a buffer-local value of vc-git-program, and don't ignore user edits to the git program name when PROMPT.
* Add support for user edits to VC command argumentsSean Whitton2022-09-211-18/+13
| | | | | | | | | | | | | | * lisp/vc/vc-dispatcher.el (vc-pre-command-functions): New hook. (vc-want-edit-command-p): New variable. (vc-do-command): If vc-want-edit-command-p is non-nil, prompt the user to edit the VC command & arguments before execution. Run the new hook. (vc-do-async-command): Use the new hook to insert into BUFFER the command that's next to be run. * lisp/vc/vc-git.el (vc-git--pushpull): Drop prompting code. Bind vc-want-edit-command-p so that vc-do-command handles the prompting. Use the new hook to update compile-command with the edited command. * lisp/vc/vc.el (vc-print-branch-log): A non-nil prefix argument now means vc-want-edit-command-p is bound to a non-nil value (bug#57807).
* Don't use autoloaded functions for safe-local-variableLars Ingebrigtsen2022-09-161-13/+6
| | | | | | | | | | | | * doc/lispref/symbols.texi (Standard Properties): Clarify how safe-local-variable should look. * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words) (checkdoc-symbol-words): Use list-of-strings-p. (checkdoc-list-of-strings-p): Obsolete. * lisp/vc/vc-git.el (vc-git-annotate-switches): Remove. (vc-git-annotate-switches): Open-code the check.
* Speed up Emacs build by autoloading vc-git-annotate-switches-safe-pLars Ingebrigtsen2022-09-141-4/+8
| | | | | * lisp/vc/vc-git.el (vc-git-annotate-switches-safe-p): Put the definition into the loaddefs file.
* 'C-x v b' prefix key is used for branch commands to create/switch/print branchJuri Linkov2022-09-121-5/+17
| | | | | | | | | | | | | | | | * lisp/vc/vc.el (vc-create-branch): New command. (vc-retrieve-tag): Add new optional arg 'branchp'. (vc-switch-branch): New command (bug#50344). * lisp/vc/vc-hooks.el (vc-prefix-map): Bind "b c" to vc-create-branch, "b l" to vc-print-branch-log, "b s" to vc-switch-branch. Remove obsolete and suppressed "b" from vc-switch-backend. * lisp/vc/vc-dir.el (vc-dir-mode-map): Rebind 'branch-map' from "B" to "b" for consistency with 'vc-prefix-map'. * lisp/vc/vc-git.el (vc-git-create-tag): For a new branch read its start-point. Ask a confirmation if modified files exist.
* Accept "-w" as safe value for vc-git-annotate-switchesStefan Kangas2022-09-101-0/+9
| | | | | | | * lisp/vc/vc-git.el (vc-git-annotate-switches-safe-p): New predicate function. (vc-git-annotate-switches): Use above new predicate function to check if it's :safe.
* ; Document that a value of any other type means no highlightingSean Whitton2022-09-051-0/+2
| | | | | | * lisp/vc/vc-git.el (vc-git-log-edit-summary-target-len) (vc-git-log-edit-summary-max-len): Document that a value of any other type means no highlighting.
* Font lock long Git commit summary linesSean Whitton2022-09-051-1/+63
| | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git-log-edit-summary-target-len) (vc-git-log-edit-summary-max-len): New defcustoms. (vc-git-log-edit-summary-target-warning) (vc-git-log-edit-summary-max-warning): New faces. (vc-git--log-edit-summary-check): New function. (vc-git-log-edit-mode): Add vc-git--log-edit-summary-check to log-edit-font-lock-keywords to font lock long Git commit summary lines. * etc/NEWS (VC): Document the change. * .dir-locals.el: Set vc-git-log-edit-summary-target-len.
* 'C-x v v' on a diff buffer commits it as a patch (bug#52349)Juri Linkov2022-08-281-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-vc-deduce-fileset): New function. * lisp/vc/log-edit.el (log-edit-diff-patch): New function. * lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function to log-edit-diff-patch when vc-patch-string is non-nil. (vc-start-logentry): New optional arg 'patch-string'. Set buffer-local 'vc-patch-string' to 'patch-string'. (vc-dispatcher-browsing): Add (derived-mode-p 'diff-mode). * lisp/vc/vc-git.el (vc-git-checkin-patch): New function. (vc-git-checkin): When vc-git-patch-string is non-nil, use `git apply --cached` to add the patch to the index, then commit the staged changes. * lisp/vc/vc.el: New backend function 'checkin-patch'. (vc-deduce-fileset-1): Call diff-vc-deduce-fileset in diff-mode. (vc-next-action): For model 'patch' call vc-checkin with the diff buffer string. (vc-checkin): New optional arg 'patch-string'. Call backend function 'checkin-patch' when 'patch-string' is non-nil. Call vc-start-logentry with 'patch-string'. (vc-diff-patch-string): New function.
* Prefer defvar-keymap in vc/*.elStefan Kangas2022-08-101-32/+25
| | | | | | | | | | | | | | * lisp/vc/add-log.el (change-log-mode-map): * lisp/vc/ediff-mult.el (ediff-dir-diffs-buffer-map): * lisp/vc/vc-annotate.el (vc-annotate-mode-map): * lisp/vc/vc-bzr.el (vc-bzr-shelve-map): * lisp/vc/vc-dir.el (vc-dir-status-mouse-map) (vc-dir-filename-mouse-map): * lisp/vc/vc-git.el (vc-git-stash-shared-map, vc-git-stash-map) (vc-git-stash-button-map, vc-git-log-edit-mode-map): * lisp/vc/vc-hg.el (vc-hg-log-edit-mode-map) (vc-hg-extra-menu-map): * lisp/vc/vc-hooks.el (vc-prefix-map): Prefer defvar-keymap.
* ; Fix mistakes in 'declare function' formsEli Zaretskii2022-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/gdb-mi.el (tooltip-show): * lisp/vc/vc-git.el (grep-expand-template): * lisp/cedet/semantic/imenu.el (pulse-momentary-highlight-one-line): * lisp/mail/feedmail.el (smtpmail-via-smtp): * lisp/mail/rmail.el (rmail-mime-entity-truncated): * lisp/mail/rmailsum.el (rmail-cease-edit): * lisp/progmodes/gud.el (speedbar-toggle-line-expansion) (speedbar-edit-line): * lisp/autoinsert.el (sgml-tag): * lisp/comint.el (url-host, url-type, url-filename): * lisp/progmodes/elisp-mode.el (xref-make, xref-item-location): * lisp/vc/vc-hooks.el (vc-responsible-backend): * lisp/cedet/semantic/complete.el (tooltip-show): * lisp/doc-view.el (tooltip-show): * lisp/follow.el (mwheel-scroll): * lisp/term/pgtk-win.el (pgtk-set-resource): * lisp/progmodes/cperl-mode.el (Info-find-node): * lisp/lpr.el (print-region-function): * lisp/w32-fns.el (w32-version, w32-read-registry): * lisp/emacs-lisp/checkdoc.el (ispell-correct-p, checkdoc-dired): * lisp/progmodes/xref.el (apropos-parse-pattern): * lisp/cus-edit.el (apropos-parse-pattern): * lisp/obsolete/gs.el (x-change-window-property): * lisp/x-dnd.el (x-change-window-property): * lisp/xwidget.el (make-xwidget): * lisp/transient.el (info, Man-find-section, Man-next-section) (Man-getpage-in-background): * lisp/frame.el (x-device-class, pgtk-device-class): * lisp/textmodes/texinfo.el (flymake--log-1): * lisp/term/x-win.el (x-internal-focus-input-context): Fix 'declare function' errors uncovered by 'check-declare'.
* Add diff-mode-read-only to enable shorter keys in diff-modeJuri Linkov2022-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | To be able to use outline-minor-mode-cycle keys in diff-mode, outline-minor-mode should be higher in minor-mode-map-alist, and a new variable diff-mode-read-only should be set when the diff-mode buffer is read-only. https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg00740.html * lisp/vc/diff-mode.el: Add diff-mode-read-only to minor-mode-map-alist. (diff-mode-read-only): New buffer-local variable. (diff-mode): Set diff-mode-read-only to t when buffer-read-only is non-nil. Update diff-mode-read-only in read-only-mode-hook. Remove buffer-read-only from minor-mode-overriding-map-alist. Remove view-mode-hook because now view-mode is higher than diff-mode-read-only in minor-mode-map-alist. * lisp/vc/vc-git.el (vc-git-stash-show): * lisp/vc/vc.el (vc-diff-internal): Set buffer-read-only to t before calling diff-mode that will set diff-mode-read-only.
* Merge from origin/emacs-28Stefan Kangas2022-01-051-39/+35
|\ | | | | | | | | | | | | | | e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el c0cfbca311 * lisp/emacs-lisp/checkdoc.el (bytecomp): Add missing require # Conflicts: # etc/NEWS
| * Fix vc-git with old Git over Tramp and cygwin-mount.elDmitry Gutov2022-01-051-39/+35
| | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git-use-literal-pathspecs): New variable. (vc-git-command, vc-git--call): Use it to determine whether to set GIT_LITERAL_PATHSPECS=1 (bug#51497). (vc-git--literal-pathspec, vc-git--literal-pathspecs): Remove. Update all callers. This reverts the previous solution for bug#39452. * lisp/progmodes/project.el (project--vc-list-files): Use the new variable.
* | Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Add vc-git-stash-pop to vc-dir-git-modeLars Ingebrigtsen2021-12-071-1/+2
| | | | | | | | | | * lisp/vc/vc-git.el (vc-dir-git-mode-map): Add vc-git-stash-pop (bug#52158).
* | Make the Git stash commands available in vc-dir Git buffersLars Ingebrigtsen2021-12-061-0/+10
| | | | | | | | | | | | | | * lisp/vc/vc-dir.el (vc-dir): Call the backend-specific minor mode if it exists. * lisp/vc/vc-git.el (vc-dir-git-mode-map): New map. (vc-dir-git-mode): New minor mode.
* | vc-git--program-version to support Git for macOS version stringJustin Schell2021-12-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | `git version` on macOS returns e.g., "git version 2.30.1 (Apple Git-130)" and `vc-git--program-version` currently returns "0" instead of "2.30.1". * lisp/vc/vc-git.el (vc-git--program-version): Ignore text after the version number when parsing git versions (bug#52172). Copyright-paperwork-exempt: yes
* | Remove empty lines from stash read promptDmitry Gutov2021-11-261-7/+6
|/ | | | | * lisp/vc/vc-git.el (vc-git-stash-read): Pass OMIT-NULLS (bug#52119). (vc-git-stash-list): Simplify.
* * lisp/vc/vc-git.el (vc-git-mergebase): More meaningful error message.Juri Linkov2021-11-101-1/+4
| | | | Display a readable error message instead of signaling an error on nil value.
* Don't use color escape sequences in vc-git-expanded-log-entryJan Synacek2021-10-191-1/+1
| | | | | | | * lisp/vc/vc-git.el (vc-git-expanded-log-entry): Use '--no-color' flag in git invocation. (Bug#51262) Copyright-paperwork-exempt: yes
* Expand the full file nameDmitry Gutov2021-10-111-6/+5
| | | | | * lisp/vc/vc-git.el (vc-git--literal-pathspec): Expand the full file name, not just the local part (bug#51112).
* Fix vc-annotate-show-log-revision-at-lineDmitry Gutov2021-09-231-0/+8
| | | | | | | | * lisp/vc/vc-annotate.el (vc-annotate-show-log-revision-at-line): Stop from being affected by 'vc-git-print-log-follow'. * lisp/vc/vc-git.el (vc-git-print-log-follow): Mention caveats in a comment.
* ; More stylistic docfixes in vc/*.el found by checkdocStefan Kangas2021-09-181-4/+3
|
* ; More minor docfixes found by checkdocStefan Kangas2021-09-141-1/+1
|
* Re-fix bug#16897Dmitry Gutov2021-09-121-10/+14
| | | | | | * lisp/vc/vc-git.el (vc-git--file-list-is-rootdir): Extract from 'vc-git-command'. (vc-git--literal-pathspecs): Use it here as well.
* Have Git backend actions accept nil filenames againDmitry Gutov2021-09-081-5/+6
| | | | | * lisp/vc/vc-git.el (vc-git--literal-pathspec): Move the nil check to the beginning (bug#50422).
* Fix recently broken vc-delete-file with GitDmitry Gutov2021-09-031-1/+1
| | | | | * lisp/vc/vc-git.el (vc-git-delete-file): Treat FILE as string, not list (bug#50334).
* Move the expansion of abbreviated names to vc-git.elDmitry Gutov2021-08-311-1/+5
| | | | | | | | | * lisp/vc/vc-git.el (vc-git--literal-pathspec): Perform the expansion of abbreviated file names here instead (bug#39452). * lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Undo the recent change.
* Revert part of 3572613550f5d1d0b3392dbc809b32f3989e2981 (bug#39452)Juri Linkov2021-08-271-1/+1
| | | | * lisp/vc/vc-git.el (vc-git-rename-file): Don't use vc-git--literal-pathspecs.
* Rename arguments for clarityDmitry Gutov2021-08-261-8/+8
| | | | | | * lisp/vc/vc-git.el (vc-git--literal-pathspecs) (vc-git--literal-pathspecs): Rename arguments for clarity (bug#39452).
* Make sure to remove the remote specification before adding :(literal)Dmitry Gutov2021-08-261-1/+1
| | | | | | * lisp/vc/vc-git.el (vc-git--literal-pathspec): Make sure to remove the remote specification from the file name (bug#50175, bug#39452).
* vc-git-region-history: Fix to call 'diff' more correctlyDmitry Gutov2021-08-171-1/+1
| | | | | * lisp/vc/vc-git.el (vc-git-region-history): Fix to pass a list to the backend 'diff' command (bug#39452).
* Fix regressions in the last changeDmitry Gutov2021-08-161-1/+1
| | | | | | | | | | * lisp/vc/vc-git.el (vc-git-register): Use file names verbatim with 'git update-index', as it only accepts file names, not pathspecs (bug#39452). * lisp/vc/vc.el (vc-print-root-log): Expand ROOTDIR, so that vc-git-print-log doesn't receive an abbreviated name. Literal pathspecs don't work with those.
* Fix vc-git-state for filenames with wildcardsWolfgang Scherer2021-08-151-27/+36
| | | | | | | | | | | | | | * lisp/vc/vc-git.el: (vc-git--literal-pathspec-inner), (vc-git--literal-pathspec), (vc-git--literal-pathspecs) new functions to add ":(literal)" pathspec magic (bug#39452). (vc-git-registered), (vc-git-state), (vc-git-dir-status-goto-stage), (vc-git-register), (vc-git-unregister), (vc-git-checkin), (vc-git-find-revision), (vc-git-checkout), (vc-git-revert), (vc-git-conflicted-files), (vc-git-print-log), (vc-git-diff), (vc-git-previous-revision), (vc-git-next-revision), (vc-git-delete-file), (vc-git-rename-file) functions vc-git--literal-pathspec, vc-git--literal-pathspecs applied.
* Revert "Bind the GIT_LITERAL_PATHSPECS environment variable"Dmitry Gutov2021-08-151-2/+0
| | | | | | | This reverts commit a2d0ff26005c5c10ffe0d84bd8b458a06828be82. It was found to break a certain use case, and we decided to go with the other solution (bug#39452).
* Bind the GIT_LITERAL_PATHSPECS environment variableDmitry Gutov2021-07-221-0/+2
| | | | | | * lisp/vc/vc-git.el (vc-git-command): (vc-git--call): Ensure that git interprets file names literally (bug#39452).
* Make vc-git-mode-line-string more robustYan Gajdos2021-07-211-1/+1
| | | | | | | | | * lisp/vc/vc-git.el (vc-git-mode-line-string): Make function more robust (bug#49683). It could previously error out under certain conditions, like moving directories in and out of the VC-controlled tree. Copyright-paperwork-exempt: yes
* Simplify vc-git-log-switches's usage; change default value to nilDmitry Gutov2021-06-111-6/+6
| | | | | | | * lisp/vc/vc-git.el (vc-git-log-switches): Do not mention or allow the value 't' anymore (https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00452.html). (vc-git-print-log): Use 'vc-git-log-switches' directly.
* New user option for Git log switchesUtkarsh Singh2021-06-091-2/+10
| | | | | | | | | * lisp/vc/vc-git.el (vc-git-diff-switches): New defcustom. (vc-git-print-log): Use it. * etc/NEWS: Announce the new option. Copyright-paperwork-exempt: yes
* ; Remove some redundant installation instructionsStefan Kangas2021-04-031-8/+0
|
* Convert many more links to use HTTPSStefan Kangas2021-03-241-1/+1
|
* lisp/vc/*.el: Use lexical-bindings in all the filesStefan Monnier2021-02-261-31/+32
| | | | | | | | | | | | | | | | | | | | | | Also remove some redundant `:group` arguments. * lisp/vc/vc.el (vc-ignore): Autoload. * lisp/vc/pcvs-util.el (cvs-every, cvs-union, cvs-map): Delete functions. * lisp/vc/cvs-status.el: Require `cl-lib` at runtime. (cvs-tree-tags-insert): Use `cl-mapcar` and `cl-every` instead. * lisp/vc/pcvs.el: Require `cl-lib` at runtime. (cvs-do-removal): Use `cl-every` instead. * lisp/vc/ediff-init.el: Require `ediff-util` (for `ediff-cleanup-mess` and `ediff-default-suspend-function`). * lisp/vc/pcvs-info.el (cvs-fileinfo<): Remove unused vars `subtypea` and `subtypeb`. * lisp/vc/vc-git.el: * lisp/vc/vc-bzr.el: Require `vc-dispatcher` at runtime for `vc-do-async-command`.
* Refine use of vc-dir faces; apply to all backendsProtesilaos Stavrou2021-02-101-2/+3
| | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-dir.el (vc-default-dir-printer): Add check for the "ignored" status and make 'vc-dir-status-edited' the default face. Also extend condition for more states that qualify as "warnings". (vc-dir-ignored, vc-dir-status-ignored): Rename face for consistency. * lisp/vc/vc-git.el (vc-git-dir-printer): Use the 'vc-dir-status-edited' as the default for the Git backend. And reference the renamed face. Also stop treating the empty stash differently from other header values. * lisp/vc/vc-bzr.el (vc-bzr-dir-extra-headers): Implement new faces. * lisp/vc/vc-cvs.el (vc-cvs-dir-extra-headers): Same. * lisp/vc/vc-hg.el (vc-hg-dir-extra-headers): Same. * lisp/vc/vc-svn.el (vc-svn-dir-extra-headers): Same. This follows from the discussion in bug#46358.
* Add vc-dir faces; also apply them to vc-gitProtesilaos Stavrou2021-02-081-19/+18
| | | | | | | | | | | | * etc/NEWS: Document the new faces. * lisp/vc/vc-dir.el (vc-dir-header, vc-dir-header-value) (vc-dir-directory, vc-dir-file, vc-dir-mark-indicator) (vc-dir-status-warning, vc-dir-status-edited, vc-dir-status-up-to-date) (vc-dir-ignored): Add new faces. * lisp/vc/vc-git.el (vc-git-permissions-as-string, vc-git-dir-printer) (vc-git-dir-extra-headers): Apply new faces (bug#46358).