Commit graph

255 commits

Author SHA1 Message Date
Jan Synacek
5c1a575ef4 Don't use color escape sequences in vc-git-expanded-log-entry
* lisp/vc/vc-git.el (vc-git-expanded-log-entry): Use '--no-color' flag
in git invocation.  (Bug#51262)

Copyright-paperwork-exempt: yes
2021-10-19 19:45:25 +02:00
Dmitry Gutov
4afff515c8 Expand the full file name
* lisp/vc/vc-git.el (vc-git--literal-pathspec):
Expand the full file name, not just the local part (bug#51112).
2021-10-11 16:43:55 +03:00
Dmitry Gutov
46a2c191f2 Fix vc-annotate-show-log-revision-at-line
* 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.
2021-09-23 14:53:46 +03:00
Stefan Kangas
b2164df86b ; More stylistic docfixes in vc/*.el found by checkdoc 2021-09-18 09:35:29 +02:00
Stefan Kangas
25ebb9374b ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
Dmitry Gutov
108dbed4c0 Re-fix bug#16897
* 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.
2021-09-12 03:29:04 +03:00
Dmitry Gutov
ff2c4a8353 Have Git backend actions accept nil filenames again
* lisp/vc/vc-git.el (vc-git--literal-pathspec):
Move the nil check to the beginning (bug#50422).
2021-09-08 02:33:24 +03:00
Dmitry Gutov
0a18899f06 Fix recently broken vc-delete-file with Git
* lisp/vc/vc-git.el (vc-git-delete-file):
Treat FILE as string, not list (bug#50334).
2021-09-03 03:34:18 +03:00
Dmitry Gutov
d2ad64b7a5 Move the expansion of abbreviated names to vc-git.el
* 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.
2021-08-31 02:47:31 +03:00
Juri Linkov
3360f03926 Revert part of 3572613550 (bug#39452)
* lisp/vc/vc-git.el (vc-git-rename-file): Don't use vc-git--literal-pathspecs.
2021-08-27 20:12:30 +03:00
Dmitry Gutov
4ac29b943b Rename arguments for clarity
* lisp/vc/vc-git.el (vc-git--literal-pathspecs)
(vc-git--literal-pathspecs):
Rename arguments for clarity (bug#39452).
2021-08-26 04:48:05 +03:00
Dmitry Gutov
2b62b2a019 Make sure to remove the remote specification before adding :(literal)
* lisp/vc/vc-git.el (vc-git--literal-pathspec):
Make sure to remove the remote specification from the file name
(bug#50175, bug#39452).
2021-08-26 04:44:21 +03:00
Dmitry Gutov
fd7f2077bc vc-git-region-history: Fix to call 'diff' more correctly
* lisp/vc/vc-git.el (vc-git-region-history):
Fix to pass a list to the backend 'diff' command (bug#39452).
2021-08-17 03:32:12 +03:00
Dmitry Gutov
3502321403 Fix regressions in the last change
* 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.
2021-08-16 03:33:29 +03:00
Wolfgang Scherer
3572613550 Fix vc-git-state for filenames with wildcards
* 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.
2021-08-15 04:22:26 +03:00
Dmitry Gutov
d1dbf7fc9e Revert "Bind the GIT_LITERAL_PATHSPECS environment variable"
This reverts commit a2d0ff2600.

It was found to break a certain use case, and we decided to go with
the other solution (bug#39452).
2021-08-15 03:45:42 +03:00
Dmitry Gutov
a2d0ff2600 Bind the GIT_LITERAL_PATHSPECS environment variable
* lisp/vc/vc-git.el (vc-git-command):
(vc-git--call): Ensure that git interprets file names literally
(bug#39452).
2021-07-22 14:41:52 +02:00
Yan Gajdos
38a62efc15 Make vc-git-mode-line-string more robust
* 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
2021-07-21 23:56:44 +02:00
Dmitry Gutov
86309efb4a Simplify vc-git-log-switches's usage; change default value to nil
* 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.
2021-06-11 04:39:34 +03:00
Utkarsh Singh
4a1e97bea9 New user option for Git log switches
* 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
2021-06-09 02:25:47 +03:00
Stefan Kangas
d47706c552 ; Remove some redundant installation instructions 2021-04-03 12:26:55 +02:00
Stefan Kangas
8b07994e20 Convert many more links to use HTTPS 2021-03-24 10:20:18 +01:00
Stefan Monnier
99340ad17a lisp/vc/*.el: Use lexical-bindings in all the files
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`.
2021-02-26 16:51:15 -05:00
Protesilaos Stavrou
ff16c897ea Refine use of vc-dir faces; apply to all backends
* 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.
2021-02-10 03:38:15 +02:00
Protesilaos Stavrou
9fdc753e14 Add vc-dir faces; also apply them to vc-git
* 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).
2021-02-08 07:54:54 +01:00
Dmitry Gutov
96f20120c9 Also highlight 'conflict' with the warning face
* lisp/vc/vc-git.el (vc-git-dir-printer):
Also highlight 'conflict' with the warning face, like
vc-default-dir-printer does already.
2021-01-30 15:42:19 +02:00
Dmitry Gutov
bbad7904e2 vc-dir-mode-map: Remove the mouse-2 binding
* lisp/vc/vc-dir.el (vc-dir-mode-map):
Remove the mouse-2 binding (bug#13692).
(vc-dir-mode): Update the docstring accordingly.
(vc-dir-status-mouse-map): New variable.
(vc-default-dir-printer): Use it on the state buttons.

* lisp/vc/vc-git.el (vc-git-dir-printer): Same.
2021-01-30 03:56:47 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Juri Linkov
f13ae2bb95 * lisp/vc/vc-git.el: Update args of backend API calls in the header comments
https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg00283.html
2020-12-06 23:19:23 +02:00
Stefan Kangas
5ef30fbf11 Prefer setq-local in vc/*.el
* lisp/vc/add-log.el (find-change-log, change-log-mode):
* lisp/vc/cvs-status.el (cvs-status-mode):
* lisp/vc/diff-mode.el (diff-restrict-view, diff-find-file-name):
(diff-mode, diff-setup-whitespace, diff-apply-hunk):
* lisp/vc/diff.el (diff-no-select):
* lisp/vc/ediff-util.el (ediff-setup):
* lisp/vc/log-edit.el (log-edit, log-edit-mode):
* lisp/vc/log-view.el (log-view-mode):
* lisp/vc/pcvs.el (cvs-temp-buffer, cvs-make-cvs-buffer):
(cvs-update-filter, cvs-mode, cvs-mode-commit)
(cvs-mode-edit-log, cvs-vc-command-advice):
* lisp/vc/smerge-mode.el (smerge-match-conflict):
(smerge-ediff, smerge-mode):
* lisp/vc/vc-annotate.el (vc-annotate-mode):
(vc-annotate, vc-annotate-display):
* lisp/vc/vc-bzr.el (vc-bzr-log-view-mode):
* lisp/vc/vc-dir.el (vc-dir-mode):
* lisp/vc/vc-dispatcher.el (vc-setup-buffer):
(vc-compilation-mode, vc-start-logentry):
* lisp/vc/vc-git.el (vc-git-log-view-mode):
* lisp/vc/vc-hg.el (vc-hg-log-view-mode):
* lisp/vc/vc-hooks.el (vc-refresh-state):
* lisp/vc/vc-mtn.el (vc-mtn-log-view-mode):
* lisp/vc/vc-svn.el (vc-svn-log-view-mode):
* lisp/vc/vc.el (vc-register, vc-diff-internal):
(vc-find-revision-save, vc-find-revision-no-save):
(vc-log-internal-common, vc-region-history): Prefer setq-local.
2020-12-05 08:58:12 +01:00
Dmitry Gutov
c7a3bd9b56 vc-git-root: Remove unnecessary caching
* lisp/vc/vc-git.el (vc-git-root): Simplify (bug#42966).
2020-10-26 23:01:08 +02:00
Andreas Schwab
a9f147af71 Use the full name of the null byte/character, not its abbreviation
* lisp/subr.el (inhibit-nul-byte-detection): Make it an obsolete alias.
* src/coding.c (setup_coding_system): Use original name.
(detect_coding): Rename nul_byte_found => null_byte_found.
(detect_coding_system): Use original name.
Rename nul_byte_found => null_byte_found.
(Fdefine_coding_system_internal): Use original name.
(syms_of_coding): Rename inhibit-nul-byte-detection to
inhibit-null-byte-detection.
* src/w16select.c (get_clipboard_data): Rename nul_char to null_char.
* src/json.c (check_string_without_embedded_nulls): Rename from
check_string_without_embedded_nuls.
(Fjson_parse_string): Adjust accordingly.
* src/coding.h (enum define_coding_undecided_arg_index)
(enum coding_attr_index): Rename ...nul_byte... to ...null_byte....
* lisp/info.el (info-insert-file-contents, Info-insert-dir):
* lisp/international/mule.el (define-coding-system):
* lisp/vc/vc-git.el (vc-git--call):
* doc/lispref/nonascii.texi (Lisp and Coding Systems): Use original name.
2020-10-05 20:19:59 +02:00
Dmitry Gutov
23c20c3968 Don't have vc-git-stash-list bug out on the .git directory
* lisp/vc/vc-git.el (vc-git-stash-list): Don't bug out when
running on the .git directory itself (bug#39285).
2020-09-20 12:12:41 +02:00
Tom Tromey
ed96a2121d Add a variable to control VC completion over branch names
* lisp/vc/vc-git.el (vc-git-revision-complete-only-branches): New
variable (bug#25710).
(vc-git-revision-table): Use it.
2020-08-19 13:38:44 +02:00
Emilio Lopes
991e145450 Notify the user if we errors when querying for registered git files
* lisp/vc/vc-git.el (vc-git-registered): Notify the user when
something fails here (bug#18481).
2020-08-13 10:01:00 +02:00
Juri Linkov
eb9e065c00 * lisp/vc/vc-git.el (vc-git-log-view-mode): Font-lock AuthorDate (bug#40248)
Highlight "AuthorDate" in log-view-font-lock-keywords
when [format] pretty = fuller.
2020-07-29 03:47:29 +03:00
Juri Linkov
bca8686f55 * lisp/vc/vc-git.el (vc-git-log-view-mode): Fix commit regexp (bug#40248)
The regexp 'log-view-message-re' should match e.g. "commit 123456789",
not "CommitDate".
2020-07-24 02:29:12 +03:00
Tassilo Horn
a4f1d681c1 Bind default-directory to given DIR.
Otherwise, "git config branch.<branch>.remote" would return the global
default "origin" instead of the actual, project-specific remote name.

* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Bind default-directory
to given DIR.
2020-06-18 07:55:38 +02:00
Dmitry Gutov
e2f443df17 vc-git-dir-extra-headers: Fix recent breakage
* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Account for
'remote' being set to "" when not found
(https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00582.html).
(vc-git-dir-extra-headers): Check the value of remote-url instead.
2020-06-18 01:09:49 +03:00
Tassilo Horn
1507d61ebc Use vc-git-repository-url in vc-git-dir-extra-headers
* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Use
vc-git-repository-url for getting the remote's URL.
2020-06-15 09:07:12 +02:00
Tassilo Horn
2e80328ba6 Add optional remote-name argument to VC repository-url command
* lisp/vc/vc.el: Document new remote-name argument of VC
repository-url command.
* lisp/vc/vc-git.el (vc-git-repository-url): Add and use new arg.
* lisp/vc/vc-hg.el (vc-hg-repository-url): Add and use new arg.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): Add new arg but ignore
it.
* lisp/vc/vc-svn.el (vc-svn-repository-url): Add new arg but ignore
it.
2020-06-15 08:56:11 +02:00
Tassilo Horn
4f92cf14f3 Add new VC command `repository-url'
* lisp/vc/vc.el: Document repository-url command.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): New defun.
* lisp/vc/vc-git.el (vc-git-repository-url): New defun.
* lisp/vc/vc-hg.el (vc-hg-repository-url): New defun.
* lisp/vc/vc-svn.el (vc-svn-repository-url): New defun.
2020-06-14 21:37:26 +02:00
Dmitry Gutov
c67f8f298a Implement 'mark-resolved' for the Git backend
* lisp/vc/vc-git.el (vc-git-mark-resolved): New function.
2020-05-23 05:08:06 +03:00
Glenn Morris
d672ad60e3 Merge from origin/emacs-27
0e936f18f8 (origin/emacs-27) Fix build failure with --with-cairo --wi...
c34f7e884b Add new node "Package Statuses" to manual
fdee034ac8 * lisp/isearch.el: Fix corner cases of isearch-lazy-count.
7b14329d86 ; * lisp/simple.el (messages-buffer): Doc fix.  (Bug#39124)
7ec66a59e3 Document spacing issues with Xft for some fonts
08cd247fbd ; * etc/NEWS: Fix typo.
d645628e3c Always use lexical-binding in lisp-interaction-mode (bug#3...
c42198f78c ; *etc/NEWS: Fix typo.
0ed9cfa7dc vc-dir: ensure we don't use a pager with git
37e0d00c14 Improve ERC's matching of nicks and URLs (bug#38257)
d47b157969 Handle tab-bar clicks on a GPM-capable console.
e4791f3f8e ;* etc/TODO: Update.

# Conflicts:
#	etc/NEWS
2020-01-15 07:50:22 -08:00
Robert Pluim
0ed9cfa7dc vc-dir: ensure we don't use a pager with git
* lisp/vc/vc-git.el (vc-git--call): Call git with '--no-pager' to
avoid hangs caused by remote pager settings (Bug#38688).
2020-01-13 09:26:41 +01:00
Paul Eggert
c6fb86b40b Merge from origin/emacs-27
186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3
4cd143aded Fix copyright years by hand
365e01cc9f Update copyright year to 2020
cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac...

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
2020-01-01 01:08:16 +00:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Mattias Engdegård
af085ef40b Use regexp type for regexps in defcustom declarations
* lisp/calendar/diary-lib.el (diary-face-attrs):
* lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-file-match):
* lisp/cedet/srecode/document.el
(srecode-document-autocomment-common-nouns-abbrevs)
(srecode-document-autocomment-function-alist)
(srecode-document-autocomment-return-first-alist)
(srecode-document-autocomment-return-last-alist)
(srecode-document-autocomment-param-alist)
(srecode-document-autocomment-param-type-alist):
* lisp/desktop.el (desktop-clear-preserve-buffers):
* lisp/elide-head.el (elide-head-headers-to-hide):
* lisp/erc/erc-backend.el (erc-encoding-coding-alist):
* lisp/erc/erc-ezbounce.el (erc-ezb-regexp):
* lisp/files.el (auto-save-file-name-transforms):
* lisp/gnus/deuglify.el (gnus-outlook-deuglify-attrib-cut-regexp)
(gnus-outlook-deuglify-attrib-verb-regexp)
(gnus-outlook-deuglify-attrib-end-regexp):
* lisp/gnus/gnus-fun.el (gnus-x-face-omit-files, gnus-face-omit-files):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header):
* lisp/htmlfontify.el (hfy-src-doc-link-unstyle):
* lisp/info-look.el (info-lookup-file-name-alist):
* lisp/international/rfc1843.el (rfc1843-newsgroups-regexp):
* lisp/mail/feedmail.el (feedmail-queue-slug-suspect-regexp):
* lisp/mail/rmail-spam-filter.el (rsf-white-list, rsf-definitions-alist):
* lisp/man.el (Man-name-local-regexp):
* lisp/net/ange-ftp.el (ange-ftp-dumb-unix-host-regexp):
* lisp/net/newst-backend.el (newsticker-auto-mark-filter-list):
* lisp/net/rcirc.el (rcirc-authinfo, rcirc-coding-system-alist):
* lisp/net/tramp-adb.el (tramp-adb-prompt):
* lisp/org/org-agenda.el (org-agenda-hide-tags-regexp)
(org-agenda-category-icon-alist):
* lisp/org/org-protocol.el (org-protocol-data-separator):
* lisp/org/org-table.el (org-table-number-regexp):
* lisp/org/ox-latex.el (org-latex-known-warnings):
* lisp/progmodes/bug-reference.el (bug-reference-bug-regexp):
* lisp/progmodes/hideif.el (hide-ifdef-header-regexp):
* lisp/progmodes/idlw-help.el (idlwave-help-doclib-name)
(idlwave-help-doclib-keyword):
* lisp/progmodes/idlwave.el (idlwave-no-change-comment):
* lisp/progmodes/python.el (python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps, python-shell-prompt-regexp)
(python-shell-prompt-block-regexp, python-shell-prompt-output-regexp)
(python-shell-prompt-pdb-regexp, python-shell-compilation-regexp-alist)
(python-pdbtrack-stacktrace-info-regexp):
* lisp/progmodes/sql.el (sql-send-terminator, sql-ansi-statement-starters):
* lisp/speedbar.el (speedbar-directory-unshown-regexp)
(speedbar-file-unshown-regexp):
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-exceptions)
(flyspell-tex-command-regexp):
* lisp/textmodes/paragraphs.el (sentence-end-base):
* lisp/textmodes/tildify.el (tildify-pattern, tildify-space-pattern):
* lisp/vc/ediff-init.el (ediff-metachars):
* lisp/vc/vc-git.el (vc-git-root-log-format):
* lisp/vc/vc-hg.el (vc-hg-root-log-format):
* lisp/whitespace.el (whitespace-indentation-regexp)
(whitespace-space-after-tab-regexp):
* lisp/woman.el (woman-manpath-man-regexp)
(woman-imenu-generic-expression):
Use 'regexp' instead of 'string' as type for values that are regexps
in defcustom declarations.
2019-12-26 16:50:58 +01:00
Andrii Kolomoiets
1a2445c45f Make ls-files-unknown only return proper files, not directories
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage):
Make ls-files-unknown only return proper files, not directories
(bug#38615).
2019-12-17 01:50:09 +02:00
Dmitry Gutov
77fe255d90 vc-git-after-dir-status-stage: Avoid erroneous up-to-date status
* lisp/vc/vc-git.el (vc-git-after-dir-status-stage):
Don't set `up-to-date' status if the previous stage (`diff-index')
has assigned some other status to the file (bug#38615).
2019-12-17 01:50:09 +02:00