aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/vc-git.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* New 'log-outstanding' value for vc-log-view-typeSean Whitton2026-02-271-1/+2
| | | | | | | | | | This fixes vc-hg-print-log's choice of -r arguments to 'hg log'. * lisp/vc/vc.el (vc-log-view-type): New 'log-outstanding' value. (vc-log-outstanding): Pass it. * lisp/vc/vc-git.el (vc-git-log-view-mode): * lisp/vc/vc-hg.el (vc-hg-print-log, vc-hg-log-view-mode): Treat 'log-outstanding' the same as 'log-outgoing'.
* Fix VC Git error when patch matches staged changesPaul Nelson2026-02-231-1/+1
| | | | | | | | * lisp/vc/vc-git.el (vc-git--checkin): Check that patch-string is not empty before applying it. This prevents an error when the patch exactly matches the index (bug#80228). * test/lisp/vc/vc-git-tests.el (vc-git-test-checkin-patch-staged-diff): New test.
* Show "committing" pseudo-state in VC-Dir during an async checkinSean Whitton2026-02-201-5/+11
| | | | | | | | | | | | * lisp/vc/vc-dir.el (vc-dir-fileinfo): New 'display-state' field. (vc-dir-update): Use it. (vc-default-dir-printer): * lisp/vc/vc-git.el (vc-git-dir-printer): Use it. Fontify a display state of "committing" as vc-dir-status-warning. * lisp/vc/vc-hooks.el (vc--file-getinheprop): New function. * lisp/vc/vc.el (vc-checkin): Set "committing" display state on items we are checking in asynchronously.
* New 'delete-files' VC backend function for faster mass deletionsSean Whitton2026-02-181-0/+3
| | | | | | * lisp/vc/vc-git.el (vc-git-delete-files): * lisp/vc/vc-hg.el (vc-hg-delete-files): New functions. * lisp/vc/vc.el (vc-delete-file): Use them.
* vc-git-pull, vc-git-incoming-revision: Use push remotesSean Whitton2026-02-181-4/+18
| | | | | | * lisp/vc/vc-git.el (vc-git-pull, vc-git-incoming-revision): Use configured push remotes. * etc/NEWS: Announce change to vc-git-pull.
* Improve vc-git-topic-outgoing-base fallback algorithmSean Whitton2026-02-141-9/+22
| | | | | | | | | | | | | | * lisp/vc/vc-hg.el (vc-hg--bookmarks): New function. (vc-hg-trunk-or-topic-p): * lisp/vc/vc-git.el (vc-git--branch-remotes) (vc-git-trunk-or-topic-p): New optional BRANCH argument. (vc-trunk-or-topic-p): Declare. (vc-git-topic-outgoing-base): Consider only local trunks, if there are any (bug#80006). * lisp/vc/vc.el (trunk-or-topic-p): New optional BRANCH argument. (vc-trunk-or-topic-p): New function. (vc--outgoing-base): Call it.
* ; vc-git-topic-outgoing-base: Preparatory refactoring.Sean Whitton2026-02-131-33/+70
| | | | No intentional functional change.
* vc-git--deduce-files-for-stash: Use file-relative-name (bug#80278)Sean Whitton2026-02-101-3/+3
| | | | | * lisp/vc/vc-git.el (vc-git--deduce-files-for-stash): Use file-relative-name (bug#80278).
* Separate input histories for 'C-x v !' and Git pulling & pushingSean Whitton2026-02-061-1/+3
| | | | | | | | | | * lisp/vc/vc-dispatcher.el (vc-user-edit-command-history): Use this as a dynamically bound variable, not a minibuffer history. (vc-user-edit-command): Pass its value to read-shell-command. * lisp/vc/vc-git.el (vc-git--pushpull): * lisp/vc/vc.el (vc-edit-next-command): Bind it. (vc-edit-next-command-history): New variable. * etc/NEWS: Document the change.
* vc-git--mailinfo: Use file-local-name (bug#80295, bug#80320)Visuwesh2026-02-051-1/+3
| | | | | * lisp/vc/vc-git.el (vc-git--mailinfo): Use file-local-name (bug#80295, bug#80320).
* Make diff-hunk-kill respect an active regionSean Whitton2026-01-301-1/+1
| | | | | | | | | | * lisp/vc/diff-mode.el (diff--revert-kill-hunks): New workhorse routine. (diff-hunk-kill, diff-revert-and-kill-hunk): Call it. (diff-hunk-kill): New BEG and END parameters and interactive form. * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the change.
* ; vc-git-topic-outgoing-base: Merge let into if-let*.Sean Whitton2026-01-301-32/+32
|
* vc-git-topic-outgoing-base: Respect a configure push remoteSean Whitton2026-01-301-40/+47
| | | | | * lisp/vc/vc-git.el (vc-git-topic-outgoing-base): If there is a configured push remote, return tracking branch as outgoing base.
* ; Fix last change.Sean Whitton2026-01-301-1/+3
|
* Factor out vc-git--branch-remotesSean Whitton2026-01-301-15/+27
| | | | | | | * lisp/vc/vc-git.el (vc-git--branch-remotes): New function. (vc-git-trunk-or-topic-p): Use it. * test/lisp/vc/vc-git-tests.el (vc-git-test-branch-remotes): New test.
* Automatically detect the VC outgoing base (bug#80006)Sean Whitton2026-01-171-7/+73
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--current-branch): Rename to ... (vc-git-working-branch): ... this. All uses changed. (vc-git-trunk-or-topic-p, vc-git-topic-outgoing-base): * lisp/vc/vc-hg.el (vc-hg--working-branch, vc-hg-working-branch) (vc-hg-trunk-or-topic-p, vc-hg-topic-outgoing-base): * lisp/vc/vc-hooks.el (vc--safe-branch-regexps-p): * lisp/vc/vc.el (vc-default-working-branch) (vc-default-trunk-or-topic-p, vc--match-branch-name-regexps) (vc--outgoing-base, vc--outgoing-base-mergebase) (vc--maybe-read-outgoing-base): New functions. (vc-diff-outgoing-base): Call vc--outgoing-base-mergebase. (vc-root-diff-outgoing-base, vc-diff-outgoing-base): Use vc--maybe-read-outgoing-base in interactive specification. (working-branch, trunk-or-topic-p, topic-outgoing-base): New specifications for backend functions. (vc-trunk-branch-regexps, vc-topic-branch-regexps): New variables. * .dir-locals.el: Commented entries for the new variables. * test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-match-branch-name-regexps): New test. * doc/emacs/vc1-xtra.texi (Outstanding Changes): Document the new functionality.
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* ; * lisp/vc/vc-git.el (vc-git-registered): Fix remote files (bug#80035).Eli Zaretskii2025-12-201-1/+1
|
* ; * lisp/vc/vc-git.el (vc-git-region-history): Fix backend name.Sean Whitton2025-12-181-1/+1
|
* vc-git-dir-status-goto-stage: Accept exit 128 from git-addSean Whitton2025-12-131-3/+8
| | | | | * lisp/vc/vc-git.el (vc-git-dir-status-goto-stage): Accept an exit code of 128 from 'git add --refresh' (bug#79999).
* Check for successful exit when parsing output with vc-exec-afterSean Whitton2025-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using vc-exec-after to parse program output, check that the program didn't die to a signal or exit with an error exit code before attempting the parse. Continue to use plain vc-run-delayed where we aren't parsing output, because in these cases it doesn't matter to CODE if the output is incomplete. * lisp/vc/vc-dispatcher.el (vc-exec-after): <process-status>: Treat PROC dying to a signal the same as PROC exiting non-zero. (vc-exec-after): <accept-process-output>: Restore making a nonblocking call, for the case of vc-exec-after called from a process sentinel. diff-hl *does* require this. (vc-exec-after): <OKSTATUS>: New parameter, replacing SUCCESS, which never worked as documented. * test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-exec-after-3): Test it. (vc-run-delayed-success): New macro. * lisp/vc/vc-git.el (vc-git-dir-status-goto-stage): * lisp/vc/vc-hg.el (vc-hg-dir-status-files): * lisp/vc/vc.el (vc-pull-and-push): Use it. * lisp/obsolete/vc-arch.el (vc-exec-after): * lisp/obsolete/vc-mtn.el (vc-exec-after): * lisp/vc/vc-bzr.el (vc-exec-after): * lisp/vc/vc-cvs.el (vc-exec-after): * lisp/vc/vc-git.el (vc-exec-after): * lisp/vc/vc-hg.el (vc-exec-after): * lisp/vc/vc-svn.el (vc-exec-after): Update declarations.
* vc-git-incoming-revision: Don't fetch when branch has no upstreamSean Whitton2025-12-061-1/+9
| | | | | * lisp/vc/vc-git.el (vc-git-incoming-revision): Don't perform a useless fetch when the branch has no upstream (bug#79952).
* Query-on-exit for VC push, pull and async checkin commandsSean Whitton2025-12-031-10/+13
| | | | | | | * lisp/vc/vc-bzr.el (vc-bzr--pushpull): * lisp/vc/vc-git.el (vc-git--checkin, vc-git--pushpull): * lisp/vc/vc-hg.el (vc-hg--checkin, vc-hg--pushpull): Set query-on-exit flag for async processes.
* Fix vc-git-uncommit-revisions-from-endSean Whitton2025-11-291-2/+2
| | | | | * lisp/vc/vc-git.el (vc-git-uncommit-revisions-from-end): Don't leave changes staged.
* vc-git-revision-published-p: Resolve REVSean Whitton2025-11-221-1/+2
| | | | | * lisp/vc/vc-git.el (vc-git-revision-published-p): Resolve REV before using it, using vc-git--rev-parse.
* Fix '(vc-revert-file (vc-git-root)'Sean Whitton2025-11-201-36/+48
| | | | | | | | * lisp/vc/vc-git.el (vc-git--file-list-is-rootdir): Merge into vc-git-command. (vc-git-command): When operating on the repository root, first bind default-directory to that root. When operating on the repository root with 'git checkout', pass "." as FILE-OR-LIST.
* New *-revisions-from-end VC backend API functions (bug#79408)Sean Whitton2025-10-311-0/+12
| | | | | | | | | | * lisp/vc/vc-git.el (vc-git-delete-revisions-from-end) (vc-git-uncommit-revisions-from-end): * lisp/vc/vc-hg.el (vc-hg--assert-rev-on-current-branch) (vc-hg--reset-back-to, vc-hg-delete-revisions-from-end) (vc-hg-uncommit-revisions-from-end): New functions. * lisp/vc/vc.el: Specify delete-revisions-from-end and uncommit-revisions-from-end backend API functions (bug#79408).
* New delete-revision VC backend API function (bug#79408)Sean Whitton2025-10-271-5/+26
| | | | | | | | | | * lisp/vc/vc-git.el (vc-git--assert-revision-on-branch): New function, factored out. (vc-git-revision-published-p): Use it. (vc-git-delete-revision): * lisp/vc/vc-hg.el (vc-hg-delete-revision): New functions. * lisp/vc/vc.el: Specify delete-revision backend API function (bug#79408).
* New revision-published-p VC backend API function (bug#79408)Sean Whitton2025-10-261-15/+28
| | | | | | | | * lisp/vc/vc-git.el (vc-git-revision-published-p): New function. (vc-git--assert-allowed-rewrite): Use it. * lisp/vc/vc-hg.el (vc-hg-revision-published-p): New function. * lisp/vc/vc.el: Specify revision-published-p backend API function (bug#79408).
* * lisp/vc/vc-git.el (vc-git-branches): Use 'git for-each-ref'.Sean Whitton2025-10-241-1/+4
|
* Make UPSTREAM-LOCATION argument to incoming-revision optionalSean Whitton2025-10-241-6/+4
| | | | | | | | | | | | | | | Using an empty string to mean the location from which vc-update would pull was inherited from the old incoming/outgoing functions, but we have opportunity to simplify things for this new one. * lisp/vc/vc-bzr.el (vc-bzr-incoming-revision): * lisp/vc/vc-git.el (vc-git-incoming-revision): * lisp/vc/vc-hg.el (vc-hg-incoming-revision): * lisp/vc/vc.el (vc-diff-incoming, vc-diff-outgoing) (vc-diff-outgoing-base, vc--incoming-revision): Make UPSTREAM-LOCATION parameter optional. Use nil, rather than an empty string, to mean the default.
* vc-git-registered: Be quieter when Git is not installedSean Whitton2025-10-191-21/+28
| | | | | * lisp/vc/vc-git.el (vc-git-registered): If Git is not installed, don't echo a message about it.
* VC: Use symbolic names for the working revisionSean Whitton2025-10-051-20/+27
| | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-hg.el (vc-hg-diff): When OLDVERS is ".", behave the same as if OLDVERS was the actual working revision. (vc-hg-previous-revision): Return ".~1" for input ".", ".~3" for input ".^^" et cetera. Also, when passed non-symbolic revisions, use "REV~1" instead of "REV^" for MS-Windows compatibility. (vc-hg-working-revision-symbol): * lisp/vc/vc-git.el (vc-git-working-revision-symbol): * lisp/vc/vc-hooks.el (vc-symbolic-working-revision): New functions. (vc-default-mode-line-string): * lisp/vc/ediff-vers.el (ediff-vc-merge-internal): * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): * lisp/vc/vc.el (vc-diff-build-argument-list-internal) (vc-diff-outgoing, vc-revision-other-window, vc-default-revert): Call vc-symbolic-working-revision. (vc-buffer-revision): Specify that this should always be a revision number/hash, not a symbolic name. * lisp/vc/vc-git.el (vc-git-previous-revision): Return "HEAD~1" for input "HEAD", "HEAD~3" for input "HEAD^^" et cetera.
* VC prepare-patch: New :patch-start & :patch-end plist entriesSean Whitton2025-09-271-20/+33
| | | | | | | | | | | | | | | * lisp/vc/vc.el (prepare-patch): Specify :patch-start and :patch-end plist entries. * lisp/vc/vc-git.el (vc-git-prepare-patch): Use -n1 to avoid passing a revision range to git-format-patch, which is a bit simpler. Catch search-failed errors and signal an error with a more helpful message. Properly handle Subject: header by looking for continuation lines. Return :patch-start and :patch-end entries in the plist. * lisp/vc/vc-hg.el (vc-hg-prepare-patch): Always pass --git to 'hg export' for consistency. Catch search-failed errors and signal an error with a more helpful message. Return a :patch-start entry in the plist.
* ; * lisp/vc/vc-git.el (vc-git-cherry-pick-comment): Fix logic.Sean Whitton2025-09-261-6/+6
|
* vc-git--checkin: Ignore 'git apply --3way' exiting 1Sean Whitton2025-09-251-3/+4
| | | | | | | | | This is expected to happen in some cases. * lisp/vc/vc-git.el (vc-git--with-apply-temp): New OKSTATUS parameter. (vc-git--checkin): Use it to ignore 'git apply --3way' exiting 1.
* vc-git--checkin: Avoid passing --ours to git-applySean Whitton2025-09-251-5/+23
| | | | | * lisp/vc/vc-git.el (vc-git--with-apply-temp): New BUFFER param. (vc-git--checkin): Avoid passing --ours to git-apply.
* VC: New cherry-pick-comment API functionSean Whitton2025-09-241-0/+19
| | | | | | | * lisp/vc/vc-git.el (vc-git-cherry-pick-comment): * lisp/vc/vc-hg.el (vc-hg-cherry-pick-comment): * lisp/vc/vc.el (vc-default-cherry-pick-comment): New functions (bug#79408).
* vc-git--checkin: Apply PATCH-STRING to working treeSean Whitton2025-09-241-6/+28
| | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--with-apply-temp-to-staging): Rename ... (vc-git--with-apply-temp): ... to this. New ARGS parameter. All uses changes. (vc-git--checkin): In POST function, apply PATCH-STRING to the working tree with 'git apply --3way --ours'. * lisp/vc/vc-hg.el (vc-hg--checkin): Document what the call to 'hg update' is for. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): Delete completed FIXME and workaround.
* vc-git--checkin: Restore dropping stash of staged changesSean Whitton2025-09-241-1/+2
| | | | | | * lisp/vc/vc-git.el (vc-git--checkin): Restore dropping stash of staged changes after applying it. This was accidentally lost when factoring out vc-git--with-apply-temp-to-staging.
* ; * lisp/vc/vc-git.el (vc-git--checkin): Fix error message.Sean Whitton2025-09-221-1/+1
|
* VC checkin-patch: Support extracting commit metadata from patchesSean Whitton2025-09-211-10/+86
| | | | | | | | | | | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git--mailinfo): New function. (vc-git-checkin-patch): Use it to extract authorship, date and log message information from patches. (vc-git--call): New INFILE argument. All uses changed. * lisp/vc/vc-hg.el (vc-hg--checkin): When COMMENT is nil, take authorship, date and log message information from the patch. * lisp/vc/vc.el (checkin-patch): Specify to use authorship, date and comment information in PATCH-STRING (bug#79408). (prepare-patch): Specify that patch should include authorship identity, date and log message information for REV if supported. (diff-bounds-of-hunk): Declare. (vc-default-checkin-patch): Warn if it looks like we will ignore patch authorship information. * test/lisp/vc/vc-tests/vc-tests.el (vc-hg-command) (vc-git--out-str): Declare. (vc-test--checkin-patch): New function. (vc-test-git08-checkin-patch, vc-test-hg08-checkin-patch): New tests.
* * lisp/vc/vc-git.el (vc-git--checkin): Validate parameters.Sean Whitton2025-09-211-0/+2
|
* Refactor vc-git checkin functionsSean Whitton2025-09-181-21/+29
| | | | | | | * lisp/vc/vc-git.el (vc-git-patch-string): Delete. All uses changed. (vc-git--checkin): Rename vc-git-checkin to this. (vc-git-checkin-patch, vc-git-checkin): New wrapper functions.
* ; vc-git--log-edit-summary-check: Use and-let*.Sean Whitton2025-09-121-15/+15
|
* Rename arg REMOTE-LOCATION -> UPSTREAM-LOCATIONSean Whitton2025-09-011-6/+6
| | | | | | | | | | | | | | | | * lisp/vc/vc-bzr.el (vc-bzr-log-incoming) (vc-bzr-incoming-revision, vc-bzr-log-outgoing): * lisp/vc/vc-git.el (vc-git-incoming-revision): * lisp/vc/vc-hg.el (vc-hg-incoming-revision): * lisp/vc/vc.el (vc-root-diff-incoming, vc-diff-incoming) (vc-root-diff-outgoing, vc-diff-outgoing) (vc-root-diff-outgoing-base, vc-diff-outgoing-base) (vc-incoming-outgoing-internal, vc-remote-location-history) (vc--incoming-revision, vc-log-incoming, vc-default-log-incoming) (vc-log-outgoing, vc-default-log-outgoing): Rename arguments REMOTE-LOCATION -> UPSTREAM-LOCATION. Adjust strings. (vc--maybe-read-remote-location): Rename ... (vc--maybe-read-upstream-location): ... to this.
* VC outgoing commands for Git: Don't unconditionally fetchSean Whitton2025-09-011-14/+15
| | | | | | | | | | * lisp/vc/vc-bzr.el (vc-bzr-incoming-revision): * lisp/vc/vc-hg.el (vc-hg-incoming-revision): * lisp/vc/vc.el (vc-diff-incoming, vc--incoming-revision): New REFRESH optional argument. (vc-default-log-incoming): Pass it. * lisp/vc/vc-git.el (vc-git-incoming-revision): New REFRESH optional argument. When nil, use cached info (bug#62940).
* ; vc-git-command, vc-hg-command: Comments about MS-Windows encoding.Sean Whitton2025-08-161-0/+11
|
* vc-git-modify-change-comment: Bind c-s-f-w for command arguments tooSean Whitton2025-08-141-10/+12
| | | | | | | * lisp/vc/vc-git.el (vc-git-modify-change-comment): Bind coding-system-for-write to locale-coding-system around the call to vc-git-command on MS-Windows. The temporary file name could contain non-ASCII, e.g. the user's username.
* Fix some 'git worktree' compatibility issuesSean Whitton2025-08-101-7/+18
| | | | | | | | | | | | * lisp/vc/vc-git.el (vc-git-delete-working-tree): Reimplement to avoid requiring 'git worktree remove'. (vc-git-move-working-tree): Use 'git worktree move' if 'git worktree repair' is not available. Give a more informative error message if we don't even have that. * test/lisp/vc/vc-tests/vc-tests.el (vc-git--program-version): Declare. (vc-test--other-working-trees): Skip vc-move-working-tree tests with Git old enough to lack 'git worktree move'.