Commit graph

265 commits

Author SHA1 Message Date
Juri Linkov
97806bc7de Add diff-mode-read-only to enable shorter keys in diff-mode
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.
2022-01-10 20:29:53 +02:00
Stefan Kangas
d763c12796 Merge from origin/emacs-28
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
2022-01-05 06:30:39 +01:00
Dmitry Gutov
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
* 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.
2022-01-05 04:08:10 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
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
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Lars Ingebrigtsen
9a1e87ba44 Add vc-git-stash-pop to vc-dir-git-mode
* lisp/vc/vc-git.el (vc-dir-git-mode-map): Add vc-git-stash-pop
(bug#52158).
2021-12-07 08:06:16 +01:00
Lars Ingebrigtsen
0dca455d14 Make the Git stash commands available in vc-dir Git buffers
* 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.
2021-12-06 06:41:25 +01:00
Justin Schell
e6a0cfaad5 vc-git--program-version to support Git for macOS version string
`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
2021-12-06 02:27:52 +01:00
Dmitry Gutov
824d31e3bf Remove empty lines from stash read prompt
* lisp/vc/vc-git.el (vc-git-stash-read): Pass OMIT-NULLS (bug#52119).
(vc-git-stash-list): Simplify.
2021-11-26 16:03:30 +03:00
Juri Linkov
2963de6540 * lisp/vc/vc-git.el (vc-git-mergebase): More meaningful error message.
Display a readable error message instead of signaling an error on nil value.
2021-11-10 20:41:19 +02:00
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