├── RelNotes.org ├── .github ├── dependabot.yml ├── workflows │ ├── compile.yml │ ├── test.yml │ ├── manual.yml │ └── stats.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.md ├── CONTRIBUTING.md └── PULL_REQUEST_TEMPLATE ├── .dir-locals.el ├── docs ├── RelNotes │ ├── 0.5.1.txt │ ├── 1.2.1.txt │ ├── 2.12.1.txt │ ├── 1.2.2.txt │ ├── 0.6.1.txt │ ├── 1.4.2.txt │ ├── 1.1.1.txt │ ├── 0.8.2.txt │ ├── 0.8.1.txt │ ├── 1.1.2.txt │ ├── 2.4.1.txt │ ├── 1.4.1.txt │ ├── 2.3.1.txt │ ├── 3.2.1.org │ ├── 2.13.1.txt │ ├── 2.90.1.org │ ├── 2.6.1.txt │ ├── 2.2.1.txt │ ├── 2.10.3.txt │ ├── 2.2.2.txt │ ├── 0.8.0.txt │ ├── 2.10.2.txt │ ├── 2.6.2.txt │ ├── 1.2.0.txt │ ├── 2.10.1.txt │ ├── 0.7.0.txt │ ├── 1.0.0.txt │ ├── 3.1.0.org │ ├── 1.1.0.txt │ ├── 2.7.0.txt │ ├── 3.2.0.org │ ├── 2.10.0.txt │ ├── 2.8.0.txt │ ├── 2.5.0.txt │ ├── 2.13.0.txt │ ├── 2.6.0.txt │ ├── 2.4.0.txt │ └── 3.3.0.org ├── .orgconfig ├── htmlxref.cnf ├── Makefile └── AUTHORS.md ├── lisp ├── magit-section-pkg.el ├── magit-libgit-pkg.el ├── git-commit-pkg.el ├── magit-pkg.el ├── magit-libgit.el ├── magit-bookmark.el ├── magit-core.el ├── magit-reset.el ├── magit-bundle.el ├── Makefile ├── magit-pull.el ├── magit-subtree.el ├── magit-sparse-checkout.el ├── magit-fetch.el ├── magit-notes.el ├── magit-reflog.el └── magit-gitignore.el ├── .gitignore ├── test └── Makefile ├── .mailmap ├── README.md └── default.mk /RelNotes.org: -------------------------------------------------------------------------------- 1 | docs/RelNotes/4.0.0.org -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/compile.yml: -------------------------------------------------------------------------------- 1 | name: Compile 2 | on: [push, pull_request] 3 | jobs: 4 | compile: 5 | name: Compile 6 | uses: emacscollective/workflows/.github/workflows/compile.yml@main 7 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: [push, pull_request] 3 | env: 4 | BUILD_MAGIT_LIBGIT: "false" 5 | jobs: 6 | test: 7 | name: Test 8 | uses: emacscollective/workflows/.github/workflows/test.yml@main 9 | -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((emacs-lisp-mode 2 | (indent-tabs-mode . nil)) 3 | (makefile-gmake-mode 4 | (outline-regexp . "#\\(#+\\)") 5 | (mode . outline-minor)) 6 | (git-commit-mode 7 | (git-commit-major-mode . git-commit-elisp-text-mode))) 8 | -------------------------------------------------------------------------------- /docs/RelNotes/0.5.1.txt: -------------------------------------------------------------------------------- 1 | Magit v0.5.1 Release Notes 2 | ========================== 3 | 4 | This is the first release of Magit. Enjoy! 5 | 6 | Released 14 August 2008 by Marius Vollmer. 7 | 8 | Authors 9 | ------- 10 | 11 | 157 Marius Vollmer 12 | -------------------------------------------------------------------------------- /lisp/magit-section-pkg.el: -------------------------------------------------------------------------------- 1 | (define-package "magit-section" "3.3.0.50-git" 2 | "Sections for read-only buffers." 3 | '((emacs "25.1") 4 | (compat "29.1.3.4") 5 | (dash "20221013")) 6 | :homepage "https://magit.vc" 7 | :keywords '("tools")) 8 | -------------------------------------------------------------------------------- /lisp/magit-libgit-pkg.el: -------------------------------------------------------------------------------- 1 | (define-package "magit-libgit" "3.3.0.50-git" 2 | "(POC) Teach Magit to use Libgit2." 3 | '((emacs "25.1") 4 | (compat "29.1.3.4") 5 | (libgit "0") 6 | (magit "20230101")) 7 | :homepage "https://magit.vc" 8 | :keywords '("git" "tools" "vc")) 9 | -------------------------------------------------------------------------------- /lisp/git-commit-pkg.el: -------------------------------------------------------------------------------- 1 | (define-package "git-commit" "3.3.0.50-git" 2 | "Edit Git commit messages." 3 | '((emacs "25.1") 4 | (compat "29.1.3.4") 5 | (transient "20230201") 6 | (with-editor "20230118")) 7 | :homepage "https://magit.vc" 8 | :keywords '("git" "tools" "vc")) 9 | -------------------------------------------------------------------------------- /.github/workflows/manual.yml: -------------------------------------------------------------------------------- 1 | name: Manual 2 | on: 3 | push: 4 | branches: main 5 | jobs: 6 | manual: 7 | name: Manual 8 | uses: emacscollective/workflows/.github/workflows/manual.yml@main 9 | secrets: 10 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 11 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 12 | -------------------------------------------------------------------------------- /.github/workflows/stats.yml: -------------------------------------------------------------------------------- 1 | name: Statistics 2 | on: 3 | push: 4 | branches: main 5 | jobs: 6 | stats: 7 | name: Statistics 8 | uses: emacscollective/workflows/.github/workflows/stats.yml@main 9 | secrets: 10 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 11 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /config.mk 2 | /docs/*.html 3 | /docs/*.info 4 | /docs/*.pdf 5 | /docs/*.texi 6 | /docs/dir 7 | /docs/stats/ 8 | /lisp/*-autoloads.el 9 | /lisp/*.elc 10 | 11 | /docs/magit/ 12 | /docs/magit-section/ 13 | /lisp/magit-version.el 14 | 15 | /docs/*.epub 16 | /docs/META-INF/ 17 | /docs/OEBPS/ 18 | /docs/epub.xml 19 | /docs/mimetype 20 | 21 | *~ 22 | /*.tar 23 | /*.tar.gz 24 | -------------------------------------------------------------------------------- /docs/RelNotes/1.2.1.txt: -------------------------------------------------------------------------------- 1 | Magit v1.2.1 Release Notes 2 | ========================== 3 | 4 | Released 23 May 2014 by Jonas Bernoulli. 5 | 6 | Changes since v1.2.0 7 | -------------------- 8 | 9 | * `magit-delete-directory' was rewritten to deal with an incompatible 10 | change in `delete-directory' in Emacs v24.4. 11 | 12 | Authors 13 | ------- 14 | 15 | 1 Jonas Bernoulli 16 | -------------------------------------------------------------------------------- /docs/RelNotes/2.12.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.12.1 Release Notes 2 | =========================== 3 | 4 | Fixes since v2.12.0 5 | ------------------- 6 | 7 | * Magit 2.12.0 depended on a non-existent Magit-Popup version. 8 | 9 | * Key bindings in `magit-remote-popup' conflicted. 10 | 11 | Authors 12 | ------- 13 | 14 | 8 Jonas Bernoulli 15 | 1 Dean Kariniemi 16 | 1 Phil Sainty 17 | -------------------------------------------------------------------------------- /lisp/magit-pkg.el: -------------------------------------------------------------------------------- 1 | (define-package "magit" "3.3.0.50-git" 2 | "A Git porcelain inside Emacs." 3 | '((emacs "25.1") 4 | (compat "29.1.3.4") 5 | (dash "20221013") 6 | (git-commit "20230101") 7 | (magit-section "20230101") 8 | (seq "2.24") 9 | (transient "20230201") 10 | (with-editor "20230118")) 11 | :homepage "https://magit.vc" 12 | :keywords '("git" "tools" "vc")) 13 | -------------------------------------------------------------------------------- /docs/RelNotes/1.2.2.txt: -------------------------------------------------------------------------------- 1 | Magit v1.2.2 Release Notes 2 | ========================== 3 | 4 | Released 23 October 2014 by Jonas Bernoulli. 5 | 6 | Changes since v1.2.1 7 | -------------------- 8 | 9 | * `magit-delete-directory' uses itself when deleting recursively, 10 | instead of `org-delete-directory' which it was copied from. 11 | 12 | * Many byte-compile warnings were addressed. 13 | 14 | Authors 15 | ------- 16 | 17 | 5 Jonas Bernoulli 18 | -------------------------------------------------------------------------------- /docs/RelNotes/0.6.1.txt: -------------------------------------------------------------------------------- 1 | Magit v0.6.1 Release Notes 2 | ========================== 3 | 4 | Released 16 October 2008 by Marius Vollmer. 5 | 6 | Changes since v0.5.1 7 | -------------------- 8 | 9 | Almost everything has changed. Some highlights: 10 | 11 | * Magit now works with Git 1.6.0. (John Wiegley) 12 | 13 | * Support for interactive rewriting. 14 | 15 | * Sections can be shown and hidden. 16 | 17 | * Staging, unstaging, applying, reverting and discarding changes can 18 | now be done line-by-line, not only hunk-by-hunk. 19 | 20 | Authors 21 | ------- 22 | 23 | 212 Marius Vollmer 24 | - John Wiegley 25 | -------------------------------------------------------------------------------- /docs/RelNotes/1.4.2.txt: -------------------------------------------------------------------------------- 1 | Magit v1.4.2 Release Notes 2 | ========================== 3 | 4 | Released 8 June 2015 by Jonas Bernoulli. 5 | 6 | This is a bugfix release. 7 | 8 | Changes since v1.4.1 9 | -------------------- 10 | 11 | * Automatic revers of file-visiting buffers now works again in Emacs 12 | version 24.5. It was broken due to an incompatible change in that 13 | Emacs release. 14 | 15 | * Git's reflogs sometimes end with bogus entries. We now work around 16 | that when listing stashes. 17 | 18 | Authors 19 | ------- 20 | 21 | 11 Jonas Bernoulli 22 | 1 Peter Vasil 23 | 1 Steven E. Harris 24 | -------------------------------------------------------------------------------- /docs/RelNotes/1.1.1.txt: -------------------------------------------------------------------------------- 1 | Magit v1.1.1 Release Notes 2 | ========================== 3 | 4 | Released 14 January 2012 by Yann Hodique. 5 | 6 | Changes since v1.1.0 7 | -------------------- 8 | 9 | * `magit-svn-get-local-ref' learned to expand branch specs containing 10 | braces. 11 | 12 | * `magit-log-edit' learned to amend and create commits with no message. 13 | 14 | * Several other fixes and improvements. 15 | 16 | Authors 17 | ------- 18 | 19 | 6 Nicolas Dudebout 20 | 6 Yann Hodique 21 | 1 Graham Clark 22 | 1 Justin Caratzas 23 | 1 Peter J. Weisberg 24 | 1 Ryan C. Thompson 25 | 1 Timo Juhani Lindfors 26 | -------------------------------------------------------------------------------- /docs/RelNotes/0.8.2.txt: -------------------------------------------------------------------------------- 1 | Magit v0.8.2 Release Notes 2 | ========================== 3 | 4 | Released 10 July 2010 by Phil Jackson. 5 | 6 | Changes since v0.8.1 7 | -------------------- 8 | 9 | * Use shorter more human readable representations for refs. 10 | 11 | * Optionally show refs for remote branches the way Git would. 12 | 13 | * Tell VC to update the mode-line for us. 14 | 15 | Authors 16 | ------- 17 | 18 | 21 Phil Jackson 19 | 18 Natalie Weizenbaum 20 | 2 Alan Falloon 21 | 2 Moritz Bunkus 22 | 2 Rémi Vanicat 23 | 1 Alex Ott 24 | 1 Leo Liu 25 | 1 Sean Bryant 26 | 1 Ævar Arnfjörð Bjarmason 27 | 1 Óscar Fuentes 28 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | -include ../config.mk 2 | include ../default.mk 3 | 4 | test: 5 | @printf "Testing...\n" 6 | @$(BATCH) --eval "(progn\ 7 | $$suppress_warnings\ 8 | (load-file \"$(TOP)test/magit-tests.el\")\ 9 | (ert-run-tests-batch-and-exit))" 10 | 11 | test-interactive: 12 | @$(EMACS) -Q $(LOAD_PATH) --eval "(progn\ 13 | (load-file \"$(TOP)test/magit-tests.el\")\ 14 | (ert t))" 15 | 16 | lisp: magit-tests.elc 17 | 18 | %.elc: %.el 19 | @printf "Compiling $<\n" 20 | @$(BATCH) --eval "(progn\ 21 | (when (file-exists-p \"$@\")\ 22 | (delete-file \"$@\"))\ 23 | (setq with-editor-emacsclient-executable nil)\ 24 | $$suppress_warnings)" \ 25 | -f batch-byte-compile $< 26 | -------------------------------------------------------------------------------- /docs/.orgconfig: -------------------------------------------------------------------------------- 1 | # -*- mode:org -*- 2 | 3 | #+options: H:4 num:3 toc:2 compact-itemx:t 4 | #+property: header-args :eval never 5 | 6 | #+macro: kbd (eval (let ((case-fold-search nil) (regexp (regexp-opt '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "Ctrl" "Meta" "Alt" "Cmd" "Super" "UP" "LEFT" "RIGHT" "DOWN") 'words))) (format "@@texinfo:@kbd{@@%s@@texinfo:}@@" (replace-regexp-in-string regexp "@@texinfo:@key{@@\\&@@texinfo:}@@" $1 t)))) 7 | #+macro: year (eval (format-time-string "%Y")) 8 | #+macro: version (eval (or (getenv "PACKAGE_REVDESC") (getenv "PACKAGE_VERSION") (ignore-errors (car (process-lines "git" "describe" "--exact"))) (ignore-errors (concat (car (process-lines "git" "describe" (if (getenv "AMEND") "HEAD~" "HEAD"))) "+1")))) 9 | 10 | #+language: en 11 | -------------------------------------------------------------------------------- /docs/RelNotes/0.8.1.txt: -------------------------------------------------------------------------------- 1 | Magit v0.8.1 Release Notes 2 | ========================== 3 | 4 | Released 10 June 2010 by Phil Jackson. 5 | 6 | Changes since v0.8.0 7 | -------------------- 8 | 9 | * New library `rebase-mode.el'. Edit Git rebase files. 10 | 11 | * New commands `magit-log-all' and `magit-log-first-parent'. 12 | 13 | * New command `magit-git-command'. Run any Git command. 14 | 15 | * `magit-remote-update' learned to fetch just the current remote. 16 | 17 | * `magit-tag' learned to place the tag on something other than HEAD. 18 | 19 | Authors 20 | ------- 21 | 22 | 55 Phil Jackson 23 | 7 Rémi Vanicat 24 | 7 Ævar Arnfjörð Bjarmason 25 | 4 Natalie Weizenbaum 26 | 2 Ramkumar Ramachandra 27 | 1 Mark Hepburn 28 | 1 Moritz Bunkus 29 | -------------------------------------------------------------------------------- /docs/RelNotes/1.1.2.txt: -------------------------------------------------------------------------------- 1 | Magit v1.1.2 Release Notes 2 | ========================== 3 | 4 | Released 23 September 2012 by Yann Hodique. 5 | 6 | Changes since v1.1.1 7 | -------------------- 8 | 9 | * Modes now have proper mode-line lighters. 10 | 11 | * Hook variables are now defined semi-explicitly. 12 | 13 | * Uninteresting refs are no longer shown in logs. 14 | 15 | * The deprecated `assoc' library is no longer used. 16 | 17 | * Several other fixes and improvements. 18 | 19 | Authors 20 | ------- 21 | 22 | 13 Yann Hodique 23 | 9 Peter J. Weisberg 24 | 2 Jonas Bernoulli 25 | 2 Ramkumar Ramachandra 26 | 1 Bradley Wright 27 | 1 Bryan Shell 28 | 1 Damien Cassou 29 | 1 Eric Davis 30 | 1 John Wiegley 31 | 1 Nic Ferier 32 | 1 Nick Alcock 33 | 1 Rémi Vanicat 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: "💡 Suggest a feature" 4 | url: https://github.com/magit/magit/discussions 5 | about: Start a discussion suggest an improvement or a new feature. 6 | - name: "🆘 Ask the community for support" 7 | url: https://www.reddit.com/r/emacs 8 | about: Please also consider supporting others. 9 | - name: "🆘 Ask the maintainers for support" 10 | url: https://github.com/magit/magit/discussions 11 | about: Please keep in mind that our bandwidth is limited. 12 | - name: "ℹ️ Magit FAQ" 13 | url: https://magit.vc/manual/magit/FAQ.html 14 | about: Others might have had the same question before. 15 | - name: "ℹ️ Magit Manual" 16 | url: https://magit.vc/manual/magit/#Top 17 | about: The fine manual may also be of use. 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Magit has many users and very few maintainers, so we kindly ask to read 2 | the appropriate guidelines before getting in contact. — Thanks! 3 | 4 | - 🆘 [How to ask for help](https://github.com/magit/magit/discussions/4630) 5 | - 🪳 [How to report a bug](https://github.com/magit/magit/wiki/How-to-report-a-bug) 6 | - 💡 [How to suggest a feature](https://github.com/magit/magit/discussions/4631) 7 | - 🏗️ [Pull request guidelines](https://github.com/magit/magit/wiki/Pull-request-guidelines) 8 | - ℹ️ [FAQ](https://magit.vc/manual/magit/FAQ.html) 9 | - ℹ️ [Manual](https://magit.vc/manual/magit) 10 | 11 | TL;DR We now use discussions for feature requests (not issues) and prefer 12 | if you ask the community for support instead of the overworked maintainers. 13 | 14 | Please also consider to contribute by supporting other users or by making 15 | a [monetary donation](https://magit.vc/donate). — Thanks! 16 | -------------------------------------------------------------------------------- /docs/RelNotes/2.4.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.4.1 Release Notes 2 | ========================== 3 | 4 | Updates since v2.4.0 5 | -------------------- 6 | 7 | * Added new utility functions `magit-rev-abbrev', `magit-ref-p', and 8 | `magit-tag-p'. 9 | 10 | Fixes since v2.4.0 11 | ------------------ 12 | 13 | * When determining the emacsclient executable most suitable for the 14 | current emacs instance, With-Editor ignored any executable that is 15 | actually named "emacsclient-snapshot". 16 | 17 | * When determining the most suitable git executable, an error occurred 18 | if "Git for Windows 1.x" is used and an cygpath executable is 19 | available. 20 | 21 | * An error occurred when refreshing the status buffer when there is a 22 | new, staged but not yet committed, submodule. 23 | 24 | This release also contains typofixes. 25 | 26 | Authors 27 | ------- 28 | 29 | 9 Jonas Bernoulli 30 | 4 Kyle Meyer 31 | 1 Noam Postavsky 32 | -------------------------------------------------------------------------------- /docs/RelNotes/1.4.1.txt: -------------------------------------------------------------------------------- 1 | Magit v1.4.1 Release Notes 2 | ========================== 3 | 4 | Released 12 April 2015 by Jonas Bernoulli. 5 | 6 | This is a bugfix release. 7 | 8 | Changes since v1.4.0 9 | -------------------- 10 | 11 | * The external library `magit-log-edit.el' is no longer supported. 12 | If it is still installed, then instruct the user to remove it. 13 | 14 | * The function `magit-maybe-show-setup-instructions' is now run even 15 | when `magit' has not been loaded by the time `after-init-hook' ran. 16 | 17 | * Invalid `:package-version' keywords in option definitions were 18 | fixed. In some cases the value was "2.1.0" instead of "1.4.0". 19 | 20 | * Some unnecessary obsolete-variable definitions were removed. 21 | 22 | * Running tests on Travis CI was fixed. 23 | 24 | * The Makefile, README.md, and release notes received minor fixes 25 | and cleanup. 26 | 27 | Authors 28 | ------- 29 | 30 | 9 Jonas Bernoulli 31 | 1 Noam Postavsky 32 | -------------------------------------------------------------------------------- /docs/RelNotes/2.3.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.3.1 Release Notes 2 | ========================== 3 | 4 | Released 11 November 2015 by Jonas Bernoulli. 5 | 6 | This is a bugfix release. 7 | 8 | * `magit-stash-drop' now shows a message with the hash of the dropped 9 | stash to make it easier to recover from dropping the wrong stash. 10 | 11 | * `magit-revert-buffers' now avoids needlessly connecting to unrelated 12 | hosts. It first checks whether a given file is on the same host as 13 | the repository, and only if that is so it checks whether the file is 14 | located inside the repository, using `file-in-directory-p', which, 15 | for Tramp files, requires connecting to the remote host. 16 | 17 | * `magit-commit-message-buffer' no longer hangs when a symlink to the 18 | repository is involved. 19 | 20 | This release also contains various documentation fixes and code 21 | clean-ups. 22 | 23 | Authors 24 | ------- 25 | 26 | 10 Jonas Bernoulli 27 | 3 Noam Postavsky 28 | 2 Kyle Meyer 29 | 1 Carl Lieberman 30 | 1 David L. Rager 31 | 1 Syohei Yoshida 32 | -------------------------------------------------------------------------------- /docs/htmlxref.cnf: -------------------------------------------------------------------------------- 1 | # https://www.gnu.org/software/texinfo/manual/texinfo/html_node/HTML-Xref-Configuration.html 2 | 3 | EMACS = https://www.gnu.org/software/emacs/manual 4 | 5 | auth mono ${EMACS}/html_mono/auth.html 6 | auth node ${EMACS}/html_node/auth/ 7 | 8 | ediff mono ${EMACS}/html_mono/ediff.html 9 | ediff node ${EMACS}/html_node/ediff/ 10 | 11 | elisp mono ${EMACS}/html_mono/elisp.html 12 | elisp node ${EMACS}/html_node/elisp/ 13 | 14 | emacs mono ${EMACS}/html_mono/emacs.html 15 | emacs node ${EMACS}/html_node/emacs/ 16 | 17 | 18 | MAGIT = https://magit.vc/manual 19 | 20 | forge mono ${MAGIT}/forge.html 21 | forge node ${MAGIT}/forge/ 22 | 23 | ghub mono ${MAGIT}/ghub.html 24 | ghub node ${MAGIT}/ghub/ 25 | 26 | magit mono ${MAGIT}/magit.html 27 | magit node ${MAGIT}/magit/ 28 | 29 | transient mono ${MAGIT}/transient.html 30 | transient node ${MAGIT}/transient/ 31 | 32 | with-editor mono ${MAGIT}/with-editor.html 33 | with-editor node ${MAGIT}/with-editor/ 34 | 35 | 36 | MIRROR = https://emacsmirror.net/manual 37 | 38 | borg mono ${MIRROR}/borg.html 39 | borg node ${MIRROR}/borg/ 40 | 41 | epkg mono ${MIRROR}/epkg.html 42 | epkg node ${MIRROR}/epkg/ 43 | -------------------------------------------------------------------------------- /docs/RelNotes/3.2.1.org: -------------------------------------------------------------------------------- 1 | * It's Magit! A Git Porcelain inside Emacs 2 | 3 | Magit is a text-based Git user interface that puts an unmatched focus 4 | on streamlining workflows. Commands are invoked using short mnemonic 5 | key sequences that take the cursor’s position in the highly actionable 6 | interface into account to provide context-sensitive behavior. 7 | 8 | With Magit you can do nearly everything that you can do when using Git 9 | on the command-line, but at greater speed and while taking advantage 10 | of advanced features that previously seemed too daunting to use on a 11 | daily basis. Many users will find that by using Magit they can become 12 | more effective Git user. 13 | 14 | For more information about Magit, see https://magit.vc. 15 | 16 | * Magit v3.2.1 Release Notes 17 | 18 | Released 6st August 2021 by Jonas Bernoulli. 19 | 20 | I am pleased to announce the release of Magit version 3.2.1. 21 | 22 | This is the first release that is available from NonGNU Elpa. It is 23 | identical to version 3.2.0 except for dependency metadata, which had 24 | to be changed so that this package could be released on NonGNU Elpa. 25 | 26 | Also see https://emacsair.me/2021/08/06/nongnu-elpa 27 | and https://elpa.nongnu.org/nongnu/magit.html. 28 | -------------------------------------------------------------------------------- /docs/RelNotes/2.13.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.13.1 Release Notes 2 | =========================== 3 | 4 | Fixes since v2.13.0 5 | ------------------- 6 | 7 | * The prompt used by `magit-rebase-interactive-assert' was wrong. 8 | 37d76f409 9 | 10 | * `magit-rebase-autosquash' asked for confirmation when the user 11 | already confirmed earlier. 02e6c75b6 12 | 13 | * `magit-log-wash-rev` errored in ~magit-cherry-mode~, starting with 14 | Emacs 26.1. 1ee577b35 15 | 16 | * Magit used a completion function to make the built-in completion 17 | respect the collection's order. Even though that wasn't necessary 18 | for Ivy and Helm it did the same here, which became a problem when a 19 | change in Helm caused fuzzy completion to break in combination with 20 | a completion function. Likewise a change in Ivy caused Magit's sort 21 | order to be ignored, which we work around now. #3476, #3477 22 | 23 | * When using cygwin, then `git-commit-setup-font-lock' could end up 24 | trying to run git in a non-existent directory. #3505 25 | 26 | * `magit-insert-modules-unpushed-to-pushremote' failed to insert 27 | anything due to a typo in the used commit range. d4e159f35 28 | 29 | Authors 30 | ------- 31 | 32 | 11 Jonas Bernoulli 33 | 8 Kyle Meyer 34 | 5 Noam Postavsky 35 | -------------------------------------------------------------------------------- /docs/RelNotes/2.90.1.org: -------------------------------------------------------------------------------- 1 | * Magit v2.90.1 Release Notes 2 | ** Changes since v2.90.0 3 | 4 | - Added ~bug-reference-mode~ to ~git-commit-setup-hook~. e19e8fb1e 5 | 6 | - The "Version" column in ~magit-submodule-list-mode~ and 7 | ~magit-repolist-mode~ buffers now shows when a repository is dirty. 8 | 0b86dbfd6 9 | 10 | - Added new command ~magit-log-merged~. This command requires 11 | ~git-when-merged~ (https://github.com/mhagger/git-when-merged). It 12 | isn't bound in ~magit-log-popup~ by default. To add it, you can use 13 | something like 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (magit-define-popup-action 'magit-log-popup 17 | ?m "Log commit's merge" 'magit-log-merged) 18 | #+END_SRC 19 | 20 | #3657 21 | 22 | ** Fixes since v2.90.0 23 | 24 | - Bumped the minimal required version of ~git-commit~ to the correct 25 | version. e9bd33758 26 | 27 | - Dropped the new "v" prefix that we started to add to release tags 28 | starting with the previous release in places where that prefix is 29 | undesirable. f441cf6d7 30 | 31 | - Staging and unstaging submodules while ~diff.submodule~'s value is ~log~ 32 | broke shortly before the v2.90.0 release. #3654 33 | 34 | * Authors 35 | 36 | 10 Jonas Bernoulli 37 | 1 Allen Li 38 | 1 Kevin Brubeck Unhammer 39 | 1 Kyle Meyer 40 | -------------------------------------------------------------------------------- /docs/RelNotes/2.6.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.6.1 Release Notes 2 | ========================== 3 | 4 | Fixes since v2.6.0 5 | ------------------ 6 | 7 | * When a submodule is manually removed without staging the removal, 8 | then the status buffer could no longer be updated. 9 | 10 | * In some cases not all modified submodules were shown in the status 11 | buffer. 12 | 13 | * Visiting a blob did turn on `diff-hl-mode' if the global mode is on. 14 | 15 | * Stash and wipref were needlessly signed if signing is enabled. 16 | 17 | * The command `git-commit-save-message' did not strip diffs produced 18 | by `git commit --verbose'. 19 | 20 | * Diffs produced by `git commit --verbose' were not completely 21 | highlighted in the commit message buffer. 22 | 23 | * When the commit message buffer contains nothing but a single line 24 | that does not end with a newline, then a warning was shown about 25 | there being a non-empty second line. 26 | 27 | * When installing from Melpa, `async-bytecomp-package-mode' was no 28 | longer activated early enough. 29 | 30 | This release also contains documentation updates, typofixes, fixes for 31 | minor bugs, and other small improvements. 32 | 33 | Authors 34 | ------- 35 | 36 | 14 Jonas Bernoulli 37 | 5 Kyle Meyer 38 | 1 Fritz Grabo 39 | 1 Ingo Lohmar 40 | 1 Noam Postavsky 41 | -------------------------------------------------------------------------------- /docs/RelNotes/2.2.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.2.1 Release Notes 2 | ========================== 3 | 4 | Released 24 August 2015 by Jonas Bernoulli. 5 | 6 | This is a bugfix release. 7 | 8 | * The version strings in the manual were not set to "2.2" when v2.2.0 9 | was released. 10 | 11 | * Some menu bindings were not adjusted when commands were renamed. 12 | 13 | * The "next" tag was never shown in the "Tag(s)" header of the status 14 | buffer. 15 | 16 | * Blaming did not abort gracefully when the user killed the buffer. 17 | 18 | * Blaming failed on indirect buffers. 19 | 20 | * Blaming did not detect when a file was untracked. 21 | 22 | * Blaming passed the wrong line range when the file's buffer was 23 | narrowed. 24 | 25 | * `magit-shell-command-topdir' used `magit-git-command' instead of 26 | `magit-shell-command'. 27 | 28 | * `magit-copy-as-kill' added "nil" to the `kill-ring' when there was 29 | nothing useful to put there. 30 | 31 | * `magit-find-file-hook', `magit-find-index-hook', 32 | `magit-refresh-popup-buffer-hook' were used without being defined 33 | using `defvar'. 34 | 35 | * `magit-format-ref-labels' failed to work around a Git bug, resulting 36 | in refnames not being colorized when `--simplify-by-decoration' is 37 | used. 38 | 39 | This release also contains various documentation fixes. 40 | 41 | Authors 42 | ------- 43 | 44 | 16 Jonas Bernoulli 45 | 11 Kyle Meyer 46 | -------------------------------------------------------------------------------- /docs/RelNotes/2.10.3.txt: -------------------------------------------------------------------------------- 1 | Magit v2.10.3 Release Notes 2 | =========================== 3 | 4 | Changes since v2.10.2 5 | --------------------- 6 | 7 | * The new command `magit-do-async-shell-command' opens the file at 8 | point with `dired-do-async-shell-command'. "&" is now bound to 9 | this command. #2992 10 | 11 | Fixes since v2.10.2 12 | ------------------- 13 | 14 | * The command `magit-bisect-run' now uses a shell to run the command 15 | entered in response to the "Enter shell command" prompt. #3001 16 | 17 | * Discarding a renamed file failed if the original file was within a 18 | directory that no longer existed. #2998 19 | 20 | * When inserting information about a rebase in progress into the 21 | status buffer, "exec" lines were treated as a commit, leading to an 22 | error. #3002 23 | 24 | * The command `magit-blame' failed in blob-visiting buffers if the 25 | corresponding file no longer exists in the HEAD or the index. 26 | 27 | * The command `magit-remote-add' asked whether to set the new remote 28 | as the `remote.pushDefault', when that variable is already set and 29 | and it was configured not to ask in that case. 4f565039 30 | 31 | This release also contains typo fixes and documentation improvements. 32 | 33 | Authors 34 | ------- 35 | 36 | 10 Jonas Bernoulli 37 | 2 Kyle Meyer 38 | 1 Basil L. Contovounesios 39 | 1 Damien Cassou 40 | 1 Duianto Vebotci 41 | 1 Noam Postavsky 42 | -------------------------------------------------------------------------------- /docs/RelNotes/2.2.2.txt: -------------------------------------------------------------------------------- 1 | Magit v2.2.2 Release Notes 2 | ========================== 3 | 4 | Released 3 September 2015 by Jonas Bernoulli. 5 | 6 | This is a bugfix release. 7 | 8 | * `magit-diff-wash-diff' choked on unmerged binary files. #2211 9 | 10 | * `magit-blame-popup' did not allow empty input when reading a value 11 | for "-C" or "-M". #2208 12 | 13 | * The `emacsclient' executables belonging to non-current alternative 14 | installations of Emacs on Debian were not considered when setting 15 | the default value of `with-editor-emacsclient-executable'. #2217 16 | 17 | * `server-edit', which switches to a buffer preferably one with 18 | another client, was used when finishing or aborting a `with-editor' 19 | session. When `emacsclient' was used to connect to a server and 20 | then a commit or rebase was invoked, then there would be another 21 | client and switching to its buffer after finishing the commit or 22 | rebase would be undesirable. Now we use `server-done' instead. 23 | #2197 24 | 25 | * When `--stat' abbreviates the name of a file, then that name was 26 | stored in the section object instead of the full name. #2199 27 | 28 | * `magit-file-relative-name' with non-nil TRACKED failed in Tramp 29 | repositories. #2206 30 | 31 | * After failing to clone, `magit-clone' also tried to show the status 32 | of the non-existent clone. #2203 33 | 34 | * `magit-wip-log' did not display a log if the working tree or index 35 | ref did not exist. 36 | 37 | This release also contains various documentation fixes and code 38 | clean-ups. 39 | 40 | Authors 41 | ------- 42 | 43 | 29 Jonas Bernoulli 44 | 5 Kyle Meyer 45 | 1 Barak A. Pearlmutter 46 | -------------------------------------------------------------------------------- /docs/RelNotes/0.8.0.txt: -------------------------------------------------------------------------------- 1 | Magit v0.8.0 Release Notes 2 | ========================== 3 | 4 | Released 7 May 2010 by Phil Jackson. 5 | 6 | Changes since v0.7.0 7 | -------------------- 8 | 9 | * By setting magit-repo-dirs, you can get better repo completion. 10 | Magit will offer all subdirectories (up to magit-repo-dirs level 11 | deep) of the listed directories when magit-status asks for a 12 | directory to work on. You can get the old behavior with a double 13 | prefix to magit-status. 14 | 15 | * Hitting 'c' or 'C' while resolving a conflict in the middle of a 16 | rebase will offer to continue the rebase instead of trying to commit 17 | your changes. 18 | 19 | * Pulling will ask which branch to pull from when you don't have a 20 | default branch configured. 21 | 22 | * Switching to a remote branch will offer to create a local tracking 23 | branch for it. 24 | 25 | * Hitting C-c C-s while editing a commit message will toggle the 26 | "--signoff" option. 27 | 28 | * Hitting 's' on the "Untracked files" section title will stage all 29 | untracked files. 30 | 31 | * Hitting 'C-u S' will stage all untracked and tracked files. 32 | 33 | * Performance improvements in the status buffer. 34 | 35 | * Bug fixes to make Magit work better with newer Gits. 36 | 37 | Authors 38 | ------- 39 | 40 | 66 Phil Jackson 41 | 53 Marius Vollmer 42 | 27 Rémi Vanicat 43 | 7 Alexey Voinov 44 | 5 Hannu Koivisto 45 | 5 Roger Crew 46 | 4 John Wiegley 47 | 4 Moritz Bunkus 48 | 3 Ben Walton 49 | 2 Marcin Bachry 50 | 2 Óscar Fuentes 51 | 1 David Abrahams 52 | 1 Leo Liu 53 | 1 Pavel Holejsovsky 54 | 1 Ramkumar Ramachandra 55 | 1 Steve Purcell 56 | -------------------------------------------------------------------------------- /docs/RelNotes/2.10.2.txt: -------------------------------------------------------------------------------- 1 | Magit v2.10.2 Release Notes 2 | =========================== 3 | 4 | Changes since v2.10.1 5 | --------------------- 6 | 7 | * The new command `git-rebase-noop' adds a noop action during a 8 | rebase. It can be used to make git perform a rebase even if none 9 | of the commits are selected. #2991 10 | 11 | Fixes since v2.10.1 12 | ------------------- 13 | 14 | * Cherry-picking a commit with multiple parents was not possible, 15 | because "--mainline" was treated as a switch rather than an option, 16 | and because of a too-strict assertion that only single-parent commits 17 | can be cherry-picked. #2978 18 | 19 | * `magit-abbrev-length' mishandled two edge cases, returning 0 when 20 | called within an empty repository or outside of a repository. 21 | 077740f5 22 | 23 | * A bug fix in the last release broke the visit-file functionality in 24 | diff buffers displayed while committing. #2988 25 | 26 | * Diff buffers did not recognize "rev^-n" as a short-hand for 27 | "rev^n..rev" (new in Git v2.11), resulting in the buffer header 28 | incorrectly indicating that the diff was between "rev^-n" and the 29 | working tree. 293f0cc8 30 | 31 | * In diff buffers created using the dotted range notation, the command 32 | `magit-diff-visit-file' incorrectly swapped which revision was 33 | visited for deleted and added lines. For example, with the range 34 | "rev1..rev2", calling `magit-diff-visit-file' on a deleted line 35 | visited the blob for rev2. c24f32cd 36 | 37 | This release also contains other minor improvements, bug fixes, and 38 | documentation fixes. 39 | 40 | Authors 41 | ------- 42 | 43 | 10 Jonas Bernoulli 44 | 9 Kyle Meyer 45 | 1 Ben North 46 | 1 Fabian Wiget 47 | 1 Mark Oteiza 48 | -------------------------------------------------------------------------------- /docs/RelNotes/2.6.2.txt: -------------------------------------------------------------------------------- 1 | Magit v2.6.2 Release Notes 2 | ========================== 3 | 4 | Changes since v2.6.1 5 | -------------------- 6 | 7 | * Added new section inserter `magit-insert-submodules'. For each 8 | submodule it inserts the module path and a description of its tip. 9 | 10 | * When re-adding an already configured but for some reason unstaged 11 | submodule, then `magit-submodule-add' now offers the configured 12 | submodule name as default choice. 13 | 14 | Fixes since v2.6.1 15 | ------------------ 16 | 17 | * When possible `git merge (--no-commit|--edit)' perform fast-forward 18 | merges, which isn't what one would expect. `magit-merge-nocommit' 19 | and `magit-merge-editmsg' now work around that by always using 20 | `--no-ff'. 21 | 22 | * The command `magit-log', when called with `--patch' but without 23 | `--graph', deleted the first two characters of file names in the 24 | diff. 25 | 26 | * When performing an instant fixup/squash, the rebase often failed 27 | because the commit process still held the lock on `index.lock'. 28 | 29 | * The command `magit-submodule-add' offered an invalid default choice 30 | for the module path and allowed selecting a file that isn't a 31 | repository. 32 | 33 | * `git-rebase-mode' failed to prevent `save-place-mode' from having an 34 | effect. 35 | 36 | * The section inserter `magit-insert-unpulled-from-upstream-or-recent' 37 | failed to insert the recent commits instead when no upstream is 38 | configured. 39 | 40 | * Two key bindings in `magit-pull-and-fetch-popup' conflicted. 41 | 42 | * The default value for `magit-cygwin-mount-points' checked if 43 | "git.exe" was a cygwin flavor of git, instead of the (possibly user 44 | customized) value of `magit-git-executable'. 45 | 46 | Authors 47 | ------- 48 | 49 | 21 Jonas Bernoulli 50 | 1 John Mastro 51 | 1 Kyle Meyer 52 | 1 Noam Postavsky 53 | -------------------------------------------------------------------------------- /docs/RelNotes/1.2.0.txt: -------------------------------------------------------------------------------- 1 | Magit v1.2.0 Release Notes 2 | ========================== 3 | 4 | Released 23 September 2012 by Yann Hodique. 5 | 6 | Changes since v1.1.2 7 | -------------------- 8 | 9 | * Rewrote the branch manager. 10 | 11 | * Diffs are optionally refined using `diff-refine-hunk'. 12 | 13 | * Added library `magit-blame.el' defining new mode 14 | `magit-blame-mode'. 15 | 16 | * Added library `magit-wip.el' defining new modes 17 | `magit-wip-save-mode' and `magit-wip-mode'. 18 | 19 | * New section movement commands; `magit-goto-next-sibling-section' 20 | and `magit-goto-previous-sibling-section'. 21 | 22 | * Added command `magit-file-log'. 23 | 24 | * Added command `magit-manual-merge'. 25 | 26 | * `magit-delete-branch-force' was merged into `magit-delete-branch'. 27 | 28 | * `magit-move-branch' learned to force the rename. 29 | 30 | * `magit-reset-working-tree' learned to remove ignored files. 31 | 32 | * `magit-pull' learned to set `branch.BRANCH.merge'. 33 | 34 | * `magit-log-edit' learned to respect GIT_AUTHOR_EMAIL, 35 | GIT_AUTHOR_NAME and GIT_AUTHOR_DATE. 36 | 37 | * `magit-visit-item' learned to visit untracked files, diffs and 38 | hunks. 39 | 40 | * Added option `magit-sha1-abbrev-length'. 41 | 42 | Authors 43 | ------- 44 | 45 | 157 Yann Hodique 46 | 61 Nicolas Dudebout 47 | 14 Peter J. Weisberg 48 | 12 Jonas Bernoulli 49 | 10 Ryan C. Thompson 50 | 7 Miles Bader 51 | 6 Damien Cassou 52 | 5 Samuel Bronson 53 | 4 Dale Hagglund 54 | 4 Eli Barzilay 55 | 4 Takafumi Arakaki 56 | 4 rabio 57 | 3 Leonardo Etcheverry 58 | 3 Nick Alcock 59 | 3 Rémi Vanicat 60 | 3 Rüdiger Sonderfeld 61 | 2 Graham Clark 62 | 2 Hans-Peter Deifel 63 | 2 Moritz Bunkus 64 | 1 Andreas Liljeqvist 65 | 1 Christian Dietrich 66 | 1 Christopher Monsanto 67 | 1 Daniel Hackney 68 | 1 Hannu Koivisto 69 | 1 John Wiegley 70 | 1 Jonathan Roes 71 | 1 Ole Arndt 72 | 1 Ron Parker 73 | 1 Suhail Shergill 74 | -------------------------------------------------------------------------------- /docs/RelNotes/2.10.1.txt: -------------------------------------------------------------------------------- 1 | Magit v2.10.1 Release Notes 2 | =========================== 3 | 4 | Changes since v2.10.0 5 | --------------------- 6 | 7 | * The command `ido-enter-magit-status' is now being autoloaded. #2918 8 | 9 | * The minor-mode `bug-reference-mode' is now being suggested when 10 | customizing `magit-revision-mode-hook' and `git-commit-setup-hook'. 11 | e0d57c49 12 | 13 | * The function `magit-version' can now deal with the Magit libraries 14 | being symlinked to, which is required for the new `straight' package 15 | manager. #2967 16 | 17 | Fixes since v2.10.0 18 | ------------------- 19 | 20 | * When multiple stashes were selected by the region, responding "no" 21 | when asked to confirm the deletion of these stashes resulted in a 22 | type error. #2917 23 | 24 | * The function `magit-split-range' choked on ranges if one of the 25 | revisions was omitted, breaking a diff variant and potentially 26 | other uses as well. #2928 27 | 28 | * The function `magit-commit-setup' called without an argument, which 29 | causes the option `enable-local-variables' to be ignored. #2946 30 | 31 | * When committing inside a repository that was created using `git 32 | init --separate-git-dir', the diff buffer was empty, instead of 33 | showing the changes about to be committed. For some reason that 34 | git command, unlike other commands that do essentially the same 35 | thing, does not set `core.worktree', which confused Magit. #2955 36 | 37 | * In the repository list buffer, the columns that are supposed to list 38 | unpushed and unpulled commit counts, were blank. #2960 39 | 40 | * The command `magit-reflog-head' did not properly format reflog lines 41 | for branch renaming events. 2a268e20 42 | 43 | * The commands `magit-diff-show-or-scroll-down' and 44 | `magit-diff-or-scroll-up' scrolled instead of updated the revision 45 | or stash buffer, when that already showed the requested reference 46 | but that reference no longer pointed at the same revision. #2966 47 | 48 | This release also contains typo fixes and other documentation fixes. 49 | 50 | Authors 51 | ------- 52 | 53 | 16 Jonas Bernoulli 54 | 4 Kyle Meyer 55 | 2 Alex Kost 56 | 1 Kévin Le Gouguec 57 | 1 Radon Rosborough 58 | -------------------------------------------------------------------------------- /docs/RelNotes/0.7.0.txt: -------------------------------------------------------------------------------- 1 | Magit v0.7.0 Release Notes 2 | ========================== 3 | 4 | Released 8 March 2009 by Marius Vollmer. 5 | 6 | Changes since v0.6.1 7 | -------------------- 8 | 9 | * Tagging, on 't' and 'T'. 10 | 11 | * Stashing, on 'z' and 'Z'. 12 | 13 | * Wazzup, on 'w'. Wazzup gives you an overview over how other 14 | branches relate to the current one. 15 | 16 | * There is more control over pushing. 'P' now takes a prefix argument 17 | and pushing a branch without a default remote will ask for one. 18 | 19 | * Logs have changed a bit: 'l' shows the traditional brief log, and 20 | 'L' shows a more verbose log. Use the prefix arg to specify the 21 | range of the log. 22 | 23 | * M-x magit-status doesn't prompt anymore for a directory when invoked 24 | from within a Git repository. Use C-u to force a prompt. 25 | 26 | * When you have nothing staged, 'c' will now explicitly ask whether to 27 | commit everything instead of just going ahead and do it. This can 28 | be customized. 29 | 30 | * The digit keys '1', '2', '3', and '4' now show sections on the 31 | respective level and hide everything below. With Meta, they work on 32 | all sections; without, they work only on sections that are a parent 33 | or child of the current section. 34 | 35 | * Typing '+' and '-' will change the size of hunks, via the "-U" 36 | option to git diff. '0' resets hunks to their default size. 37 | 38 | * Typing 'k' on the "Untracked files" section title will offer to 39 | delete all untracked files. 40 | 41 | * Magit understands a bit of git-svn: the status buffer shows unpushed 42 | and unpulled commits, 'N r' runs git svn rebase, and 'N c' runs git 43 | svn dcommit. 44 | 45 | * Magit now also works when the directory is accessed via tramp. 46 | 47 | * M-x magit-status can also create new repositories when given a 48 | directory that is not a Git repository. 49 | 50 | * Magit works better with oldish Gits that don't understand "--graph", 51 | for example. 52 | 53 | * The name of the Git program and common options for it can be 54 | customized. 55 | 56 | Authors 57 | ------- 58 | 59 | 107 Marius Vollmer 60 | 18 John Wiegley 61 | 9 Alexey Voinov 62 | 5 Marcin Bachry 63 | 3 Rémi Vanicat 64 | 2 Alex Ott 65 | 2 René Stadler 66 | 2 Steve Purcell 67 | 1 Daniel Farina 68 | 1 David Wallin 69 | 1 Ian Eure 70 | 1 Jesse Alama 71 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 3 | name: 🪳 Report a bug 4 | about: Report a defect. Do not use this for support requests and feature suggestions. 5 | note: Keep in sync with wiki/How-to-report-a-bug.md 6 | --- 7 | 8 | Please do not ignore these instructions. 9 | 10 | If you have just updated Magit, then restart Emacs. If that does not fix the issue, then also uninstall Magit and all dependencies that were updated at the same time, restart Emacs and then reinstall Magit. 11 | 12 | The reason why this might fix the issue is that updating a package does not cause the old version to be unloaded, so you might end up with a franken-version; a mixture of parts of the old and new version being loaded at the same time. Worse it is possible for the old version to leak into the byte-code of the new version, which is why reinstalling might help. 13 | 14 | Please explain 15 | (1) what behavior you expected 16 | (2) what behavior you observed 17 | (3) and how we can reproduce the issue. 18 | 19 | Please include a backtrace in your report. In most cases doing: 20 | 21 | M-x toggle-debug-on-error RET 22 | 23 | and then going through the steps again should result in a backtrace. 24 | 25 | Also post the output of: 26 | 27 | M-x magit-version RET 28 | 29 | Before reporting a defect please try to reproduce it using an Emacs instance in which only Magit and its dependencies have been loaded. Other packages or your configuration should not be loaded. This makes it easier to determine whether the issue lays with Magit or something else. 30 | 31 | If you run Magit from its Git repository, then you can do so using: 32 | 33 | $ cd /path/to/magit 34 | $ make emacs-Q 35 | 36 | Alternatively, run: 37 | 38 | M-x magit-emacs-Q-command RET 39 | 40 | to save a shell command to the `kill-ring` and the system's clip-board, which you can then copy into a shell to run. 41 | 42 | Finally, if that didn't work and you have installed Magit from Melpa, then run commands similar to the ones above, but use tab completion to replace the various Ns with the correct versions: 43 | 44 | $ cd ~/.emacs.d/elpa/magit-N 45 | $ emacs -Q --debug-init --eval '(setq debug-on-error t)' -L ../dash-N -L ../git-commit-N -L ../transient-N -L ../with-editor-N -L ../ghub-N -L . -l magit 46 | 47 | More debugging tools are described in the manual. 48 | 49 | https://magit.vc/manual/magit/Debugging-Tools.html 50 | 51 | ---- now delete this line and everything above ---- 52 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | ================================================================= 2 | Use a dedicated feature branch 3 | ================================================================= 4 | 5 | Please use a dedicated feature branch for your feature request, instead of asking us to merge "your-fork/master" into the "origin/master". The use of dedicated branches makes it much more convenient to deal with pull-requests, especially when using Magit to do so. 6 | 7 | If you were about to open a pull-request asking us to merge your version of "master", then see [1] for instructions on how to quickly fix that and some information on why we ask you to do so. 8 | 9 | Additionally we ask you to allow us to push to the branch you want us to merge. We might want to push additional commits and/or make minor changes. Please make sure the box next to "Allow edits from maintainers" is checked before creating the pull-request. 10 | 11 | [1]: https://github.com/magit/magit/wiki/Dedicated-pull-request-branches 12 | 13 | ================================================================= 14 | Do NOT use Github to edit files and create commit messages 15 | ================================================================= 16 | 17 | Unless you are aware of all the pitfalls and take great care to avoid them, the use of Github results in many small defects, including but not limited to trailing whitespace, commit messages containing overlong lines and no newline at the very end, and "GitHub " being used as the committer. The last one cannot even be avoided, which I consider as an affront. 18 | 19 | Github is an insufficient interface for editing files and creating commits. Please don't do it when contributing to Magit. 20 | 21 | ================================================================= 22 | What you should write here 23 | ================================================================= 24 | 25 | Please summarize the changes made in the commits. Explain why you are making these changes, not just what changes you are making. This also applies to the commit messages. 26 | 27 | ================================================================= 28 | How to update the manual 29 | ================================================================= 30 | 31 | If you make changes to the manual, then edit only "magit.org". Do not manually edit "magit.texi". The latter has to be generated from the former. If you want to do that yourself, then follow the instructions at [2]. Otherwise a maintainer will do it and amend that to your commit. 32 | 33 | [2]: https://github.com/magit/magit/wiki/Documentation-tools-and-conventions 34 | -------------------------------------------------------------------------------- /docs/RelNotes/1.0.0.txt: -------------------------------------------------------------------------------- 1 | Magit v1.0.0 Release Notes 2 | ========================== 3 | 4 | Released 23 March 2011 by Phil Jackson. 5 | 6 | Changes since v0.8.2 7 | -------------------- 8 | 9 | * New library `magit-key-mode.el'. From a popup buffer dispatch 10 | Magit/Emacs commands which wrap Git commands and select the 11 | arguments passed to Git. Group various sets of related commands 12 | in new menus and adjust them accordingly. 13 | 14 | * New library `magit-svn.el' based on code previously in `magit.el'. 15 | Improve the implementation. Control `git svn' from Magit. 16 | 17 | * New library `magit-topgit.el' based on code previously in 18 | `magit.el'. Improve the implementation. Control TopGit from Magit. 19 | 20 | * Provide a wrapper for `completing-read'. Support using iswitchb to 21 | do completion. 22 | 23 | * Fixed and improved information shown during a rebase. 24 | 25 | * New macro `magit-define-inserter' to define functions which insert 26 | sections. 27 | 28 | * New macro `magit-add-action'. A hook-like extension mechanism for 29 | commands that behave differently based on the type of the section 30 | at point. 31 | 32 | * New macro `magit-define-command'. Like `defun' but also define 33 | a hook in addition to the function/command. If a hook function 34 | succeeds do not run the function body as passed to this macro. 35 | 36 | * New commands `magit-add-change-log-entry' 37 | and `magit-add-change-log-entry-other-window'. 38 | 39 | * New command `magit-change-what-branch-tracks'. 40 | 41 | * New commands `magit-run-git-gui' and `magit-run-gitk'. 42 | 43 | * Various new submodule commands. 44 | 45 | * Various new branch commands. 46 | 47 | * Various new log commands. Remove some old log commands. 48 | 49 | * Make reflog commands more like the log commands. 50 | 51 | * Numerous bugfixes and tweaks. 52 | 53 | Authors 54 | ------- 55 | 56 | 197 Phil Jackson 57 | 27 Natalie Weizenbaum 58 | 25 Óscar Fuentes 59 | 22 Moritz Bunkus 60 | 20 Rémi Vanicat 61 | 17 Aaron Culich 62 | 10 Timo Juhani Lindfors 63 | 8 Ramkumar Ramachandra 64 | 8 Ævar Arnfjörð Bjarmason 65 | 6 Yann Hodique 66 | 5 Hannu Koivisto 67 | 5 Julien Danjou 68 | 5 Peter J. Weisberg 69 | 4 Leo Liu 70 | 3 Robin Green 71 | 2 Brian Warner 72 | 2 Christian Kluge 73 | 2 Marc Herbert 74 | 1 Andreas Fuchs 75 | 1 Chris Bernard 76 | 1 David Abrahams 77 | 1 Dominique Quatravaux 78 | 1 John Wiegley 79 | 1 Paul Stadig 80 | 1 Philip Weaver 81 | 1 Remco van 't Veer 82 | 1 Robert Boone 83 | 1 Rüdiger Sonderfeld 84 | 1 Tom Feist 85 | -------------------------------------------------------------------------------- /docs/RelNotes/3.1.0.org: -------------------------------------------------------------------------------- 1 | * It's Magit! A Git Porcelain inside Emacs 2 | 3 | Magit is a text-based Git user interface that puts an unmatched focus 4 | on streamlining workflows. Commands are invoked using short mnemonic 5 | key sequences that take the cursor’s position in the highly actionable 6 | interface into account to provide context-sensitive behavior. 7 | 8 | With Magit you can do nearly everything that you can do when using Git 9 | on the command-line, but at greater speed and while taking advantage 10 | of advanced features that previously seemed too daunting to use on a 11 | daily basis. Many users will find that by using Magit they can become 12 | more effective Git user. 13 | 14 | For more information about Magit, see https://magit.vc. 15 | 16 | * Magit v3.1.0 Release Notes 17 | 18 | Released 1st July 2021 by Jonas Bernoulli. 19 | 20 | I am pleased to announce the release of Magit version 3.1.0, 21 | representing 31 commits by 4 contributors over one month. 22 | 23 | Also see https://emacsair.me/2021/07/01/magit-3.1. 24 | 25 | ** Breaking changes 26 | 27 | - The function signature of ~magit-completing-read-multiple~ was not 28 | compatible with that of ~completing-read-multiple~, so we deprecate 29 | it. Use the improved ~magit-completing-read-multiple*~ instead. 30 | #4420 31 | 32 | - The description of ~magit-merge-into~ in the merge menu was changed 33 | to "dissolve" (from "merge into"). In the future we are going to 34 | change the key binding from "i" to "d" as well, to keep it mnemonic. 35 | We don't make both changes at once in the hope that this makes the 36 | transition easier for existing users. 4c096921f 37 | 38 | ** Changes since v3.0.0 39 | 40 | - Adjusted to changes to Eieio in Emacs 28. a3626277c, 54a0019f3 41 | 42 | - Added new command ~magit-log-move-to-revision~. #4418 43 | 44 | - ~A m~ is now also bound to ~magit-merge-squash~. Despite the name it 45 | fits better there. 51152fdec 46 | 47 | ** Fixes since v3.0.0 48 | 49 | - Fixed ~magit-emacs-Q-command~ and ~make build~ for ELPA users. 50 | f50c3aa56 51 | 52 | - Fixed reading choice in ~magit-process-git-credential-manager-core~. 53 | #4396 54 | 55 | - ~magit-blame~ didn't account for quoted file names when parsing 56 | output from ~git blame~. #4400 57 | 58 | - A regression in v3.0.0 prevented ~magit-bisect-run~ from executing 59 | ~git bisect run~ unless ~magit-bisect-start~ was called beforehand. 60 | f592e367d 61 | 62 | - ~magit-log-select-quit~ failed to call ~magit-log-select-quit-function~. 63 | #4423 64 | 65 | - The entry for pull-requests in ~magit-list-refs-namespaces~ did not 66 | match the ref names used by Forge for that purpose. 4c3373f9a 67 | 68 | * Authors 69 | 70 | 24 Jonas Bernoulli 71 | 3 Kyle Meyer 72 | 1 Siavash Askari Nasr 73 | 1 TEC 74 | -------------------------------------------------------------------------------- /lisp/magit-libgit.el: -------------------------------------------------------------------------------- 1 | ;;; magit-libgit.el --- (POC) Teach Magit to use Libgit2 -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; Homepage: https://github.com/magit/magit 9 | ;; Keywords: git tools vc 10 | 11 | ;; Package-Version: 3.3.0.50-git 12 | ;; Package-Requires: ( 13 | ;; (emacs "26.1") 14 | ;; (compat "29.1.3.4") 15 | ;; (libgit "0") 16 | ;; (seq "2.24") 17 | ;; (magit "3.3.0")) 18 | 19 | ;; SPDX-License-Identifier: GPL-3.0-or-later 20 | 21 | ;; Magit is free software: you can redistribute it and/or modify 22 | ;; it under the terms of the GNU General Public License as published 23 | ;; by the Free Software Foundation, either version 3 of the License, 24 | ;; or (at your option) any later version. 25 | ;; 26 | ;; Magit is distributed in the hope that it will be useful, 27 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | ;; GNU General Public License for more details. 30 | ;; 31 | ;; You should have received a copy of the GNU General Public License 32 | ;; along with Magit. If not, see . 33 | 34 | ;; You should have received a copy of the AUTHORS.md file, which 35 | ;; lists all contributors. If not, see https://magit.vc/authors. 36 | 37 | ;;; Commentary: 38 | 39 | ;; This package teaches Magit to use functions provided by the 40 | ;; `libegit2' module to perform certain tasks. That module used the 41 | ;; Libgit2 implementation of the Git core methods and is implemented 42 | ;; in the `libgit' package. 43 | 44 | ;; The hope is that using a C module instead of calling out to `git' 45 | ;; all the time increases performance; especially on Windows where 46 | ;; starting a process is unreasonably slow. 47 | 48 | ;; This package is still experimental and not many functions have been 49 | ;; reimplemented to use `libgit' yet. 50 | 51 | ;;; Code: 52 | 53 | (require 'cl-lib) 54 | (require 'compat) 55 | (require 'dash) 56 | (require 'eieio) 57 | (require 'subr-x) 58 | 59 | (when (and (featurep' seq) 60 | (not (fboundp 'seq-keep))) 61 | (unload-feature 'seq 'force)) 62 | (require 'seq) 63 | 64 | (require 'magit-git) 65 | 66 | (require 'libgit) 67 | 68 | ;;; Utilities 69 | 70 | (defun magit-libgit-repo (&optional directory) 71 | "Return an object for the repository in DIRECTORY. 72 | If optional DIRECTORY is nil, then use `default-directory'." 73 | (and-let* ((default-directory 74 | (let ((magit-inhibit-libgit t)) 75 | (magit-gitdir directory)))) 76 | (magit--with-refresh-cache 77 | (cons default-directory 'magit-libgit-repo) 78 | (libgit-repository-open default-directory)))) 79 | 80 | ;;; Methods 81 | 82 | (cl-defmethod magit-bare-repo-p 83 | (&context ((magit-gitimpl) (eql libgit)) &optional noerror) 84 | (and (magit--assert-default-directory noerror) 85 | (if-let ((repo (magit-libgit-repo))) 86 | (libgit-repository-bare-p repo) 87 | (unless noerror 88 | (signal 'magit-outside-git-repo default-directory))))) 89 | 90 | ;;; _ 91 | (provide 'magit-libgit) 92 | ;;; magit-libgit.el ends here 93 | -------------------------------------------------------------------------------- /docs/RelNotes/1.1.0.txt: -------------------------------------------------------------------------------- 1 | Magit v1.1.0 Release Notes 2 | ========================== 3 | 4 | Released 23 December 2011 by Yann Hodique. 5 | 6 | Changes since v1.0.0 7 | -------------------- 8 | 9 | * Added distinct faces for various different kinds of refs. 10 | 11 | * Completely redesigned existing faces. 12 | 13 | * Added library `magit-classic-theme.el' for users who like the old 14 | faces better. 15 | 16 | * Share many more key bindings between all Magit modes. Previously 17 | many commands were only available in certain buffers, even though 18 | they are useful in all Magit buffers. 19 | 20 | * Added library `magit-simple-keys.el' for users who don't like the 21 | popups. 22 | 23 | * Added support for using Ido to do completion. 24 | 25 | * Added support for Ediff. 26 | 27 | * Added shell script `magit'. 28 | 29 | * Added library `magit-bisect.el'. 30 | 31 | * Added library `magit-stgit.el'. 32 | 33 | * Added mode `magit-svn-mode'. 34 | 35 | * Added mode `magit-topgit-mode'. 36 | 37 | * Added mode `magit-rebase-mode'. 38 | 39 | * Added buttons to commit buffer to cylce to commits which were 40 | previously shown. The commands are `magit-show-commit-backward' 41 | and `magit-show-commit-forward. 42 | 43 | * Defined backward compatibility implementations of some Emacs 44 | functions. 45 | 46 | * Type changes are now shown in diffs. 47 | 48 | * Added option `magit-set-upstream-on-push'. 49 | 50 | * Added option `magit-default-tracking-name-function'. 51 | 52 | * Added option `magit-log-auto-more'. 53 | 54 | * Added option `magit-create-branch-behaviour'. 55 | 56 | * Added option `magit-status-buffer-switch-function'. 57 | 58 | * Added option `magit-rewrite-inclusive'. 59 | 60 | * Added options `magit-highlight-trailing-whitespace' and 61 | `magit-highlight-indentation'. 62 | 63 | * Added command `magit-show'. Visit REVISION:FILE. 64 | 65 | * Added command `magit-delete-branch-forced'. 66 | 67 | * Added command `magit-log-edit-toggle-author'. 68 | 69 | * `magit-reset-working-tree' learned to remove untracked files. 70 | 71 | * `magit-push' learned to set the upstream branch. 72 | 73 | Authors 74 | ------- 75 | 76 | 152 Peter J. Weisberg 77 | 55 Yann Hodique 78 | 18 Phil Jackson 79 | 18 Pieter Praet 80 | 18 Rémi Vanicat 81 | 12 Moritz Bunkus 82 | 10 Lluís Vilanova 83 | 8 Eli Barzilay 84 | 7 Nicolas Dudebout 85 | 6 Roger Crew 86 | 5 Štěpán Němec 87 | 3 David Abrahams 88 | 3 Hannu Koivisto 89 | 3 Jeff Bellegarde 90 | 3 Rüdiger Sonderfeld 91 | 2 Alan Falloon 92 | 2 Andreas Rottmann 93 | 2 Andrew Kirkpatrick 94 | 2 Craig Andera 95 | 2 Jasper St. Pierre 96 | 1 Andrey Smirnov 97 | 1 Bastian Beischer 98 | 1 Chris Moore 99 | 1 Daniel Brockman 100 | 1 Eric Davis 101 | 1 George Kadianakis 102 | 1 Kimberly Wolk 103 | 1 Luke Amdor 104 | 1 Luís Borges de Oliveira 105 | 1 Marc Herbert 106 | 1 Marco Craveiro 107 | 1 Ramkumar Ramachandra 108 | 1 Steve Purcell 109 | 1 Thomas Jost 110 | 1 Tibor Simko 111 | 1 Tom Feist 112 | 1 Ævar Arnfjörð Bjarmason 113 | -------------------------------------------------------------------------------- /docs/RelNotes/2.7.0.txt: -------------------------------------------------------------------------------- 1 | Magit v2.7.0 Release Notes 2 | ========================== 3 | 4 | Released 19 May 2016 by Jonas Bernoulli. 5 | 6 | We are pleased to announce the release of Magit version 2.7.0, 7 | representing 116 commits by 7 people over 7 weeks. 8 | 9 | Also see http://emacsair.me/2016/05/19/magit-2.7. 10 | 11 | Changes since v2.6.0 12 | -------------------- 13 | 14 | * Added new popup `magit-subtree-popup' and bound "O" to it. 15 | 16 | * Added new popup `magit-branch-config-popup' and made it available 17 | from the popups `magit-branch-popup', `magit-pull-and-fetch-popup', 18 | `magit-pull-popup', `magit-fetch-popup', and `magit-push-popup'. 19 | 20 | With a prefix argument it reads a branch to be configured in the 21 | minibuffer instead of using the current branch. 22 | 23 | * Added new option `magit-branch-popup-show-variables', defaulting to 24 | t to avoid changing key bindings. When set to nil, no variables are 25 | displayed directly in the `magit-branch-popup', instead the subpopup 26 | `magit-branch-config-popup' has to be used. 27 | 28 | * Added new popup command `magit-log-buffer-file-popup'. 29 | 30 | * Added new command `magit-diff-buffer-file' and new option 31 | `magit-diff-buffer-file-locked'. When the value of the option is 32 | non-nil, the default, then the command uses a dedicated buffer. 33 | 34 | * Added new option `magit-log-buffer-file-locked'. When its value is 35 | non-nil, the default, then `magit-log-buffer-file' uses a dedicated 36 | buffer. 37 | 38 | * Added new commands `magit-worktree-checkout', 39 | `magit-worktree-branch', `magit-worktree-delete', 40 | and `magit-worktree-status'. 41 | 42 | * Added new section inserter `magit-insert-worktrees' 43 | 44 | * The command `magit-clone' now runs asynchronously, which avoids 45 | blocking Emacs and allows handling password prompts. 46 | 47 | * The command `magit-stage' learned to stage an untracked file while 48 | leaving its content unstaged (i.e., `git add --intent-to-add') when 49 | called with a prefix argument. 50 | 51 | * The command `magit-reverse' learned to use `--reject' to ensure that 52 | non-conflicting hunks are applied and that conflicting hunks are put 53 | into reject files. 54 | 55 | * When the command `magit-discard' is used on staged changes, then 56 | that is done by first reversing the changes in the index and then in 57 | the working tree. The second step could fail due to conflicts. Now 58 | the `--reject' argument is used, which ensures that non-conflicting 59 | hunks are applied and that conflicting hunks are put into reject 60 | files. 61 | 62 | * The command `magit-rebase-continue' learned to reuse the old commit 63 | message as-is when called with a prefix argument. 64 | 65 | * In the refs buffer symbolic refs, such as "remotes/origin/HEAD", are 66 | no longer omitted from the lists of local and remote branches. 67 | 68 | This release also contains the fixes described in the v2.6.1 and 69 | v2.6.2 release notes, as well as various other documentation fixes, 70 | code clean-ups, bug fixes, and other small to medium improvements. 71 | 72 | Authors 73 | ------- 74 | 75 | 95 Jonas Bernoulli 76 | 10 Kyle Meyer 77 | 7 Noam Postavsky 78 | 1 Bart Bakker 79 | 1 Fritz Grabo 80 | 1 Ingo Lohmar 81 | 1 John Mastro 82 | -------------------------------------------------------------------------------- /docs/RelNotes/3.2.0.org: -------------------------------------------------------------------------------- 1 | * It's Magit! A Git Porcelain inside Emacs 2 | 3 | Magit is a text-based Git user interface that puts an unmatched focus 4 | on streamlining workflows. Commands are invoked using short mnemonic 5 | key sequences that take the cursor’s position in the highly actionable 6 | interface into account to provide context-sensitive behavior. 7 | 8 | With Magit you can do nearly everything that you can do when using Git 9 | on the command-line, but at greater speed and while taking advantage 10 | of advanced features that previously seemed too daunting to use on a 11 | daily basis. Many users will find that by using Magit they can become 12 | more effective Git user. 13 | 14 | For more information about Magit, see https://magit.vc. 15 | 16 | * Magit v3.2.0 Release Notes 17 | 18 | Released 1st August 2021 by Jonas Bernoulli. 19 | 20 | I am pleased to announce the release of Magit version 3.2.0, 21 | representing 84 commits by 5 contributors over one month. 22 | 23 | Also see https://emacsair.me/2021/08/01/magit-3.2. 24 | 25 | ** Changes since v3.1.0 26 | 27 | - The default of ~magit-bury-buffer-function~ was changed to 28 | ~magit-mode-quit-window~. #4412 29 | 30 | - Added new option ~magit-remote-git-executable~ alongside the existing 31 | ~magit-git-executable~. Previously the latter was used for local and 32 | remote ~git~ processes alike, now the former specifies the executable 33 | that is used when Tramp is involved. Using a single variable was 34 | problematic because we had to use an absolute path on Windows for 35 | performance reasons but that path was almost certainly wrong when 36 | using Tramp. #4447 37 | 38 | - We now use an absolute path for ~magit-git-executable~ on macOS as 39 | well because at least for some macOS users using just the name of 40 | the executable performs horribly. #4447 41 | 42 | - The section showing openpgp output in the revision buffer is now 43 | collapsible and starts out collapsed for good signatures or when the 44 | certificate is missing. This hopefully makes it more appealing to 45 | enable ~--show-signature~ (and maybe even encourages some authors to 46 | start signing commits). 1e08ac6fd 47 | 48 | - A mode change or rename can now be applied (un-/staged etc.) without 49 | also applying edits to the same file and vice-versa. #4439 50 | 51 | - Many commands that act on (or default to) the commit at point now 52 | pick that up in a few more places; when the string at point is a 53 | known hash, on a blame chunk, and on a hunk or file inside a log. 54 | d8d3e4813, 40ad7a25c, 402112c6e 55 | 56 | - The default ~magit-pop-revision-stack-format~ now include the 57 | committer date. 1f85297a3 58 | 59 | - The default ~magit-log-revision-headers-format~ now includes notes. 60 | 33bd79fd45 61 | 62 | - Added new options ~magit-repolist-sort-key~ 63 | and ~magit-submodule-list-sort-key~. #4409 64 | 65 | - Added new function ~magit-repolist-column-flags~. 35067f512 66 | 67 | - Added new option ~magit-ediff-use-indirect-buffers~. #4395 68 | 69 | - Added new function ~magit-process-git~. fd5cf6173 70 | 71 | - Added new function ~magit-git-config-p~. 60f82a323 72 | 73 | ** Fixes since v3.1.0 74 | 75 | - In the normal case ~magit-name-tag~ failed to return the tag. 76 | 14170b4ea 77 | 78 | - ~magit-completing-read-multiple*~ tried to use a variable that is 79 | unbound if ~helm~ isn't loaded. 29b0cb489 80 | 81 | - Some push commands couldn't deal with remote and branch names that 82 | contain the percent character. #4428 83 | 84 | - ~magit-git-shortlog~ got stuck in the repository in which it was first 85 | invoked. 384610edb 86 | 87 | - ~magit-commit-augment~ did not support ~--allow-empty~. bbdfd4287 88 | 89 | - Squash commands didn't fully take ~--author~ into account. 02d2917c6 90 | 91 | - ~magit-completing-read-multiple*~ conflicted with the ~consult~ package. 92 | #4437 93 | 94 | * Authors 95 | 96 | 73 Jonas Bernoulli 97 | 6 Kyle Meyer 98 | 2 Boruch Baum 99 | 1 Philippe Cavalaria 100 | 1 Toon Claes 101 | -------------------------------------------------------------------------------- /docs/RelNotes/2.10.0.txt: -------------------------------------------------------------------------------- 1 | It's Magit! A Git Porcelain inside Emacs 2 | ========================================= 3 | 4 | Magit is an interface to the version control system Git, implemented 5 | as an Emacs package. Magit aspires to be a complete Git porcelain. 6 | While we cannot (yet) claim that Magit wraps and improves upon each 7 | and every Git command, it is complete enough to allow even experienced 8 | Git users to perform almost all of their daily version control tasks 9 | directly from within Emacs. While many fine Git clients exist, only 10 | Magit and Git itself deserve to be called porcelains. 11 | 12 | For more information about Magit, see https://magit.vc. 13 | 14 | If Magit helps you be more productive, then please consider donating 15 | at https://magit.vc/donate/. 16 | 17 | Magit v2.10.0 Release Notes 18 | =========================== 19 | 20 | Released 4 January 2017 by Jonas Bernoulli. 21 | 22 | We are pleased to announce the release of Magit version 2.10.0, 23 | representing 85 commits by six people over one month. 24 | 25 | Also see https://emacsair.me/2017/01/04/magit-2.10. 26 | 27 | Changes since v2.9.0 28 | -------------------- 29 | 30 | * Many new, well organized, libraries were added, consisting of code 31 | that was previously located inside a messier "magit.el". #2908 32 | 33 | * The function `magit-display-buffer' now sets the focus on the frame 34 | used to display the selected window. #2865 35 | 36 | * The Custom groups are better organized now. New groups were added, 37 | but many options also moved between groups that already existed 38 | before. 422d776e, 33c5c1ca 39 | 40 | * Many Custom groups and options now link to the relevant Info nodes 41 | and to other relevant groups. 810d7fb4 42 | 43 | * Many doc-strings were improved, added, and fixed. 47aae617 44 | 45 | * Added the function `magit-repolist-column-dirty', which can be added 46 | to `magit-repolist-columns' and `magit-submodule-list-columns'. #2907 47 | 48 | * The obsolete variable `magit-repository-directory-depth' is no 49 | longer defined as an option. 09993c39 50 | 51 | * The obsolete hook variable `magit-status-refresh-hook' is no longer 52 | defined explicitly. 7e96e831 53 | 54 | Fixes since v2.9.0 55 | ------------------ 56 | 57 | * Customizations of hooks were ignored, if the `custom-set-variables' 58 | form was evaluated before the Magit libraries were loaded. #2902 59 | 60 | * When rebase stopped at a commit, point was no longer placed on that 61 | commit. #2884 62 | 63 | * When creating a commit, `magit-display-buffer-fullcolumn-most-v1' 64 | filled the entire frame, hiding the commit message buffer. #2891 65 | 66 | * The commands `magit-reflog' and `magit-reflog-current' reported 67 | a revision's reflog as empty when the name of a file in the 68 | repository, relative to the top-level directory, matched the 69 | revision name. 5264ffcb 70 | 71 | * The function `magit-repolist-column-upstream' returned the current 72 | branch instead of its upstream. 46acbd6d 73 | 74 | * The functions `magit-repolist-column-unpulled-from-upstream' and 75 | `magit-repolist-column-unpushed-to-upstream' raised a type error 76 | if the upstream was configured but did not exist. #2904 77 | 78 | * The default values of the options `magit-submodule-list-columns' 79 | and `magit-repolist-columns' didn't match the documentation and the 80 | Custom type. But the code that that uses these values is resilient 81 | against that defect and so the only effect was that the values were 82 | reported as mismatched in the Custom interface. 79f6af23 83 | 84 | * The Custom type of option `magit-update-other-window-delay' didn't 85 | match the default value. eb6d8bde 86 | 87 | * The shell command generated by `magit-emacs-Q-command' could end 88 | up trying to load a directory as a library, due to a bug in Emacs. 89 | 83980c66, debbugs#16406 90 | 91 | This release also contains documentation updates and typo fixes. 92 | 93 | Authors 94 | ------- 95 | 96 | 68 Jonas Bernoulli 97 | 13 Kyle Meyer 98 | 1 Aleksey Uimanov 99 | 1 Alexander Gramiak 100 | 1 Noam Postavsky 101 | 1 Wouter Bolsterlee 102 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Alex Dunn 2 | Alex Ott 3 | Allen Li 4 | Andriy Kmit' 5 | Bar Magal 6 | Benjamin Motz 7 | Bradley Wright 8 | Buster Copley 9 | Chillar Anand 10 | Christophe Junke 11 | Damien Cassou 12 | Daniel Fleischer danielfleischer 13 | David Abrahams 14 | David Ellison 15 | Dean Kariniemi <8913263+d3k4r@users.noreply.github.com> 16 | Dennis Paskorz 17 | Dominique Quatravaux 18 | Evan Torrie 19 | Evgkeni Sampelnikof 20 | Evgkeni Sampelnikof 21 | Fabian Wiget 22 | Fritz Stelzer 23 | Graham Clark 24 | Ivan Brennan 25 | Jean-Louis Giordano 26 | Jesse Alama 27 | Joakim Jalap 28 | Johann Klähn 29 | Jon Vanderwijk 30 | Jonas Bernoulli 31 | Jonas Bernoulli 32 | Kan-Ru Chen 33 | Leo Liu 34 | Li Chen 35 | Luís Oliveira 36 | Luís Oliveira Luís Borges de Oliveira 37 | Marc Herbert 38 | Marc Herbert 39 | Marcel Wolf marcel-wolf 40 | Marian Schubert 41 | Marius Vollmer 42 | Marius Vollmer 43 | Marius Vollmer 44 | Marius Vollmer 45 | Marius Vollmer 46 | Mark Karpov 47 | Markus Beppler <65115492+mbeppler@users.noreply.github.com> 48 | N. Troy de Freitas <9503857+ntdef@users.noreply.github.com> 49 | Naoya Yamashita 50 | Natalie Weizenbaum Nathan Weizenbaum 51 | Noam Postavsky 52 | Noam Postavsky 53 | Pancho Horrillo 54 | Peter J. Weisberg 55 | Peter Vasil 56 | Phil Sainty 57 | Philippe Vaucher 58 | Raimon Grau 59 | Robert Irelan 60 | Ron Parker 61 | Rémi Vanicat 62 | Rüdiger Sonderfeld 63 | Sean Allred 64 | Seong-Kook Shin 65 | Silent Sphere 66 | Sylvain Rousseau 67 | Syohei Yoshida 68 | Sébastien Gross 69 | Thierry Volpiatto 70 | Tunc Uzlu 71 | Wei Huang 72 | Wilfred Hughes 73 | Wouter Bolsterlee 74 | Yann Hodique 75 | Yann Hodique 76 | Yann Hodique 77 | Yann Hodique 78 | Yuichi Higashi 79 | Óscar Fuentes 80 | Óscar Fuentes 81 | Óscar Fuentes 82 | -------------------------------------------------------------------------------- /lisp/magit-bookmark.el: -------------------------------------------------------------------------------- 1 | ;;; magit-bookmark.el --- Bookmark support for Magit -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Inspired by an earlier implementation by Yuri Khan. 6 | 7 | ;; Author: Jonas Bernoulli 8 | ;; Maintainer: Jonas Bernoulli 9 | 10 | ;; SPDX-License-Identifier: GPL-3.0-or-later 11 | 12 | ;; Magit is free software: you can redistribute it and/or modify it 13 | ;; under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | ;; 17 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 18 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 20 | ;; License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with Magit. If not, see . 24 | 25 | ;;; Commentary: 26 | 27 | ;; Support for bookmarks for most Magit buffers. 28 | 29 | ;;; Code: 30 | 31 | (require 'magit) 32 | 33 | ;;; Diff 34 | ;;;; Diff 35 | 36 | (put 'magit-diff-mode 'magit-bookmark-variables 37 | '(magit-buffer-range-hashed 38 | magit-buffer-typearg 39 | magit-buffer-diff-args 40 | magit-buffer-diff-files)) 41 | 42 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-diff-mode)) 43 | (format "magit-diff(%s%s)" 44 | (pcase (magit-diff-type) 45 | ('staged "staged") 46 | ('unstaged "unstaged") 47 | ('committed magit-buffer-range) 48 | ('undefined 49 | (delq nil (list magit-buffer-typearg magit-buffer-range-hashed)))) 50 | (if magit-buffer-diff-files 51 | (concat " -- " (mapconcat #'identity magit-buffer-diff-files " ")) 52 | ""))) 53 | 54 | ;;;; Revision 55 | 56 | (put 'magit-revision-mode 'magit-bookmark-variables 57 | '(magit-buffer-revision-hash 58 | magit-buffer-diff-args 59 | magit-buffer-diff-files)) 60 | 61 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-revision-mode)) 62 | (format "magit-revision(%s %s)" 63 | (magit-rev-abbrev magit-buffer-revision) 64 | (if magit-buffer-diff-files 65 | (mapconcat #'identity magit-buffer-diff-files " ") 66 | (magit-rev-format "%s" magit-buffer-revision)))) 67 | 68 | ;;;; Stash 69 | 70 | (put 'magit-stash-mode 'magit-bookmark-variables 71 | '(magit-buffer-revision-hash 72 | magit-buffer-diff-args 73 | magit-buffer-diff-files)) 74 | 75 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-stash-mode)) 76 | (format "magit-stash(%s %s)" 77 | (magit-rev-abbrev magit-buffer-revision) 78 | (if magit-buffer-diff-files 79 | (mapconcat #'identity magit-buffer-diff-files " ") 80 | (magit-rev-format "%s" magit-buffer-revision)))) 81 | 82 | ;;; Log 83 | ;;;; Log 84 | 85 | (put 'magit-log-mode 'magit-bookmark-variables 86 | '(magit-buffer-revisions 87 | magit-buffer-log-args 88 | magit-buffer-log-files)) 89 | 90 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-log-mode)) 91 | (format "magit-log(%s%s)" 92 | (mapconcat #'identity magit-buffer-revisions " ") 93 | (if magit-buffer-log-files 94 | (concat " -- " (mapconcat #'identity magit-buffer-log-files " ")) 95 | ""))) 96 | 97 | ;;;; Cherry 98 | 99 | (put 'magit-cherry-mode 'magit-bookmark-variables 100 | '(magit-buffer-refname 101 | magit-buffer-upstream)) 102 | 103 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-cherry-mode)) 104 | (format "magit-cherry(%s > %s)" 105 | magit-buffer-refname 106 | magit-buffer-upstream)) 107 | 108 | ;;;; Reflog 109 | 110 | (put 'magit-reflog-mode 'magit-bookmark-variables 111 | '(magit-buffer-refname)) 112 | 113 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-reflog-mode)) 114 | (format "magit-reflog(%s)" magit-buffer-refname)) 115 | 116 | ;;; Misc 117 | 118 | (put 'magit-status-mode 'magit-bookmark-variables nil) 119 | 120 | (put 'magit-refs-mode 'magit-bookmark-variables 121 | '(magit-buffer-upstream 122 | magit-buffer-arguments)) 123 | 124 | (put 'magit-stashes-mode 'magit-bookmark-variables nil) 125 | 126 | (cl-defmethod magit-bookmark-name (&context (major-mode magit-stashes-mode)) 127 | (format "magit-states(%s)" magit-buffer-refname)) 128 | 129 | ;;; _ 130 | (provide 'magit-bookmark) 131 | ;;; magit-bookmark.el ends here 132 | -------------------------------------------------------------------------------- /docs/RelNotes/2.8.0.txt: -------------------------------------------------------------------------------- 1 | Magit v2.8.0 Release Notes 2 | ========================== 3 | 4 | Released 21 August 2016 by Jonas Bernoulli. 5 | 6 | We are pleased to announce the release of Magit version 2.8.0, 7 | representing 124 commits by 11 people over 3 months. 8 | 9 | Also see http://emacsair.me/2016/08/21/magit-2.8. 10 | 11 | Changes since v2.7.0 12 | -------------------- 13 | 14 | * Added several new functions that are suitable values for 15 | `magit-display-buffer-function': 16 | `magit-display-buffer-same-window-except-diff-v1', 17 | `magit-display-buffer-fullframe-status-v1', 18 | `magit-display-buffer-fullframe-status-topleft-v1', and 19 | `magit-display-buffer-fullcolumn-most-v1'. 20 | 21 | * Added new commands `magit-list-repositories' and related new option 22 | `magit-repolist-columns'. 23 | 24 | * Added new commands `magit-list-submodules and related new option 25 | `magit-submodule-list-columns'. 26 | 27 | * Added new command `magit-branch-orphan'. 28 | 29 | * Added new command `magit-log-move-to-parent'. 30 | 31 | * Added support for globbing in file arguments of diff and log 32 | commands. 33 | 34 | * Added support for showing and copying bad commit identified by git 35 | bisect. 36 | 37 | * Added new option `magit-log-output-coding-system'. 38 | 39 | * Added new option `magit-no-message', which can be used to suppress 40 | certain messages whose usefulness are being disputed. 41 | 42 | * Taught `magit-find-file-noselect' and `magit-find-index-noselect' to 43 | use Emacs' encoding detection, and enable `revert-buffer' to work in 44 | those buffers. This makes `magit-ediff-*' commands more useful for 45 | files with non-standard encoding. 46 | 47 | * Taught `magit-insert-bisect-rest' to show the log graph by default. 48 | The new option `magit-bisect-show-graph' controls this. 49 | 50 | * Taught `magit-insert-submodules' to display more information. 51 | 52 | * When a refresh causes the previously current hunk section to 53 | disappear, which happens when it was applied in some way, then we 54 | attempt to move to a sibling hunk. When that succeeds, then that is 55 | now considered a proper move and `magit-section-movement-hook' is 56 | called, which in turn may cause the current hunk to be recentered. 57 | 58 | * In addition to the directory, each member of the value of option 59 | `magit-repository-directories' can now specify the depth to look for 60 | repositories inside that directory, overriding the default depth 61 | specified using the option `magit-repository-directories-depth'. 62 | 63 | * Blob visiting buffers can now be reverted, which is useful when they 64 | visit a reference. 65 | 66 | * Command `magit-stage' can now be used outside of Magit buffers. 67 | 68 | * Commands that read a branch or commit from the user now also offer 69 | tags as completion candidates. 70 | 71 | * Taught `magit-insert-worktrees' to use relative filenames. 72 | 73 | Fixes since v2.7.0 74 | ------------------ 75 | 76 | * Function `magit-get-all' did split multi-line values into multiple 77 | values. 78 | 79 | * Function `magit-subtree-read-prefix' which is used in order to read 80 | the `--prefix' argument from the subtree popup was missing. 81 | 82 | * Command `magit-blame' failed when run in a blob buffer for a file 83 | located in a subdirectory. 84 | 85 | * Command `magit-diff-visit-file' didn't visit a blob when called 86 | inside a `magit-stash-mode' buffer. 87 | 88 | * Command `magit-submodule-add' did not allow picking a path that 89 | does not exist yet and read the path before the url. 90 | 91 | * Command `magit-submodule-setup' did update existing modules, which 92 | can cause them to become detached. 93 | 94 | * Command `magit-popup-describe-function' could create an extra window 95 | on wide frames. 96 | 97 | * Commands `magit-diff-show-or-scroll-{up,down}' failed to scroll 98 | stash buffers. 99 | 100 | * Mode `git-rebase-mode' did not respect the Git variable 101 | `core.commentChar'. 102 | 103 | * Sections in the process buffer sometimes had invalid parent 104 | sections, causing movement and visibility commands to fail, and 105 | expected Git errors not to be handled gracefully in some cases. 106 | 107 | * Merges where not performed asynchronously, which made it impossible 108 | to read a passphrase from the user, needed for commit signing. 109 | 110 | * In bare repositories tracked files were listed as deleted. 111 | 112 | This release also contains typofixes, documentation updates, code 113 | clean-ups, bug fixes, and other small to medium improvements. 114 | 115 | Authors 116 | ------- 117 | 118 | 59 Jonas Bernoulli 119 | 33 Noam Postavsky 120 | 23 Kyle Meyer 121 | 2 Mario Rodas 122 | 1 Andriy Kmit' 123 | 1 Basil L. Contovounesios 124 | 1 Chris Shoemaker 125 | 1 Ivan Brennan 126 | 1 Laverne Schrock 127 | 1 Samuel W. Flint 128 | 1 Wilfred Hughes 129 | -------------------------------------------------------------------------------- /lisp/magit-core.el: -------------------------------------------------------------------------------- 1 | ;;; magit-core.el --- Core functionality -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library requires several other libraries, so that yet other 26 | ;; libraries can just require this one, instead of having to require 27 | ;; all the other ones. In other words this separates the low-level 28 | ;; stuff from the rest. It also defines some Custom groups. 29 | 30 | ;;; Code: 31 | 32 | (require 'magit-base) 33 | (require 'magit-git) 34 | (require 'magit-mode) 35 | (require 'magit-margin) 36 | (require 'magit-process) 37 | (require 'magit-transient) 38 | (require 'magit-autorevert) 39 | 40 | (when (and (not magit-inhibit-libgit) 41 | (magit--libgit-available-p)) 42 | (condition-case err 43 | (require 'magit-libgit) 44 | (error 45 | (setq magit-inhibit-libgit 'error) 46 | (message "Error while loading `magit-libgit': %S" err) 47 | (message "That is not fatal. The `libegit2' module just won't be used.")))) 48 | 49 | ;;; Options 50 | 51 | (defgroup magit nil 52 | "Controlling Git from Emacs." 53 | :link '(url-link "https://magit.vc") 54 | :link '(info-link "(magit)FAQ") 55 | :link '(info-link "(magit)") 56 | :group 'tools) 57 | 58 | (defgroup magit-essentials nil 59 | "Options that every Magit user should briefly think about. 60 | 61 | Each of these options falls into one or more of these categories: 62 | 63 | * Options that affect Magit's behavior in fundamental ways. 64 | * Options that affect safety. 65 | * Options that affect performance. 66 | * Options that are of a personal nature." 67 | :link '(info-link "(magit)Essential Settings") 68 | :group 'magit) 69 | 70 | (defgroup magit-miscellaneous nil 71 | "Miscellaneous Magit options." 72 | :group 'magit) 73 | 74 | (defgroup magit-commands nil 75 | "Options controlling behavior of certain commands." 76 | :group 'magit) 77 | 78 | (defgroup magit-modes nil 79 | "Modes used or provided by Magit." 80 | :group 'magit) 81 | 82 | (defgroup magit-buffers nil 83 | "Options concerning Magit buffers." 84 | :link '(info-link "(magit)Modes and Buffers") 85 | :group 'magit) 86 | 87 | (defgroup magit-refresh nil 88 | "Options controlling how Magit buffers are refreshed." 89 | :link '(info-link "(magit)Automatic Refreshing of Magit Buffers") 90 | :group 'magit 91 | :group 'magit-buffers) 92 | 93 | (defgroup magit-faces nil 94 | "Faces used by Magit." 95 | :group 'magit 96 | :group 'faces) 97 | 98 | (custom-add-to-group 'magit-faces 'diff-refine-added 'custom-face) 99 | (custom-add-to-group 'magit-faces 'diff-refine-removed 'custom-face) 100 | 101 | (defgroup magit-extensions nil 102 | "Extensions to Magit." 103 | :group 'magit) 104 | 105 | (custom-add-to-group 'magit-modes 'git-commit 'custom-group) 106 | (custom-add-to-group 'magit-faces 'git-commit-faces 'custom-group) 107 | (custom-add-to-group 'magit-modes 'git-rebase 'custom-group) 108 | (custom-add-to-group 'magit-faces 'git-rebase-faces 'custom-group) 109 | (custom-add-to-group 'magit 'magit-section 'custom-group) 110 | (custom-add-to-group 'magit-faces 'magit-section-faces 'custom-group) 111 | (custom-add-to-group 'magit-process 'with-editor 'custom-group) 112 | 113 | (defgroup magit-related nil 114 | "Options that are relevant to Magit but that are defined elsewhere." 115 | :link '(custom-group-link vc) 116 | :link '(custom-group-link smerge) 117 | :link '(custom-group-link ediff) 118 | :link '(custom-group-link auto-revert) 119 | :group 'magit 120 | :group 'magit-extensions 121 | :group 'magit-essentials) 122 | 123 | (custom-add-to-group 'magit-related 'auto-revert-check-vc-info 'custom-variable) 124 | (custom-add-to-group 'magit-auto-revert 'auto-revert-check-vc-info 'custom-variable) 125 | 126 | (custom-add-to-group 'magit-related 'ediff-window-setup-function 'custom-variable) 127 | (custom-add-to-group 'magit-related 'smerge-refine-ignore-whitespace 'custom-variable) 128 | (custom-add-to-group 'magit-related 'vc-follow-symlinks 'custom-variable) 129 | 130 | ;;; _ 131 | (provide 'magit-core) 132 | ;;; magit-core.el ends here 133 | -------------------------------------------------------------------------------- /docs/RelNotes/2.5.0.txt: -------------------------------------------------------------------------------- 1 | Magit v2.5.0 Release Notes 2 | ========================== 3 | 4 | Released 30 January 2016 by Jonas Bernoulli. 5 | 6 | We are pleased to announce the release of Magit version 2.5.0, 7 | representing 78 commits by 4 contributors over 2 weeks. 8 | 9 | Also see http://emacsair.me/2016/02/10/magit-2.5. 10 | 11 | Changes since v2.4.0 12 | -------------------- 13 | 14 | * The library `with-editor.el' reincarnated as a separate repository. 15 | 16 | It was already available as a separate package, and since it can be 17 | of use for packages that have absolutely nothing to do with `magit' 18 | it makes sense to maintain it separately. That wasn't done before 19 | because that would have made it harder to change it and its users 20 | within the magit repository in parallel. I expect there will be 21 | few such changes in the future. 22 | 23 | * Added new library `magit-submodule.el'. It contains code that was 24 | previously spread across various libraries. 25 | 26 | * Added new option `auto-revert-buffer-list-filter' and redefined 27 | `auto-revert-buffers' from `autorevert.el' to use it. Added new 28 | predicates `magit-auto-revert-buffer-p' and the more restrictive 29 | `magit-auto-revert-repository-buffer-p', which are both intended 30 | to be used as potential value of the option. 31 | 32 | For now the option defaults to `nil', but that might change in a 33 | future release. When Magit explicitly calls `auto-revert-buffers' 34 | (as opposed to when that is called due to a file notification event 35 | or by a timer), and `auto-revert-buffer-list-filter' is `nil', then 36 | it is let-bound to `magit-auto-revert-repository-buffer-p'. 37 | 38 | Users who use Tramp and experience delays, should consider setting 39 | the option to `magit-auto-revert-repository-buffer-p'. 40 | 41 | * By default, invoking `magit-unstage' on a committed change now 42 | performs an action which is somewhat similar to unstaging. The 43 | change is reverted in the index, but not the working tree. This 44 | allows extracting changes from HEAD. 45 | 46 | Setting the new option `magit-unstage-committed' to nil, disables 47 | this behavior. Attempting to unstage a committed change would then 48 | result in an error again. 49 | 50 | * Because file notifications may arrive with a delay, the option 51 | `magit-auto-revert-immediately' now defaults to `t' even when file 52 | notifications can be used, 53 | 54 | * Like `magit-refresh' already did, `magit-refresh-all' now runs the 55 | hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'. 56 | 57 | * The heading of the section which lists commits that exist in the 58 | current branch but not in its upstream was changed from "Unpushed 59 | to " to "Unmerged into ", because one usually 60 | should merge into that branch instead of pushing to it. 61 | 62 | * Added new commands `magit-remote-set-head' and 63 | `magit-remote-unset-head'. 64 | 65 | * By default `magit-clone' now deletes the symbolic-ref "origin/HEAD" 66 | right after running `git clone', which insists on creating it. 67 | 68 | The new option `magit-clone-set-remote-head' can be set to `t' to 69 | go back to keeping that symbolic-ref. We default to removing it, 70 | because it does not actually get automatically updated when the 71 | HEAD of the remote changes, which makes it rather pointless. 72 | 73 | * Added new option `magit-prefer-remote-upstream' which controls 74 | whether commands which read the upstream or starting-point from 75 | the user would rather offer a local or a remote branch as default 76 | completion candidate. 77 | 78 | * Added the switch `--cover-letter' to `magit-patch-popup', and taught 79 | `magit-format-patch' to immediately open the letter in a buffer. 80 | 81 | * Added new option `++order' to the various log popups. This option 82 | and its value are converted to `--VALUE-order' before calling `git'. 83 | This option was added instead of the switches `--author-date-order', 84 | `--date-order', and `--topo-order' because adding all three would be 85 | too noisy and because they are mutually exclusive. 86 | 87 | Fixes since v2.4.1 88 | ------------------ 89 | 90 | * Creating a stash in a secondary working tree failed if no other 91 | stash already existed in the repository. 92 | 93 | * Creating a Magit buffer failed if `uniquify-buffer-name-style's 94 | value is `nil'. 95 | 96 | * Resetting a branch to an arbitrary commit caused its upstream 97 | configuration to be mangled. 98 | 99 | * Resetting a branch to another branch caused the former to be 100 | configured as the upstream of the latter. That behavior was 101 | introduced by accident when the argument `--track' was replaced with 102 | the variable `branch.autoSetupMerge' in the popup. Because it would 103 | be undesirable to restore the `--track' argument in the popup, one 104 | now has to use a prefix argument to set the upstream while resetting. 105 | 106 | * The manually set state of the margin in log and reflog buffers was 107 | not preserved and instead reset to the default state when a command 108 | was invoked which changes what log/reflog is being displayed. 109 | 110 | * Pressing RET on a variable in a popup caused an error. 111 | 112 | This release also contains the fixes described in the v2.4.1 release 113 | notes, as well as various typofixes, documentation updates, code 114 | clean-ups, bug fixes, and other small improvements. 115 | 116 | Authors 117 | ------- 118 | 119 | 62 Jonas Bernoulli 120 | 9 Kyle Meyer 121 | 4 Noam Postavsky 122 | 3 Alex Dunn 123 | -------------------------------------------------------------------------------- /docs/RelNotes/2.13.0.txt: -------------------------------------------------------------------------------- 1 | It's Magit! A Git Porcelain inside Emacs 2 | ========================================= 3 | 4 | Magit is a text-based Git user interface that puts an unmatched focus 5 | on streamlining workflows. Commands are invoked using short mnemonic 6 | key sequences that take the cursor’s position in the highly actionable 7 | interface into account to provide context-sensitive behavior. 8 | 9 | With Magit you can do nearly everything that you can do when using Git 10 | on the command-line, but at greater speed and while taking advantage 11 | of advanced features that previously seemed too daunting to use on a 12 | daily basis. Many users will find that by using Magit they can become 13 | more effective Git user. 14 | 15 | For more information about Magit, see https://magit.vc 16 | and https://emacsair.me/2017/09/01/campaign-articles. 17 | 18 | Magit v2.13.0 Release Notes 19 | =========================== 20 | 21 | Released 2nd June 2018 by Jonas Bernoulli. 22 | 23 | I am pleased to announce the release of Magit version 2.13.0, 24 | representing 166 commits by 18 contributors over two months. 25 | 26 | Also see https://emacsair.me/2018/06/02/magit-2.13. 27 | 28 | Upcoming breaking changes 29 | ------------------------- 30 | 31 | * This is the last release to support Emacs 24.4. Going forward at 32 | least Emacs 25.1 is required. 33 | 34 | * This is the last release to support Git 1.9.4. Going forward at 35 | least Git 2.4 is required. 36 | 37 | * Many functions and variables that have been declared obsolete for 38 | a while now are going to be removed after this release. 39 | 40 | All of these changes will happen on "master", the development branch. 41 | Note that the snapshot packages on Melpa are built from that branch. 42 | If you cannot update Emacs and/or Git now, then you should pin Magit 43 | to Melpa-Stable to stick with this release (and bugfix releases) for 44 | the time being. 45 | 46 | Breaking changes 47 | ---------------- 48 | 49 | * As announced earlier, the obsolete option `magit-no-confirm-default' 50 | has been removed. #3232 51 | 52 | Changes since v2.12.0 53 | --------------------- 54 | 55 | * Augmenting a file- or blob-visiting buffer with blame information 56 | was completely rewritten, making the implementation more robust and 57 | adding many new features. It is now possible blame in order to get 58 | an answer to the question "what commits remove these lines". It is 59 | no longer necessary for the buffer to be put into `read-only-mode', 60 | when displaying blame information. New visualization styles were 61 | added and users can define their own styles. New commands to visit 62 | blobs related to the current chunk were added. 63 | 64 | * Added new command `magit-tag-release'. This is a fairly opinionated 65 | command and its only use to you might be to serve as a template for 66 | your own variant. 67 | 68 | * Added new section inserter `magit-insert-ignored-files', which 69 | could be added to `magit-status-sections-hook'. 70 | 71 | * The mode `global-magit-file-mode' is now enabled by default, making 72 | the `magit-file-popup' available on "C-c M-g". 0ec28b97 73 | 74 | * Added new commands `magit-log-trace-definition' and 75 | `magit-diff-trace-definition', which show a log with diffs about the 76 | definition at point. #2588 77 | 78 | * Added new commands `magit-edit-line-commit' and 79 | `magit-diff-edit-hunk-commit', which allow editing the commit that 80 | added the line at point. febe79ba 22b13337 81 | 82 | * The interactive prompts for the various reset commands now indicate 83 | the branch which is going to be reset. #3438 84 | 85 | * Added new option `magit-published-branches', providing an additional 86 | safety-net. If you try to modify a commit that has been pushed to 87 | one of these branches already, then you are now being asked whether 88 | you really want to do that. Do not rely on this exclusively, there 89 | are edge-cases that are ambiguous and are not always handled as you 90 | might have expected. add4a7f3 ff 91 | 92 | * Gravatar images are now being inserted asynchronously. #3452 93 | 94 | * After deleting the current worktree, `magit-delete-worktree' now 95 | shows the status buffer for another worktree. d9cd4611 96 | 97 | * Added new command `magit-worktree-checkout-pull-request'. a3d788ec 98 | 99 | * New variable `magit-get-previous-branch-timeout' limits the amount 100 | of time spent in `magit-get-previous-branch'. #3457 101 | 102 | Fixes since v2.12.0 103 | ------------------- 104 | 105 | * The recently added command `magit-branch-pull-request' had various 106 | issues concerning pull-requests referencing branches from the 107 | upstream repository. #3416 #3417 #3461 108 | 109 | * The values of diffstat sections was wrong for sections that 110 | represent renamed files. 66d9558f 111 | 112 | * Time zones were not handled correctly when calculating times for 113 | blame headings. #3443 114 | 115 | This release also contains the fixes described in the v2.12.1 release 116 | notes, as well as other minor improvements, bug fixes, typo fixes, and 117 | documentation fixes. 118 | 119 | Authors 120 | ------- 121 | 122 | 138 Jonas Bernoulli 123 | 6 Kyle Meyer 124 | 2 Alban Gruin 125 | 2 Basil L. Contovounesios 126 | 2 Buster Copley 127 | 2 Christophe Junke 128 | 2 Mario Rodas 129 | 2 Phil Sainty 130 | 1 Aaron Madlon-Kay 131 | 1 Ben North 132 | 1 Dean Kariniemi 133 | 1 Eli Barzilay 134 | 1 Jon Vanderwijk 135 | 1 Jonathan Leech-Pepin 136 | 1 Justin Guenther 137 | 1 Li-Yun Chang 138 | 1 Marc Sherry 139 | 1 Noam Postavsky 140 | -------------------------------------------------------------------------------- /docs/RelNotes/2.6.0.txt: -------------------------------------------------------------------------------- 1 | Magit v2.6.0 Release Notes 2 | ========================== 3 | 4 | Released 29 March 2016 by Jonas Bernoulli. 5 | 6 | We are pleased to announce the release of Magit version 2.6.0, 7 | representing 77 commits by 7 contributors over 2 months. 8 | 9 | Also see http://emacsair.me/2016/03/29/magit-2.6. 10 | 11 | Updates since v2.5.0 12 | -------------------- 13 | 14 | * Added a cache, which memorizes the values of some function calls for 15 | the duration of a refresh. This cuts the calls to git in half. 16 | 17 | * Added new option `magit-diff-hide-trailing-cr-characters'. When its 18 | value is non-nil (the default on Windows), then ^M characters at the 19 | end of diff lines are hidden. 20 | 21 | * Added new command `magit-diff-buffer-file-popup' intended for use in 22 | file-visiting buffers. It shows the same popup as `magit-diff-popup' 23 | but starts out already limited to the visited file. 24 | 25 | * Added new command `magit-ediff-show-stash', which is available in 26 | the Ediff popup and will be used when `magit-ediff-dwim' is called 27 | with point on a stash. 28 | 29 | * Added new command `magit-reset-popup' featuring all the available 30 | reset variants. 31 | 32 | * Added new command `magit-push-refspecs', which allows pushing using 33 | one or more comma-separated and refspecs, which are explicitly typed 34 | in the minibuffer. 35 | 36 | * Added new commands `magit-fetch-refspec' and `magit-fetch-branch'. 37 | 38 | * Added new section inserters 39 | `magit-insert-modules-unpulled-from-pushremote' and 40 | `magit-insert-modules-unpushed-to-pushremote', and renamed 41 | `magit-insert-unpulled-module-commits' to 42 | `magit-insert-modules-unpulled-from-upstream' and 43 | `magit-insert-unpushed-module-commits' to 44 | `magit-insert-modules-unpushed-to-upstream'. 45 | 46 | * The command `magit-submodule-add' now allows using a module name 47 | different from the path of the module. 48 | 49 | * If `magit-push-current-set-remote-if-missing's value is `default', 50 | then the command `magit-push-current-to-pushremote' now offers to 51 | set `remote.pushDefault' unless the push-remote is already set in 52 | some way. Previously this command offered to set the local value 53 | `branch.NAME.pushRemote' for all non-nil values of the option. 54 | 55 | * When washing the diff that is to be displayed while writing a 56 | commit message takes too long, then it is now possible to abort that 57 | by pressing `C-g'. Previously that would have aborted the commit. 58 | 59 | * When `magit-process-raise-error' is non-nil, then the displayed 60 | error message now also mentions the `default-directory', which is 61 | useful when using Magit as a library in another packages that runs 62 | git in many different repositories. 63 | 64 | * The `magit-insert-section' macro's TYPE argument can now have the 65 | form `(eval FORM)' instead of a symbol. An atomic TYPE is never 66 | evaluated, but FORM is evaluated at run-time. 67 | 68 | Fixes since v2.5.0 69 | ------------------ 70 | 71 | * Staging hunks/regions belonging to files with CRLF line endings on 72 | Windows (or, to be precise, when `default-process-coding-system' had 73 | CRLF end-of-line conversion) ended up erroneously staging changes 74 | with LF line endings. Magit now ensures line endings are preserved 75 | by enforcing a `process-coding-system' with LF end-of-line 76 | conversion. The new behavior may be disabled by setting the option 77 | `magit-process-ensure-unix-line-ending' to `nil'. 78 | 79 | * If the user sets the variable `magit-auto-revert-mode' or the 80 | obsolete alias `magit-revert-buffers' to nil anytime during startup 81 | (before or after `magit-autorevert' is loaded) then the mode is now 82 | no longer turned on (actually it is explicitly turned off). 83 | 84 | * When a revision buffer was limited to a set of files, its header 85 | line did not say so. 86 | 87 | * The function `magit-run-git-with-input' had stopped calling 88 | `magit-pre-call-git-hook' and logging its git command to the 89 | magit-process buffer. 90 | 91 | * The function `magit-diff-wash-submodule did not handle some less 92 | common cases. 93 | 94 | * The command `magit-section-cycle-diffs' hung when hiding sections. 95 | 96 | * Invoking `magit-commit-popup's default action by invoking the popup 97 | command with a prefix argument failed due to a typo. 98 | 99 | * The command `magit-toggle-buffer-lock' failed if another buffer is 100 | already locked to the same value. 101 | 102 | * The command `magit-clone' did not switch to the cloned repository 103 | before trying to delete the symbolic-ref "origin/HEAD". 104 | 105 | * The commands `magit-insert-unpulled-from-pushremote' and 106 | `magit-insert-unpushed-to-pushremote' missed an edge case when 107 | checking whether their section should be inserted into the status 108 | buffer. 109 | 110 | * The command `magit-merge-preview' did not recognize sections for 111 | added or deleted files. 112 | 113 | * The command `magit-show-stash' did not properly handle untracked 114 | files that were within subdirectories. 115 | 116 | * On `windows-nt' systems, having `mount' in `exec-path' caused Magit 117 | to assume that git is from Cygwin. 118 | 119 | * Added a kludge to work around a bug in Apple's OS X which causes 120 | `file-accessible-directory-p' to return incorrect results. 121 | 122 | This release also contains typofixes, documentation updates, and code 123 | clean-ups. 124 | 125 | Authors 126 | ------- 127 | 128 | 53 Jonas Bernoulli 129 | 13 Kyle Meyer 130 | 4 Luís Oliveira 131 | 4 Noam Postavsky 132 | 1 Dan Erikson 133 | 1 Dato Simó 134 | 1 Russell Black 135 | -------------------------------------------------------------------------------- /lisp/magit-reset.el: -------------------------------------------------------------------------------- 1 | ;;; magit-reset.el --- Reset functionality -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements reset commands. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit) 30 | 31 | ;;; Commands 32 | 33 | ;;;###autoload (autoload 'magit-reset "magit" nil t) 34 | (transient-define-prefix magit-reset () 35 | "Reset the `HEAD', index and/or worktree to a previous state." 36 | :man-page "git-reset" 37 | ["Reset" 38 | ("m" "mixed (HEAD and index)" magit-reset-mixed) 39 | ("s" "soft (HEAD only)" magit-reset-soft) 40 | ("h" "hard (HEAD, index and files)" magit-reset-hard) 41 | ("k" "keep (HEAD and index, keeping uncommitted)" magit-reset-keep) 42 | ("i" "index (only)" magit-reset-index) 43 | ("w" "worktree (only)" magit-reset-worktree) 44 | "" 45 | ("f" "a file" magit-file-checkout)]) 46 | 47 | ;;;###autoload 48 | (defun magit-reset-mixed (commit) 49 | "Reset the `HEAD' and index to COMMIT, but not the working tree. 50 | \n(git reset --mixed COMMIT)" 51 | (interactive (list (magit-reset-read-branch-or-commit "Reset %s to"))) 52 | (magit-reset-internal "--mixed" commit)) 53 | 54 | ;;;###autoload 55 | (defun magit-reset-soft (commit) 56 | "Reset the `HEAD' to COMMIT, but not the index and working tree. 57 | \n(git reset --soft REVISION)" 58 | (interactive (list (magit-reset-read-branch-or-commit "Soft reset %s to"))) 59 | (magit-reset-internal "--soft" commit)) 60 | 61 | ;;;###autoload 62 | (defun magit-reset-hard (commit) 63 | "Reset the `HEAD', index, and working tree to COMMIT. 64 | \n(git reset --hard REVISION)" 65 | (interactive (list (magit-reset-read-branch-or-commit 66 | (concat (magit--propertize-face "Hard" 'bold) 67 | " reset %s to")))) 68 | (magit-reset-internal "--hard" commit)) 69 | 70 | ;;;###autoload 71 | (defun magit-reset-keep (commit) 72 | "Reset the `HEAD' and index to COMMIT, while keeping uncommitted changes. 73 | \n(git reset --keep REVISION)" 74 | (interactive (list (magit-reset-read-branch-or-commit "Reset %s to"))) 75 | (magit-reset-internal "--keep" commit)) 76 | 77 | ;;;###autoload 78 | (defun magit-reset-index (commit) 79 | "Reset the index to COMMIT. 80 | Keep the `HEAD' and working tree as-is, so if COMMIT refers to the 81 | head this effectively unstages all changes. 82 | \n(git reset COMMIT .)" 83 | (interactive (list (magit-read-branch-or-commit "Reset index to"))) 84 | (magit-reset-internal nil commit ".")) 85 | 86 | ;;;###autoload 87 | (defun magit-reset-worktree (commit) 88 | "Reset the worktree to COMMIT. 89 | Keep the `HEAD' and index as-is." 90 | (interactive (list (magit-read-branch-or-commit "Reset worktree to"))) 91 | (magit-wip-commit-before-change nil " before reset") 92 | (magit-with-temp-index commit nil 93 | (magit-call-git "checkout-index" "--all" "--force")) 94 | (magit-wip-commit-after-apply nil " after reset") 95 | (magit-refresh)) 96 | 97 | ;;;###autoload 98 | (defun magit-reset-quickly (commit &optional hard) 99 | "Reset the `HEAD' and index to COMMIT, and possibly the working tree. 100 | With a prefix argument reset the working tree otherwise don't. 101 | \n(git reset --mixed|--hard COMMIT)" 102 | (interactive (list (magit-reset-read-branch-or-commit 103 | (if current-prefix-arg 104 | (concat (magit--propertize-face "Hard" 'bold) 105 | " reset %s to") 106 | "Reset %s to")) 107 | current-prefix-arg)) 108 | (magit-reset-internal (if hard "--hard" "--mixed") commit)) 109 | 110 | (defun magit-reset-read-branch-or-commit (prompt) 111 | "Prompt for and return a ref to reset HEAD to. 112 | 113 | PROMPT is a format string, where either the current branch name 114 | or \"detached head\" will be substituted for %s." 115 | (magit-read-branch-or-commit 116 | (format prompt (or (magit-get-current-branch) "detached head")))) 117 | 118 | (defun magit-reset-internal (arg commit &optional path) 119 | (when (and (not (member arg '("--hard" nil))) 120 | (equal (magit-rev-parse commit) 121 | (magit-rev-parse "HEAD~"))) 122 | (with-temp-buffer 123 | (magit-git-insert "show" "-s" "--format=%B" "HEAD") 124 | (when git-commit-major-mode 125 | (funcall git-commit-major-mode)) 126 | (git-commit-setup-font-lock) 127 | (git-commit-save-message))) 128 | (let ((cmd (if (and (equal commit "HEAD") (not arg)) "unstage" "reset"))) 129 | (magit-wip-commit-before-change nil (concat " before " cmd)) 130 | (magit-run-git "reset" arg commit "--" path) 131 | (when (equal cmd "unstage") 132 | (magit-wip-commit-after-apply nil " after unstage")))) 133 | 134 | ;;; _ 135 | (provide 'magit-reset) 136 | ;;; magit-reset.el ends here 137 | -------------------------------------------------------------------------------- /lisp/magit-bundle.el: -------------------------------------------------------------------------------- 1 | ;;; magit-bundle.el --- Bundle support for Magit -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Code: 24 | 25 | (require 'magit) 26 | 27 | ;;; Commands 28 | 29 | ;;;###autoload (autoload 'magit-bundle "magit-bundle" nil t) 30 | (transient-define-prefix magit-bundle () 31 | "Create or verify Git bundles." 32 | :man-page "git-bundle" 33 | ["Actions" 34 | ("c" "create" magit-bundle-create) 35 | ("v" "verify" magit-bundle-verify) 36 | ("l" "list-heads" magit-bundle-list-heads)]) 37 | 38 | ;;;###autoload (autoload 'magit-bundle-import "magit-bundle" nil t) 39 | (transient-define-prefix magit-bundle-create (&optional file refs args) 40 | "Create a bundle." 41 | :man-page "git-bundle" 42 | ["Arguments" 43 | ("-a" "Include all refs" "--all") 44 | ("-b" "Include branches" "--branches=" :allow-empty t) 45 | ("-t" "Include tags" "--tags=" :allow-empty t) 46 | ("-r" "Include remotes" "--remotes=" :allow-empty t) 47 | ("-g" "Include refs" "--glob=") 48 | ("-e" "Exclude refs" "--exclude=") 49 | (magit-log:-n) 50 | (magit-log:--since) 51 | (magit-log:--until)] 52 | ["Actions" 53 | ("c" "create regular bundle" magit-bundle-create) 54 | ("t" "create tracked bundle" magit-bundle-create-tracked) 55 | ("u" "update tracked bundle" magit-bundle-update-tracked)] 56 | (interactive 57 | (and (eq transient-current-command 'magit-bundle-create) 58 | (list (read-file-name "Create bundle: " nil nil nil 59 | (concat (file-name-nondirectory 60 | (directory-file-name (magit-toplevel))) 61 | ".bundle")) 62 | (magit-completing-read-multiple "Refnames (zero or more): " 63 | (magit-list-refnames)) 64 | (transient-args 'magit-bundle-create)))) 65 | (if file 66 | (magit-git-bundle "create" file refs args) 67 | (transient-setup 'magit-bundle-create))) 68 | 69 | ;;;###autoload 70 | (defun magit-bundle-create-tracked (file tag branch refs args) 71 | "Create and track a new bundle." 72 | (interactive 73 | (let ((tag (magit-read-tag "Track bundle using tag")) 74 | (branch (magit-read-branch "Bundle branch")) 75 | (refs (magit-completing-read-multiple 76 | "Additional refnames (zero or more): " 77 | (magit-list-refnames)))) 78 | (list (read-file-name "File: " nil nil nil (concat tag ".bundle")) 79 | tag branch 80 | (if (equal branch (magit-get-current-branch)) 81 | (cons "HEAD" refs) 82 | refs) 83 | (transient-args 'magit-bundle-create)))) 84 | (magit-git-bundle "create" file (cons branch refs) args) 85 | (magit-git "tag" "--force" tag branch 86 | "-m" (concat ";; git-bundle tracking\n" 87 | (pp-to-string `((file . ,file) 88 | (branch . ,branch) 89 | (refs . ,refs) 90 | (args . ,args)))))) 91 | 92 | ;;;###autoload 93 | (defun magit-bundle-update-tracked (tag) 94 | "Update a bundle that is being tracked using TAG." 95 | (interactive (list (magit-read-tag "Update bundle tracked by tag" t))) 96 | (let (msg) 97 | (let-alist (magit--with-temp-process-buffer 98 | (save-excursion 99 | (magit-git-insert "for-each-ref" "--format=%(contents)" 100 | (concat "refs/tags/" tag))) 101 | (setq msg (buffer-string)) 102 | (ignore-errors (read (current-buffer)))) 103 | (unless (and .file .branch) 104 | (error "Tag %s does not appear to track a bundle" tag)) 105 | (magit-git-bundle "create" .file 106 | (cons (concat tag ".." .branch) .refs) 107 | .args) 108 | (magit-git "tag" "--force" tag .branch "-m" msg)))) 109 | 110 | ;;;###autoload 111 | (defun magit-bundle-verify (file) 112 | "Check whether FILE is valid and applies to the current repository." 113 | (interactive (list (magit-bundle--read-file-name "Verify bundle: "))) 114 | (magit-process-buffer) 115 | (magit-git-bundle "verify" file)) 116 | 117 | ;;;###autoload 118 | (defun magit-bundle-list-heads (file) 119 | "List the refs in FILE." 120 | (interactive (list (magit-bundle--read-file-name "List heads of bundle: "))) 121 | (magit-process-buffer) 122 | (magit-git-bundle "list-heads" file)) 123 | 124 | (defun magit-bundle--read-file-name (prompt) 125 | (read-file-name prompt nil nil t (magit-file-at-point) #'file-regular-p)) 126 | 127 | (defun magit-git-bundle (command file &optional refs args) 128 | (magit-git "bundle" command (magit-convert-filename-for-git file) refs args)) 129 | 130 | ;;; _ 131 | (provide 'magit-bundle) 132 | ;;; magit-bundle.el ends here 133 | -------------------------------------------------------------------------------- /lisp/Makefile: -------------------------------------------------------------------------------- 1 | -include ../config.mk 2 | include ../default.mk 3 | 4 | ## ################################################################### 5 | 6 | .PHONY: magit-version.el check-declare install 7 | 8 | all: lisp 9 | 10 | ## Build order ####################################################### 11 | 12 | git-commit.elc: 13 | magit-section.elc: 14 | magit-base.elc: magit-section.elc 15 | ifeq "$(BUILD_MAGIT_LIBGIT)" "true" 16 | magit-libgit.elc: 17 | magit-git.elc: magit-base.elc magit-libgit.elc 18 | else 19 | magit-git.elc: magit-base.elc 20 | endif 21 | magit-mode.elc: magit-base.elc magit-git.elc 22 | magit-margin.elc: magit-base.elc magit-mode.elc 23 | magit-process.elc: magit-base.elc magit-git.elc magit-mode.elc 24 | magit-transient.elc: magit-git.elc magit-mode.elc magit-process.elc 25 | magit-autorevert.elc: magit-git.elc magit-process.elc 26 | magit-core.elc: magit-base.elc magit-git.elc magit-mode.elc \ 27 | magit-margin.elc magit-process.elc \ 28 | magit-transient.elc magit-autorevert.elc 29 | magit-diff.elc: git-commit.elc magit-core.elc 30 | magit-log.elc: magit-core.elc magit-diff.elc 31 | magit-wip.elc: magit-core.elc magit-log.elc 32 | magit-reflog.elc: magit-core.elc magit-log.elc 33 | magit-apply.elc: magit-core.elc magit-diff.elc magit-wip.elc 34 | magit-repos.elc: magit-core.elc 35 | magit.elc: git-commit.elc magit-core.elc magit-diff.elc \ 36 | magit-log.elc magit-apply.elc magit-repos.elc 37 | magit-status.elc: magit.elc 38 | magit-refs.elc: magit.elc 39 | magit-files.elc: magit.elc 40 | magit-reset.elc: magit.elc 41 | magit-branch.elc: magit.elc magit-reset.elc 42 | magit-merge.elc: magit.elc magit-diff.elc 43 | magit-tag.elc: magit.elc 44 | magit-worktree.elc: magit.elc 45 | magit-notes.elc: magit.elc 46 | magit-sequence.elc: magit.elc 47 | magit-commit.elc: magit.elc magit-sequence.elc 48 | magit-remote.elc: magit.elc 49 | magit-clone.elc: magit.elc 50 | magit-fetch.elc: magit.elc 51 | magit-pull.elc: magit.elc magit-remote.elc 52 | magit-push.elc: magit.elc 53 | magit-bisect.elc: magit.elc 54 | magit-stash.elc: magit.elc magit-sequence.elc magit-reflog.elc 55 | magit-blame.elc: magit.elc 56 | magit-submodule.elc: magit.elc 57 | magit-patch.elc: magit.elc 58 | magit-subtree.elc: magit.elc 59 | magit-ediff.elc: magit.elc 60 | magit-gitignore.elc: magit.elc 61 | magit-sparse-checkout.elc: magit.elc 62 | magit-bundle.elc: magit.elc 63 | magit-extras.elc: magit.elc magit-merge.elc 64 | git-rebase.elc: magit.elc 65 | magit-bookmark.elc: magit.elc 66 | 67 | ## Build ############################################################# 68 | 69 | lisp: $(ELCS) loaddefs $(LISP_EXTRA_TARGETS) 70 | loaddefs: $(PKG)-autoloads.el 71 | versionlib: $(PKG)-version.el 72 | 73 | %.elc: %.el 74 | @printf "Compiling $<\n" 75 | @$(BATCH) --eval "(progn\ 76 | (when (file-exists-p \"$@\")\ 77 | (delete-file \"$@\"))\ 78 | (setq with-editor-emacsclient-executable nil)\ 79 | $$suppress_warnings)" \ 80 | -f batch-byte-compile $< 81 | 82 | $(PKG)-autoloads.el: $(ELS) 83 | @printf " Creating $@\n" 84 | @$(EMACS) -Q --batch -l autoload -l cl-lib --eval "\ 85 | (let ((file (expand-file-name \"$@\"))\ 86 | (autoload-timestamps nil) \ 87 | (backup-inhibited t)\ 88 | (version-control 'never)\ 89 | (coding-system-for-write 'utf-8-emacs-unix))\ 90 | (write-region (autoload-rubric file \"package\" nil) nil file nil 'silent)\ 91 | (cl-letf (((symbol-function 'progress-reporter-do-update) (lambda (&rest _)))\ 92 | ((symbol-function 'progress-reporter-done) (lambda (_))))\ 93 | (let ((generated-autoload-file file))\ 94 | (update-directory-autoloads default-directory))))" \ 95 | 2>&1 | sed "/^Package autoload is deprecated$$/d" 96 | 97 | $(PKG)-version.el: 98 | @printf " Creating $@\n" 99 | @printf "%s" "$$VERSIONLIB_TMPL" > $@ 100 | 101 | check-declare: 102 | @printf "Checking function declarations\n" 103 | @$(BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \ 104 | --eval "(check-declare-directory default-directory)" 105 | 106 | ## Install ########################################################### 107 | 108 | install: lisp versionlib 109 | @$(MKDIR) $(DESTDIR)$(lispdir) 110 | $(CP) $(ELS) magit-autoloads.el magit-version.el $(ELCS) $(DESTDIR)$(lispdir) 111 | 112 | ## Clean ############################################################# 113 | 114 | clean: 115 | @printf " Cleaning lisp/*...\n" 116 | @$(RM) *.elc $(ELGS) 117 | 118 | ## Templates ######################################################### 119 | 120 | define VERSIONLIB_TMPL 121 | ;;; $(PKG)-version.el --- the Magit version you are using 122 | 123 | (setq $(PKG)-version "$(VERSION)") 124 | 125 | (provide '$(PKG)-version) 126 | 127 | ;; Local Variables: 128 | ;; version-control: never 129 | ;; no-byte-compile: t 130 | ;; no-update-autoloads: t 131 | ;; coding: utf-8 132 | ;; End: 133 | ;;; $(PKG)-version.el ends here 134 | 135 | endef 136 | export VERSIONLIB_TMPL 137 | #' 138 | 139 | define suppress_warnings 140 | (fset 'original-message (symbol-function 'message)) 141 | (fset 'message ;' 142 | (lambda (f &rest a) 143 | (unless (or (equal f "Wrote %s") 144 | (equal f "pcase-memoize: equal first branch, yet different") 145 | (and (equal f "Warning: Unknown defun property `%S' in %S") 146 | (memq (car a) '(pure side-effect-free interactive-only)))) 147 | (apply 'original-message f a)))) 148 | endef 149 | export suppress_warnings 150 | -------------------------------------------------------------------------------- /docs/RelNotes/2.4.0.txt: -------------------------------------------------------------------------------- 1 | Magit v2.4.0 Release Notes 2 | ========================== 3 | 4 | Released 18 January 2016 by Jonas Bernoulli. 5 | 6 | We are pleased to announce the release of Magit version 2.4.0, 7 | representing 269 commits by 14 people over 12 weeks. 8 | 9 | Also see http://emacsair.me/2016/01/18/magit-2.4. 10 | 11 | Changes since v2.3.0 12 | -------------------- 13 | 14 | * The new mode `magit-auto-revert-mode', a magit-specific globalized 15 | variant of `auto-revert-mode', replaces the old implementation, which 16 | was configured using the option `magit-revert-buffers'. The new mode 17 | is enabled for all users by default. It may be disabled before 18 | loading magit by setting `magit-auto-revert-mode' (or the obsolete 19 | alias `magit-revert-buffers') to nil. To disable the mode after 20 | loading magit, a call to (magit-auto-revert-mode -1) is required. 21 | #2474 22 | 23 | * The option `magit-refresh-status-buffer' was added, allowing users 24 | to prevent automatic refreshes of the status buffer for performance 25 | reasons. 26 | 27 | * All of Git's push-related variables are now honored. #2414 28 | 29 | * In addition to the upstream branch, the push-remote (configured 30 | using `branch..pushRemote' or `remote.pushDefault') is now 31 | also fully supported. #2414 32 | 33 | * The status buffer now features up to four logs listing unpulled and 34 | unpushed commits. Two for the upstream and two for the push-remote. 35 | #2414 36 | 37 | * The branch popup now shows the most important Git variables that are 38 | in some way related to branches. The values of these variables can 39 | now be conveniently changed from that popup. #2414 40 | 41 | * The fetch, pull, push, and rebase popups now feature an action which 42 | acts on the push-remote, another which acts on the upstream, and yet 43 | another which acts on any other source or target. For each of these 44 | actions the respective branch is shown in the popup. 45 | 46 | The actions in the push popup are displayed even if the respective 47 | variables are unset - they then offer to set these variables before 48 | pushing. Setting `magit-push-current-set-remote-if-missing' to nil 49 | disables this. 50 | 51 | Many key bindings were changed for consistency and safety reasons. 52 | Likewise many commands were renamed and their behavior was adjusted. 53 | Some new commands, related to the push-remote, were added. #2414 54 | 55 | * The command `magit-push-implicitly' was removed from the push popup. 56 | The command's doc-string explains how to put it back. If these 57 | instructions are followed, then the popup shows what will happen if 58 | the command is used. #2453 59 | 60 | * The command `magit-push-to-remote' was added. The command's 61 | doc-string explains how to add it to the push popup. #2453 62 | 63 | * The option `magit-push-always-verify' was removed. That was only a 64 | temporary kludge to keep users from shooting themselves in the foot. 65 | This is no longer necessary because one now always sees where one is 66 | about to push to. #2414 67 | 68 | * The popup command `magit-pull-and-fetch-popup' was added as a 69 | possible replacement for the separate `magit-push-popup' and 70 | `magit-fetch-popup'. #2452 71 | 72 | * The option `magit-branch-prefer-remote-upstream' was added for users 73 | who prefer to always use remote branches as upstreams. #2447 74 | 75 | * The options `magit-clone-set-remote.pushDefault' and 76 | `magit-remote-add-set-remote.pushDefault' were added. #2447 77 | 78 | * When Git is run for side-effects and exits with a non-zero status, 79 | then the respective error message is now inserted into the status 80 | buffer. This should help those users who do not see that message 81 | when it is being displayed in the echo area. 82 | 83 | * Popups gained support for a new event type `:variable', which can be 84 | used to change the value of Git variables. This can only be used in 85 | combination with Magit (just `magit-popup.el' by itself is not 86 | sufficient). #2409 87 | 88 | * The backward-compatibility kludge `magit-branch-manager' has been 89 | removed. The one and only binding to show the refs buffer now is 90 | "y"; the "b v" binding has been removed. 91 | 92 | * The command `with-editor-finish' now runs the new hook 93 | `with-editor-post-finish-hook'. 94 | 95 | * The command `magit-diff-visit-file' now runs the new hook 96 | `magit-diff-visit-file-hook'. 97 | 98 | * When the upstream branch or push remote is configured but the 99 | respective branch does not actually exist, then that is now reported 100 | in the header of the status buffer. #2390 101 | 102 | * The header line about the upstream branch in the status buffer is 103 | now prefixed with either "Merge" or "Rebase", depending on the value 104 | of `branch..rebase'. #2390 105 | 106 | * `magit-define-popup' learned two new arguments, `:setup-function' and 107 | `:refresh-function'. These arguments should be used instead of the 108 | MODE argument, which is now deprecated. #2389 109 | 110 | * Negative text properties are no longer faked; that was just too ugly 111 | and inefficient. Since v2.1.0 Magit no longer sets the background 112 | color for any faces except for those related to diffs. Third-party 113 | themes which still set the background color of non-diff faces have 114 | to be adjusted, because the background color of these faces would be 115 | shadowed by the highlighting of the current section. This does not 116 | apply to diff-related faces because diff sections are highlighted 117 | differently from other sections. #2387 118 | 119 | * The commands `git-rebase-move-line-up' and `git-rebase-move-line-down' 120 | have been extended. When a region is active, they now operate on 121 | all lines touched by the region, not just the current line. In 122 | addition, a numeric prefix can now be given to specify how many 123 | lines the current line or selection is moved across. 124 | 125 | * The option `magit-popup-display-action' was added. 126 | 127 | This release also contains the changes described in the v2.3.1 release 128 | notes, as well as various other documentation fixes, code clean-ups, 129 | bug fixes, and other small to medium improvements. 130 | 131 | Authors 132 | ------- 133 | 134 | 226 Jonas Bernoulli 135 | 22 Kyle Meyer 136 | 10 Noam Postavsky 137 | 1 Carl Lieberman 138 | 1 Damien Cassou 139 | 1 David L. Rager 140 | 1 John Mastro 141 | 1 Lele Gaifax 142 | 1 Michael Heerdegen 143 | 1 Miloš Mošić 144 | 1 Raimon Grau 145 | 1 Sylvain Rousseau 146 | 1 Syohei Yoshida 147 | 1 Zach Latta 148 | -------------------------------------------------------------------------------- /docs/RelNotes/3.3.0.org: -------------------------------------------------------------------------------- 1 | * It's Magit! A Git Porcelain inside Emacs 2 | 3 | Magit is a text-based Git user interface that puts an unmatched focus 4 | on streamlining workflows. Commands are invoked using short mnemonic 5 | key sequences that take the cursor’s position in the highly actionable 6 | interface into account to provide context-sensitive behavior. 7 | 8 | With Magit you can do nearly everything that you can do when using Git 9 | on the command-line, but at greater speed and while taking advantage 10 | of advanced features that previously seemed too daunting to use on a 11 | daily basis. Many users will find that by using Magit they can become 12 | more effective Git user. 13 | 14 | For more information about Magit, see https://magit.vc. 15 | 16 | * Magit v3.3.0 Release Notes 17 | 18 | Released 4th October 2021 by Jonas Bernoulli. 19 | 20 | I am pleased to announce the release of Magit version 3.3.0, 21 | representing 88 commits by 6 contributors over two month. 22 | 23 | Also see https://emacsair.me/2021/10/04/magit-3.3. 24 | 25 | ** Breaking changes 26 | 27 | - The last remaining alphabetic keys (both lower- and uppercase) are 28 | now bound in ~magit-mode-map~. ~H~ to ~magit-describe-section~, ~j~ to the 29 | new ~magit-status-quick~ (or ~magit-status-jump~ in status buffers), ~J~ 30 | to the new ~magit-display-repository-buffer~, ~Q~ to ~magit-git-command~ 31 | and ~Z~ to ~magit-worktree~, and once Forge is loaded, then ~N~ to 32 | ~forge-dispatch~. (~Z~ used to be bound to ~magit-stash~, which now is 33 | only available on ~z~.) #4259, 9bec1c54a, e401bd4d3 34 | 35 | - ~I~ is now bound to ~magit-init~ instead of ~magit-gitignore~, which 36 | continues to be available on ~i~. Users of the ~magit-imerge~ package 37 | (which previously bound ~i~) should consult its library header for a 38 | suggestion on how to resolve the resulting conflict. b54b537db 39 | 40 | ** Changes since v3.2.0 41 | 42 | - No longer automatically add ~--full-history~ when showing a log for a 43 | single file that isn't being tracked anymore. #4381 44 | 45 | - ~magit-stash-both~ now asks before discarding merge state. #4345 46 | 47 | - Several infix arguments, which previously could only be disabled 48 | or have a numeric value, can now also be enabled without having 49 | an explicit numeric value. #4379 50 | 51 | - Added ~-Xignore-space-change~ and ~-Xignore-all-space~ to ~magit-merge~. 52 | Like most newly added expert arguments they have to be explicitly 53 | [[https://magit.vc/manual/transient/Enabling-and-Disabling-Suffixes.html][revealed]]. #4387 54 | 55 | - Added new command ~magit-status-quick~, which shows the status buffer 56 | but avoids refreshing it for performance reasons. #4259 57 | 58 | - Added new commands ~magit-display-repository-buffer~ (bound to ~j~ in 59 | Magit buffers) and ~magit-switch-to-repository-buffer~ (bound to ~J~) 60 | and variants for switching to any existing Magit buffer belonging 61 | to the current repository. #4259 62 | 63 | - Added new command ~magit-dired-am-apply-patches~ for use in Dired. 64 | #4094. 65 | 66 | - Rearranged ~magit-patch~ and added a binding for ~magit-am~. 8ec3a1a21, 67 | 8cadf302b 68 | 69 | - Added new command ~magit-help~ (bound to ~h~ in ~magit-dispatch~), which 70 | simply shows Magit's Info manual. 5bba62629 71 | 72 | - When listing entries for Imenu, then remove entry counts from group 73 | titles for the benefit of third-party packages that need stable 74 | titles. #4477 75 | 76 | - Include Forge's ~pullreq~ and ~issue~ sections when listing entries for 77 | Imenu. f4016f734 78 | 79 | - Bound ~imenu~ in the ~magit-status-jump~ prefix. 678df30c3 80 | 81 | - Added new transient prefix command ~magit-bundle~, which provides 82 | support for ~git bundle~. #4392 83 | 84 | - When minibuffer completion allows for a branch or a commit to be 85 | selected and the former is preferred and thus offered as default 86 | then, if possible, offer the commit at point as the first choice 87 | initially accessible with ~next-history-element~. #4291 88 | 89 | - Bound ~magit-refs-set-show-commit-count~ in the ~magit-show-refs~ 90 | prefix. 2fe42f63d 91 | 92 | - Added new option ~magit-commit-diff-inhibit-same-window~. #4132 93 | 94 | - Added support for invoking Smerge's "keep" commands when point is on 95 | a hunk in a Magit buffer. They can be invoked using the same key 96 | bindings as in file-visiting buffers or ~RET~, ~u~, ~b~ and ~l~. #4458 97 | 98 | - Added new command ~magit-remote-unshallow~. #4480 99 | 100 | - Added new option ~git-commit-use-local-message-ring~. #4503 101 | 102 | - Added new option ~magit-log-merged-commit-count~. #4711 103 | 104 | ** Fixes since v3.2.0 105 | 106 | - Make ~magit-branch-remote-head~ and ~magit-branch-current~ fall back 107 | to ~:inverse-video~ when the ~:box~ attribute isn't support, i.e., in 108 | a terminal. If this change does not have any effect for you then 109 | your theme probably changes these faces and should stop doing so. 110 | #4206 111 | 112 | - In some cases refreshing a buffer caused the cursor to jump to a 113 | different position. #4148 114 | 115 | - ~magit-convert-filename-for-git~ did not expand absolute filenames, 116 | which is necessary because Git does not understand ~~/~. de1dc8e74 117 | 118 | - ~magit-rebase~ did not enable ~--autostash~ by default but the 119 | documentation says it does. 421be65a3 120 | 121 | - ~magit-clone-read-repository~ did not convert filenames before passing 122 | them to Git. 4aa7d2928 123 | 124 | - Due to a regression in v2.90.0, ~magit-wip-log~ and 125 | ~magit-wip-log-current~ failed to extract the previous tips of the 126 | wip refs from the reflog (which is relevant when 127 | ~~magit-wip-merge-branch~ is nil). c327824b0 128 | 129 | - An old attempt to avoid needlessly updating section highlighting 130 | did not actually succeed. #3976 131 | 132 | - An error occurred when first showing a status buffer and 133 | ~which-function-mode~ is enabled because that caused Imenu to collect 134 | items at a time when that is not possible yet. #4481 135 | 136 | - A change in Git v2.32.0 made it necessary to explicitly filter out 137 | directories when committing to wip worktree refs. #4499 138 | 139 | - Fixed appearance of Gravatar images by forcing their size instead 140 | relying the service to return the promised size as advertised. 141 | 8771401d4 142 | 143 | - ~git-commit-setup~ enabled the major-mode after setting local 144 | variables, which caused non-permanent variables to be reset. 145 | ece2cb84d 146 | 147 | * Authors 148 | 149 | 76 Jonas Bernoulli 150 | 8 Kyle Meyer 151 | 1 Daniel Nagy 152 | 1 Franklin Delehelle 153 | 1 Jonathon McKitrick 154 | 1 Lin Sun 155 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

A Git Porcelain inside Emacs

3 |

4 | homepage | 5 | manual | 6 | faq | 7 | wiki | 8 | mastodon 9 |

10 |
11 | 12 |

13 | Magit is an interface to the version control system 14 | Git, implemented as an 15 | Emacs package. 16 | Magit aspires to be a complete Git porcelain. While we cannot 17 | (yet) claim that Magit wraps and improves upon each and every Git 18 | command, it is complete enough to allow even experienced Git users 19 | to perform almost all of their daily version control tasks directly 20 | from within Emacs. While many fine Git clients exist, only Magit 21 | and Git itself deserve to be called porcelains. 22 |

23 |
24 | 25 |
26 | Keeping its users this excited is 27 | 28 | a lot of work 29 | . 30 | If Magit makes you
more productive too, 31 | then please consider making a donation. 32 |
33 |
34 | Thank you! — Jonas Bernoulli 35 |
36 |
37 |
38 | 39 | Sponsor my work using Github Sponsors 42 |    43 | 44 | Sponsor my work using Liberapay 47 |
48 | 49 | Sponsor my work using Opencollective 52 |    53 | 54 | Sponsor my work using PayPal 57 |
58 |
59 |
60 | Some alternative donation methods are available. 61 |
62 |
63 | 64 | ### Getting Started 65 | 66 | If you are new to Magit, then either one of the following two 67 | articles should help understanding how it differs from other Git 68 | clients. 69 | 70 | #### [Visual Magit walk-through](https://emacsair.me/2017/09/01/magit-walk-through) 71 | 72 | If you are completely new to Magit, then this article is a good 73 | visual introduction. 74 | 75 | Almost everything that you see in Magit can be acted on by pressing 76 | some key, but that's not obvious from just seeing how Magit looks. 77 | The screenshots and accompanying text of this article explain how to 78 | perform a variety of actions on Magit's output. 79 | 80 | #### [Magit, the magical Git interface](https://emacsair.me/2017/09/01/the-magical-git-interface) 81 | 82 | Magit differs significantly from other Git interfaces, and its 83 | advantages are not immediately obvious simply from looking at a few 84 | screenshots as presented in the preceding article. 85 | 86 | This article discusses Magit's properties in somewhat more abstract 87 | terms. 88 | 89 | #### Video introductions 90 | 91 | If you prefer [video](https://magit.vc/screencasts/) introductions, 92 | head over to that page, where find a collection of such introductions 93 | and other videos about Magit, by various creators. 94 | 95 | *** 96 | ### Support and Contributing 97 | 98 | Magit has many users and very few maintainers, so we kindly ask to read 99 | the appropriate guidelines before getting in contact. — Thanks! 100 | 101 | - 🆘 [How to ask for help](https://github.com/magit/magit/discussions/4630) 102 | - 🪳 [How to report a bug](https://github.com/magit/magit/wiki/How-to-report-a-bug) 103 | - 💡 [How to suggest a feature](https://github.com/magit/magit/discussions/4631) 104 | - 🏗️ [Pull request guidelines](https://github.com/magit/magit/wiki/Pull-request-guidelines) 105 | - ℹ️ [FAQ](https://magit.vc/manual/magit/FAQ.html) 106 | - ℹ️ [Manual](https://magit.vc/manual/magit) 107 | 108 | TL;DR We now use discussions for feature requests (not issues) and prefer 109 | if you ask the community for support instead of the overworked maintainers. 110 | 111 | Please also consider to contribute by supporting other users or by making 112 | a [monetary donation](https://magit.vc/donate). — Thanks! 113 | 114 | *** 115 | ### Acknowledgments 116 | 117 | Magit was started by [Marius Vollmer][marius], and is now maintained by 118 | [Jonas Bernoulli][jonas] and [Kyle Meyer][kyle]. Former maintainers are 119 | [Nicolas Dudebout][nicolas], [Noam Postavsky][noam], 120 | [Peter J. Weisberg][peter], [Phil Jackson][phil], [Rémi Vanicat][remi] and 121 | [Yann Hodique][yann]. Many more people have [contributed code][authors], 122 | suggested features or made monetary contributions. 123 | 124 | Thanks to all of you, may (the history of) the source be with you! 125 | 126 | *** 127 | [![Paren Xkcb](https://img.shields.io/badge/%28-%20%20%20-red.svg)](https://xkcd.com/859) 128 | [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.txt) 129 | [![Build Status](https://github.com/magit/magit/workflows/test/badge.svg?branch=master)](https://github.com/magit/magit/actions) 130 | [![NonGNU ELPA](https://elpa.nongnu.org/nongnu/magit.svg)](https://elpa.nongnu.org/nongnu/magit.html) 131 | [![Melpa](https://melpa.org/packages/magit-badge.svg)](https://melpa.org/#/magit) 132 | [![Melpa Stable](https://stable.melpa.org/packages/magit-badge.svg)](https://stable.melpa.org/#/magit) 133 | [![Eierlegende Wollmilchsau](https://img.shields.io/badge/eierlegende-Wollmilchsau-green.svg)](https://magit.vc/manual/magit) 134 | [![Netscape](https://magit.vc/assets/netscape-20px.png)](https://en.wikipedia.org/wiki/Browser_wars) 135 | 136 | 137 | [authors]: https://magit.vc/stats/magit/authors.html 138 | [jonas]: https://emacsair.me 139 | [kyle]: https://kyleam.com 140 | [marius]: https://github.com/mvollmer 141 | [nicolas]: http://dudebout.com 142 | [noam]: https://github.com/npostavs 143 | [peter]: https://github.com/pjweisberg 144 | [phil]: https://github.com/philjackson 145 | [remi]: https://github.com/vanicat 146 | [yann]: http://www.hodique.info 147 | -------------------------------------------------------------------------------- /lisp/magit-pull.el: -------------------------------------------------------------------------------- 1 | ;;; magit-pull.el --- Update local objects and refs -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements pull commands. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit) 30 | 31 | ;;; Options 32 | 33 | (defcustom magit-pull-or-fetch nil 34 | "Whether `magit-pull' also offers some fetch suffixes." 35 | :package-version '(magit . "3.0.0") 36 | :group 'magit-commands 37 | :type 'boolean) 38 | 39 | ;;; Commands 40 | 41 | ;;;###autoload (autoload 'magit-pull "magit-pull" nil t) 42 | (transient-define-prefix magit-pull () 43 | "Pull from another repository." 44 | :man-page "git-pull" 45 | :incompatible '(("--ff-only" "--rebase")) 46 | [:description 47 | (lambda () (if magit-pull-or-fetch "Pull arguments" "Arguments")) 48 | ("-f" "Fast-forward only" "--ff-only") 49 | ("-r" "Rebase local commits" ("-r" "--rebase")) 50 | ("-A" "Autostash" "--autostash" :level 7)] 51 | [:description 52 | (lambda () 53 | (if-let ((branch (magit-get-current-branch))) 54 | (concat 55 | (propertize "Pull into " 'face 'transient-heading) 56 | (propertize branch 'face 'magit-branch-local) 57 | (propertize " from" 'face 'transient-heading)) 58 | (propertize "Pull from" 'face 'transient-heading))) 59 | ("p" magit-pull-from-pushremote) 60 | ("u" magit-pull-from-upstream) 61 | ("e" "elsewhere" magit-pull-branch)] 62 | ["Fetch from" 63 | :if-non-nil magit-pull-or-fetch 64 | ("f" "remotes" magit-fetch-all-no-prune) 65 | ("F" "remotes and prune" magit-fetch-all-prune)] 66 | ["Fetch" 67 | :if-non-nil magit-pull-or-fetch 68 | ("o" "another branch" magit-fetch-branch) 69 | ("s" "explicit refspec" magit-fetch-refspec) 70 | ("m" "submodules" magit-fetch-modules)] 71 | ["Configure" 72 | ("r" magit-branch..rebase :if magit-get-current-branch) 73 | ("C" "variables..." magit-branch-configure)] 74 | (interactive) 75 | (transient-setup 'magit-pull nil nil :scope (magit-get-current-branch))) 76 | 77 | (defun magit-pull-arguments () 78 | (transient-args 'magit-pull)) 79 | 80 | ;;;###autoload (autoload 'magit-pull-from-pushremote "magit-pull" nil t) 81 | (transient-define-suffix magit-pull-from-pushremote (args) 82 | "Pull from the push-remote of the current branch. 83 | 84 | With a prefix argument or when the push-remote is either not 85 | configured or unusable, then let the user first configure the 86 | push-remote." 87 | :if #'magit-get-current-branch 88 | :description #'magit-pull--pushbranch-description 89 | (interactive (list (magit-pull-arguments))) 90 | (pcase-let ((`(,branch ,remote) 91 | (magit--select-push-remote "pull from there"))) 92 | (run-hooks 'magit-credential-hook) 93 | (magit-run-git-with-editor "pull" args remote branch))) 94 | 95 | (defun magit-pull--pushbranch-description () 96 | ;; Also used by `magit-rebase-onto-pushremote'. 97 | (let* ((branch (magit-get-current-branch)) 98 | (target (magit-get-push-branch branch t)) 99 | (remote (magit-get-push-remote branch)) 100 | (v (magit--push-remote-variable branch t))) 101 | (cond 102 | (target) 103 | ((member remote (magit-list-remotes)) 104 | (format "%s, replacing non-existent" v)) 105 | (remote 106 | (format "%s, replacing invalid" v)) 107 | (t 108 | (format "%s, setting that" v))))) 109 | 110 | ;;;###autoload (autoload 'magit-pull-from-upstream "magit-pull" nil t) 111 | (transient-define-suffix magit-pull-from-upstream (args) 112 | "Pull from the upstream of the current branch. 113 | 114 | With a prefix argument or when the upstream is either not 115 | configured or unusable, then let the user first configure 116 | the upstream." 117 | :if #'magit-get-current-branch 118 | :description #'magit-pull--upstream-description 119 | (interactive (list (magit-pull-arguments))) 120 | (let* ((branch (or (magit-get-current-branch) 121 | (user-error "No branch is checked out"))) 122 | (remote (magit-get "branch" branch "remote")) 123 | (merge (magit-get "branch" branch "merge"))) 124 | (when (or current-prefix-arg 125 | (not (or (magit-get-upstream-branch branch) 126 | (magit--unnamed-upstream-p remote merge)))) 127 | (magit-set-upstream-branch 128 | branch (magit-read-upstream-branch 129 | branch (format "Set upstream of %s and pull from there" branch))) 130 | (setq remote (magit-get "branch" branch "remote")) 131 | (setq merge (magit-get "branch" branch "merge"))) 132 | (run-hooks 'magit-credential-hook) 133 | (magit-run-git-with-editor "pull" args remote merge))) 134 | 135 | (defun magit-pull--upstream-description () 136 | (and-let* ((branch (magit-get-current-branch))) 137 | (or (magit-get-upstream-branch branch) 138 | (let ((remote (magit-get "branch" branch "remote")) 139 | (merge (magit-get "branch" branch "merge")) 140 | (u (magit--propertize-face "@{upstream}" 'bold))) 141 | (cond 142 | ((magit--unnamed-upstream-p remote merge) 143 | (format "%s of %s" 144 | (magit--propertize-face merge 'magit-branch-remote) 145 | (magit--propertize-face remote 'bold))) 146 | ((magit--valid-upstream-p remote merge) 147 | (concat u ", replacing non-existent")) 148 | ((or remote merge) 149 | (concat u ", replacing invalid")) 150 | (t 151 | (concat u ", setting that"))))))) 152 | 153 | ;;;###autoload 154 | (defun magit-pull-branch (source args) 155 | "Pull from a branch read in the minibuffer." 156 | (interactive (list (magit-read-remote-branch "Pull" nil nil nil t) 157 | (magit-pull-arguments))) 158 | (run-hooks 'magit-credential-hook) 159 | (pcase-let ((`(,remote . ,branch) 160 | (magit-get-tracked source))) 161 | (magit-run-git-with-editor "pull" args remote branch))) 162 | 163 | ;;; _ 164 | (provide 'magit-pull) 165 | ;;; magit-pull.el ends here 166 | -------------------------------------------------------------------------------- /lisp/magit-subtree.el: -------------------------------------------------------------------------------- 1 | ;;; magit-subtree.el --- Subtree support for Magit -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Code: 24 | 25 | (require 'magit) 26 | 27 | ;;; Commands 28 | 29 | ;;;###autoload (autoload 'magit-subtree "magit-subtree" nil t) 30 | (transient-define-prefix magit-subtree () 31 | "Import or export subtrees." 32 | :man-page "git-subtree" 33 | ["Actions" 34 | ("i" "Import" magit-subtree-import) 35 | ("e" "Export" magit-subtree-export)]) 36 | 37 | ;;;###autoload (autoload 'magit-subtree-import "magit-subtree" nil t) 38 | (transient-define-prefix magit-subtree-import () 39 | "Import subtrees." 40 | :man-page "git-subtree" 41 | ["Arguments" 42 | (magit-subtree:--prefix) 43 | (magit-subtree:--message) 44 | ("-s" "Squash" "--squash")] 45 | ["Actions" 46 | [("a" "Add" magit-subtree-add) 47 | ("c" "Add commit" magit-subtree-add-commit)] 48 | [("m" "Merge" magit-subtree-merge) 49 | ("f" "Pull" magit-subtree-pull)]]) 50 | 51 | ;;;###autoload (autoload 'magit-subtree-export "magit-subtree" nil t) 52 | (transient-define-prefix magit-subtree-export () 53 | "Export subtrees." 54 | :man-page "git-subtree" 55 | ["Arguments" 56 | (magit-subtree:--prefix) 57 | (magit-subtree:--annotate) 58 | (magit-subtree:--branch) 59 | (magit-subtree:--onto) 60 | ("-i" "Ignore joins" "--ignore-joins") 61 | ("-j" "Rejoin" "--rejoin")] 62 | ["Actions" 63 | ("p" "Push" magit-subtree-push) 64 | ("s" "Split" magit-subtree-split)]) 65 | 66 | (transient-define-argument magit-subtree:--prefix () 67 | :description "Prefix" 68 | :class 'transient-option 69 | :shortarg "-P" 70 | :argument "--prefix=" 71 | :reader #'magit-subtree-read-prefix) 72 | 73 | (defun magit-subtree-read-prefix (prompt &optional default _history) 74 | (let* ((insert-default-directory nil) 75 | (topdir (magit-toplevel)) 76 | (prefix (read-directory-name (concat prompt ": ") topdir default))) 77 | (if (file-name-absolute-p prefix) 78 | ;; At least `ido-mode's variant is not compatible. 79 | (if (string-prefix-p topdir prefix) 80 | (file-relative-name prefix topdir) 81 | (user-error "%s isn't inside the repository at %s" prefix topdir)) 82 | prefix))) 83 | 84 | (transient-define-argument magit-subtree:--message () 85 | :description "Message" 86 | :class 'transient-option 87 | :shortarg "-m" 88 | :argument "--message=") 89 | 90 | (transient-define-argument magit-subtree:--annotate () 91 | :description "Annotate" 92 | :class 'transient-option 93 | :key "-a" 94 | :argument "--annotate=") 95 | 96 | (transient-define-argument magit-subtree:--branch () 97 | :description "Branch" 98 | :class 'transient-option 99 | :shortarg "-b" 100 | :argument "--branch=") 101 | 102 | (transient-define-argument magit-subtree:--onto () 103 | :description "Onto" 104 | :class 'transient-option 105 | :key "-o" 106 | :argument "--onto=" 107 | :reader #'magit-transient-read-revision) 108 | 109 | (defun magit-subtree-prefix (transient prompt) 110 | (if-let ((arg (--first (string-prefix-p "--prefix=" it) 111 | (transient-args transient)))) 112 | (substring arg 9) 113 | (magit-subtree-read-prefix prompt))) 114 | 115 | (defun magit-subtree-arguments (transient) 116 | (--remove (string-prefix-p "--prefix=" it) 117 | (transient-args transient))) 118 | 119 | (defun magit-git-subtree (subcmd prefix &rest args) 120 | (magit-run-git-async "subtree" subcmd (concat "--prefix=" prefix) args)) 121 | 122 | ;;;###autoload 123 | (defun magit-subtree-add (prefix repository ref args) 124 | "Add REF from REPOSITORY as a new subtree at PREFIX." 125 | (interactive 126 | (cons (magit-subtree-prefix 'magit-subtree-import "Add subtree") 127 | (let ((remote (magit-read-remote-or-url "From repository"))) 128 | (list remote 129 | (magit-read-refspec "Ref" remote) 130 | (magit-subtree-arguments 'magit-subtree-import))))) 131 | (magit-git-subtree "add" prefix args repository ref)) 132 | 133 | ;;;###autoload 134 | (defun magit-subtree-add-commit (prefix commit args) 135 | "Add COMMIT as a new subtree at PREFIX." 136 | (interactive 137 | (list (magit-subtree-prefix 'magit-subtree-import "Add subtree") 138 | (magit-read-string-ns "Commit") 139 | (magit-subtree-arguments 'magit-subtree-import))) 140 | (magit-git-subtree "add" prefix args commit)) 141 | 142 | ;;;###autoload 143 | (defun magit-subtree-merge (prefix commit args) 144 | "Merge COMMIT into the PREFIX subtree." 145 | (interactive 146 | (list (magit-subtree-prefix 'magit-subtree-import "Merge into subtree") 147 | (magit-read-string-ns "Commit") 148 | (magit-subtree-arguments 'magit-subtree-import))) 149 | (magit-git-subtree "merge" prefix args commit)) 150 | 151 | ;;;###autoload 152 | (defun magit-subtree-pull (prefix repository ref args) 153 | "Pull REF from REPOSITORY into the PREFIX subtree." 154 | (interactive 155 | (cons (magit-subtree-prefix 'magit-subtree-import "Pull into subtree") 156 | (let ((remote (magit-read-remote-or-url "From repository"))) 157 | (list remote 158 | (magit-read-refspec "Ref" remote) 159 | (magit-subtree-arguments 'magit-subtree-import))))) 160 | (magit-git-subtree "pull" prefix args repository ref)) 161 | 162 | ;;;###autoload 163 | (defun magit-subtree-push (prefix repository ref args) 164 | "Extract the history of the subtree PREFIX and push it to REF on REPOSITORY." 165 | (interactive (list (magit-subtree-prefix 'magit-subtree-export "Push subtree") 166 | (magit-read-remote-or-url "To repository") 167 | (magit-read-string-ns "To reference") 168 | (magit-subtree-arguments 'magit-subtree-export))) 169 | (magit-git-subtree "push" prefix args repository ref)) 170 | 171 | ;;;###autoload 172 | (defun magit-subtree-split (prefix commit args) 173 | "Extract the history of the subtree PREFIX." 174 | (interactive (list (magit-subtree-prefix 'magit-subtree-export "Split subtree") 175 | (magit-read-string-ns "Commit") 176 | (magit-subtree-arguments 'magit-subtree-export))) 177 | (magit-git-subtree "split" prefix args commit)) 178 | 179 | ;;; _ 180 | (provide 'magit-subtree) 181 | ;;; magit-subtree.el ends here 182 | -------------------------------------------------------------------------------- /lisp/magit-sparse-checkout.el: -------------------------------------------------------------------------------- 1 | ;;; magit-sparse-checkout.el --- Sparse checkout support for Magit -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Kyle Meyer 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library provides an interface to the `git sparse-checkout' 26 | ;; command. It's been possible to define sparse checkouts since Git 27 | ;; v1.7.0 by adding patterns to $GIT_DIR/info/sparse-checkout and 28 | ;; calling `git read-tree -mu HEAD' to update the index and working 29 | ;; tree. However, Git v2.25 introduced the `git sparse-checkout' 30 | ;; command along with "cone mode", which restricts the possible 31 | ;; patterns to directories to provide better performance. 32 | ;; 33 | ;; The goal of this library is to support the `git sparse-checkout' 34 | ;; command operating in cone mode. 35 | 36 | ;;; Code: 37 | 38 | (require 'magit) 39 | 40 | ;;; Utilities 41 | 42 | (defun magit-sparse-checkout-enabled-p () 43 | "Return non-nil if working tree is a sparse checkout." 44 | (magit-get-boolean "core.sparsecheckout")) 45 | 46 | (defun magit-sparse-checkout--assert-version () 47 | ;; Older versions of Git have the ability to define sparse checkout 48 | ;; patterns in .git/info/sparse-checkout, but the sparse-checkout 49 | ;; command isn't available until 2.25.0. 50 | (when (magit-git-version< "2.25.0") 51 | (user-error "`git sparse-checkout' not available until Git v2.25"))) 52 | 53 | (defun magit-sparse-checkout--auto-enable () 54 | (if (magit-sparse-checkout-enabled-p) 55 | (unless (magit-get-boolean "core.sparsecheckoutcone") 56 | (user-error 57 | "Magit's sparse checkout functionality requires cone mode")) 58 | ;; Note: Don't use `magit-sparse-checkout-enable' because it's 59 | ;; asynchronous. 60 | (magit-run-git "sparse-checkout" "init" "--cone"))) 61 | 62 | (defun magit-sparse-checkout-directories () 63 | "Return directories that are recursively included in the sparse checkout. 64 | See the `git sparse-checkout' manpage for details about 65 | \"recursive\" versus \"parent\" directories in cone mode." 66 | (and (magit-get-boolean "core.sparsecheckoutcone") 67 | (mapcar #'file-name-as-directory 68 | (magit-git-lines "sparse-checkout" "list")))) 69 | 70 | ;;; Commands 71 | 72 | ;;;###autoload (autoload 'magit-sparse-checkout "magit-sparse-checkout" nil t) 73 | (transient-define-prefix magit-sparse-checkout () 74 | "Create and manage sparse checkouts." 75 | :man-page "git-sparse-checkout" 76 | ["Arguments for enabling" 77 | :if-not magit-sparse-checkout-enabled-p 78 | ("-i" "Use sparse index" "--sparse-index")] 79 | ["Actions" 80 | [:if-not magit-sparse-checkout-enabled-p 81 | ("e" "Enable sparse checkout" magit-sparse-checkout-enable)] 82 | [:if magit-sparse-checkout-enabled-p 83 | ("d" "Disable sparse checkout" magit-sparse-checkout-disable) 84 | ("r" "Reapply rules" magit-sparse-checkout-reapply)] 85 | [("s" "Set directories" magit-sparse-checkout-set) 86 | ("a" "Add directories" magit-sparse-checkout-add)]]) 87 | 88 | ;;;###autoload 89 | (defun magit-sparse-checkout-enable (&optional args) 90 | "Convert the working tree to a sparse checkout." 91 | (interactive (list (transient-args 'magit-sparse-checkout))) 92 | (magit-sparse-checkout--assert-version) 93 | (magit-run-git-async "sparse-checkout" "init" "--cone" args)) 94 | 95 | ;;;###autoload 96 | (defun magit-sparse-checkout-set (directories) 97 | "Restrict working tree to DIRECTORIES. 98 | To extend rather than override the currently configured 99 | directories, call `magit-sparse-checkout-add' instead." 100 | (interactive 101 | (list (magit-completing-read-multiple 102 | "Include these directories: " 103 | ;; Note: Given that the appeal of sparse checkouts is 104 | ;; dealing with very large trees, listing all subdirectories 105 | ;; may need to be reconsidered. 106 | (magit-revision-directories "HEAD")))) 107 | (magit-sparse-checkout--assert-version) 108 | (magit-sparse-checkout--auto-enable) 109 | (magit-run-git-async "sparse-checkout" "set" directories)) 110 | 111 | ;;;###autoload 112 | (defun magit-sparse-checkout-add (directories) 113 | "Add DIRECTORIES to the working tree. 114 | To override rather than extend the currently configured 115 | directories, call `magit-sparse-checkout-set' instead." 116 | (interactive 117 | (list (magit-completing-read-multiple 118 | "Add these directories: " 119 | ;; Same performance note as in `magit-sparse-checkout-set', 120 | ;; but even more so given the additional processing. 121 | (seq-remove 122 | (let ((re (concat 123 | "\\`" 124 | (regexp-opt (magit-sparse-checkout-directories))))) 125 | (lambda (d) (string-match-p re d))) 126 | (magit-revision-directories "HEAD"))))) 127 | (magit-sparse-checkout--assert-version) 128 | (magit-sparse-checkout--auto-enable) 129 | (magit-run-git-async "sparse-checkout" "add" directories)) 130 | 131 | ;;;###autoload 132 | (defun magit-sparse-checkout-reapply () 133 | "Reapply the sparse checkout rules to the working tree. 134 | Some operations such as merging or rebasing may need to check out 135 | files that aren't included in the sparse checkout. Call this 136 | command to reset to the sparse checkout state." 137 | (interactive) 138 | (magit-sparse-checkout--assert-version) 139 | (magit-run-git-async "sparse-checkout" "reapply")) 140 | 141 | ;;;###autoload 142 | (defun magit-sparse-checkout-disable () 143 | "Convert sparse checkout to full checkout. 144 | Note that disabling the sparse checkout does not clear the 145 | configured directories. Call `magit-sparse-checkout-enable' to 146 | restore the previous sparse checkout." 147 | (interactive) 148 | (magit-sparse-checkout--assert-version) 149 | (magit-run-git-async "sparse-checkout" "disable")) 150 | 151 | ;;; Miscellaneous 152 | 153 | (defun magit-sparse-checkout-insert-header () 154 | "Insert header line with sparse checkout information. 155 | This header is not inserted by default. To enable it, add it to 156 | `magit-status-headers-hook'." 157 | (when (magit-sparse-checkout-enabled-p) 158 | (insert (propertize (format "%-10s" "Sparse! ") 159 | 'font-lock-face 'magit-section-heading)) 160 | (insert 161 | (let ((dirs (magit-sparse-checkout-directories))) 162 | (pcase (length dirs) 163 | (0 "top-level directory") 164 | (1 (car dirs)) 165 | (n (format "%d directories" n))))) 166 | (insert ?\n))) 167 | 168 | ;;; _ 169 | (provide 'magit-sparse-checkout) 170 | ;;; magit-sparse-checkout.el ends here 171 | -------------------------------------------------------------------------------- /lisp/magit-fetch.el: -------------------------------------------------------------------------------- 1 | ;;; magit-fetch.el --- Download objects and refs -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements fetch commands. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit) 30 | 31 | ;;; Commands 32 | 33 | ;;;###autoload (autoload 'magit-fetch "magit-fetch" nil t) 34 | (transient-define-prefix magit-fetch () 35 | "Fetch from another repository." 36 | :man-page "git-fetch" 37 | ["Arguments" 38 | ("-p" "Prune deleted branches" ("-p" "--prune")) 39 | ("-t" "Fetch all tags" ("-t" "--tags")) 40 | (7 "-u" "Fetch full history" "--unshallow")] 41 | ["Fetch from" 42 | ("p" magit-fetch-from-pushremote) 43 | ("u" magit-fetch-from-upstream) 44 | ("e" "elsewhere" magit-fetch-other) 45 | ("a" "all remotes" magit-fetch-all)] 46 | ["Fetch" 47 | ("o" "another branch" magit-fetch-branch) 48 | ("r" "explicit refspec" magit-fetch-refspec) 49 | ("m" "submodules" magit-fetch-modules)] 50 | ["Configure" 51 | ("C" "variables..." magit-branch-configure)]) 52 | 53 | (defun magit-fetch-arguments () 54 | (transient-args 'magit-fetch)) 55 | 56 | (defun magit-git-fetch (remote args) 57 | (run-hooks 'magit-credential-hook) 58 | (magit-run-git-async "fetch" remote args)) 59 | 60 | ;;;###autoload (autoload 'magit-fetch-from-pushremote "magit-fetch" nil t) 61 | (transient-define-suffix magit-fetch-from-pushremote (args) 62 | "Fetch from the current push-remote. 63 | 64 | With a prefix argument or when the push-remote is either not 65 | configured or unusable, then let the user first configure the 66 | push-remote." 67 | :description #'magit-fetch--pushremote-description 68 | (interactive (list (magit-fetch-arguments))) 69 | (let ((remote (magit-get-push-remote))) 70 | (when (or current-prefix-arg 71 | (not (member remote (magit-list-remotes)))) 72 | (let ((var (magit--push-remote-variable))) 73 | (setq remote 74 | (magit-read-remote (format "Set %s and fetch from there" var))) 75 | (magit-set remote var))) 76 | (magit-git-fetch remote args))) 77 | 78 | (defun magit-fetch--pushremote-description () 79 | (let* ((branch (magit-get-current-branch)) 80 | (remote (magit-get-push-remote branch)) 81 | (v (magit--push-remote-variable branch t))) 82 | (cond 83 | ((member remote (magit-list-remotes)) remote) 84 | (remote 85 | (format "%s, replacing invalid" v)) 86 | (t 87 | (format "%s, setting that" v))))) 88 | 89 | ;;;###autoload (autoload 'magit-fetch-from-upstream "magit-fetch" nil t) 90 | (transient-define-suffix magit-fetch-from-upstream (remote args) 91 | "Fetch from the \"current\" remote, usually the upstream. 92 | 93 | If the upstream is configured for the current branch and names 94 | an existing remote, then use that. Otherwise try to use another 95 | remote: If only a single remote is configured, then use that. 96 | Otherwise if a remote named \"origin\" exists, then use that. 97 | 98 | If no remote can be determined, then this command is not available 99 | from the `magit-fetch' transient prefix and invoking it directly 100 | results in an error." 101 | :if (lambda () (magit-get-current-remote t)) 102 | :description (lambda () (magit-get-current-remote t)) 103 | (interactive (list (magit-get-current-remote t) 104 | (magit-fetch-arguments))) 105 | (unless remote 106 | (error "The \"current\" remote could not be determined")) 107 | (magit-git-fetch remote args)) 108 | 109 | ;;;###autoload 110 | (defun magit-fetch-other (remote args) 111 | "Fetch from another repository." 112 | (interactive (list (magit-read-remote "Fetch remote") 113 | (magit-fetch-arguments))) 114 | (magit-git-fetch remote args)) 115 | 116 | ;;;###autoload 117 | (defun magit-fetch-branch (remote branch args) 118 | "Fetch a BRANCH from a REMOTE." 119 | (interactive 120 | (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) 121 | (list remote 122 | (magit-read-remote-branch "Fetch branch" remote) 123 | (magit-fetch-arguments)))) 124 | (magit-git-fetch remote (cons branch args))) 125 | 126 | ;;;###autoload 127 | (defun magit-fetch-refspec (remote refspec args) 128 | "Fetch a REFSPEC from a REMOTE." 129 | (interactive 130 | (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) 131 | (list remote 132 | (magit-read-refspec "Fetch using refspec" remote) 133 | (magit-fetch-arguments)))) 134 | (magit-git-fetch remote (cons refspec args))) 135 | 136 | ;;;###autoload 137 | (defun magit-fetch-all (args) 138 | "Fetch from all remotes." 139 | (interactive (list (magit-fetch-arguments))) 140 | (magit-git-fetch nil (cons "--all" args))) 141 | 142 | ;;;###autoload 143 | (defun magit-fetch-all-prune () 144 | "Fetch from all remotes, and prune. 145 | Prune remote tracking branches for branches that have been 146 | removed on the respective remote." 147 | (interactive) 148 | (run-hooks 'magit-credential-hook) 149 | (magit-run-git-async "remote" "update" "--prune")) 150 | 151 | ;;;###autoload 152 | (defun magit-fetch-all-no-prune () 153 | "Fetch from all remotes." 154 | (interactive) 155 | (run-hooks 'magit-credential-hook) 156 | (magit-run-git-async "remote" "update")) 157 | 158 | ;;;###autoload (autoload 'magit-fetch-modules "magit-fetch" nil t) 159 | (transient-define-prefix magit-fetch-modules (&optional transient args) 160 | "Fetch all populated submodules. 161 | 162 | Fetching is done using \"git fetch --recurse-submodules\", which 163 | means that the super-repository and recursively all submodules 164 | are also fetched. 165 | 166 | To set and potentially save other arguments invoke this command 167 | with a prefix argument." 168 | :man-page "git-fetch" 169 | :value (list "--verbose" "--jobs=4") 170 | ["Arguments" 171 | ("-v" "verbose" "--verbose") 172 | ("-j" "number of jobs" "--jobs=" :reader transient-read-number-N+)] 173 | ["Action" 174 | ("m" "fetch modules" magit-fetch-modules)] 175 | (interactive (if current-prefix-arg 176 | (list t) 177 | (list nil (transient-args 'magit-fetch-modules)))) 178 | (if transient 179 | (transient-setup 'magit-fetch-modules) 180 | (when (magit-git-version< "2.8.0") 181 | (when-let ((value (transient-arg-value "--jobs=" args))) 182 | (message "Dropping --jobs; not supported by Git v%s" 183 | (magit-git-version)) 184 | (setq args (remove (format "--jobs=%s" value) args)))) 185 | (magit-with-toplevel 186 | (magit-run-git-async "fetch" "--recurse-submodules" args)))) 187 | 188 | ;;; _ 189 | (provide 'magit-fetch) 190 | ;;; magit-fetch.el ends here 191 | -------------------------------------------------------------------------------- /lisp/magit-notes.el: -------------------------------------------------------------------------------- 1 | ;;; magit-notes.el --- Notes support -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements support for `git-notes'. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit) 30 | 31 | ;;; Commands 32 | 33 | ;;;###autoload (autoload 'magit-notes "magit" nil t) 34 | (transient-define-prefix magit-notes () 35 | "Edit notes attached to commits." 36 | :man-page "git-notes" 37 | ["Configure local settings" 38 | ("c" magit-core.notesRef) 39 | ("d" magit-notes.displayRef)] 40 | ["Configure global settings" 41 | ("C" magit-global-core.notesRef) 42 | ("D" magit-global-notes.displayRef)] 43 | ["Arguments for prune" 44 | :if-not magit-notes-merging-p 45 | ("-n" "Dry run" ("-n" "--dry-run"))] 46 | ["Arguments for edit and remove" 47 | :if-not magit-notes-merging-p 48 | (magit-notes:--ref)] 49 | ["Arguments for merge" 50 | :if-not magit-notes-merging-p 51 | (magit-notes:--strategy)] 52 | ["Actions" 53 | :if-not magit-notes-merging-p 54 | ("T" "Edit" magit-notes-edit) 55 | ("r" "Remove" magit-notes-remove) 56 | ("m" "Merge" magit-notes-merge) 57 | ("p" "Prune" magit-notes-prune)] 58 | ["Actions" 59 | :if magit-notes-merging-p 60 | ("c" "Commit merge" magit-notes-merge-commit) 61 | ("a" "Abort merge" magit-notes-merge-abort)]) 62 | 63 | (defun magit-notes-merging-p () 64 | (let ((dir (expand-file-name "NOTES_MERGE_WORKTREE" (magit-gitdir)))) 65 | (and (file-directory-p dir) 66 | (directory-files dir nil "\\`[^.]")))) 67 | 68 | (transient-define-infix magit-core.notesRef () 69 | :class 'magit--git-variable 70 | :variable "core.notesRef" 71 | :reader #'magit-notes-read-ref 72 | :prompt "Set local core.notesRef") 73 | 74 | (transient-define-infix magit-notes.displayRef () 75 | :class 'magit--git-variable 76 | :variable "notes.displayRef" 77 | :multi-value t 78 | :reader #'magit-notes-read-refs 79 | :prompt "Set local notes.displayRef") 80 | 81 | (transient-define-infix magit-global-core.notesRef () 82 | :class 'magit--git-variable 83 | :variable "core.notesRef" 84 | :global t 85 | :reader #'magit-notes-read-ref 86 | :prompt "Set global core.notesRef") 87 | 88 | (transient-define-infix magit-global-notes.displayRef () 89 | :class 'magit--git-variable 90 | :variable "notes.displayRef" 91 | :global t 92 | :multi-value t 93 | :reader #'magit-notes-read-refs 94 | :prompt "Set global notes.displayRef") 95 | 96 | (transient-define-argument magit-notes:--ref () 97 | :description "Manipulate ref" 98 | :class 'transient-option 99 | :key "-r" 100 | :argument "--ref=" 101 | :reader #'magit-notes-read-ref) 102 | 103 | (transient-define-argument magit-notes:--strategy () 104 | :description "Merge strategy" 105 | :class 'transient-option 106 | :shortarg "-s" 107 | :argument "--strategy=" 108 | :choices '("manual" "ours" "theirs" "union" "cat_sort_uniq")) 109 | 110 | (defun magit-notes-edit (commit &optional ref) 111 | "Edit the note attached to COMMIT. 112 | REF is the notes ref used to store the notes. 113 | 114 | Interactively or when optional REF is nil use the value of Git 115 | variable `core.notesRef' or \"refs/notes/commits\" if that is 116 | undefined." 117 | (interactive (magit-notes-read-args "Edit notes")) 118 | (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref)) 119 | "edit" commit)) 120 | 121 | (defun magit-notes-remove (commit &optional ref) 122 | "Remove the note attached to COMMIT. 123 | REF is the notes ref from which the note is removed. 124 | 125 | Interactively or when optional REF is nil use the value of Git 126 | variable `core.notesRef' or \"refs/notes/commits\" if that is 127 | undefined." 128 | (interactive (magit-notes-read-args "Remove notes")) 129 | (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref)) 130 | "remove" commit)) 131 | 132 | (defun magit-notes-merge (ref) 133 | "Merge the notes ref REF into the current notes ref. 134 | 135 | The current notes ref is the value of Git variable 136 | `core.notesRef' or \"refs/notes/commits\" if that is undefined. 137 | 138 | When there are conflicts, then they have to be resolved in the 139 | temporary worktree \".git/NOTES_MERGE_WORKTREE\". When 140 | done use `magit-notes-merge-commit' to finish. To abort 141 | use `magit-notes-merge-abort'." 142 | (interactive (list (magit-read-string-ns "Merge reference"))) 143 | (magit-run-git-with-editor "notes" "merge" ref)) 144 | 145 | (defun magit-notes-merge-commit () 146 | "Commit the current notes ref merge. 147 | Also see `magit-notes-merge'." 148 | (interactive) 149 | (magit-run-git-with-editor "notes" "merge" "--commit")) 150 | 151 | (defun magit-notes-merge-abort () 152 | "Abort the current notes ref merge. 153 | Also see `magit-notes-merge'." 154 | (interactive) 155 | (magit-run-git-with-editor "notes" "merge" "--abort")) 156 | 157 | (defun magit-notes-prune (&optional dry-run) 158 | "Remove notes about unreachable commits." 159 | (interactive (list (and (member "--dry-run" (transient-args 'magit-notes)) t))) 160 | (when dry-run 161 | (magit-process-buffer)) 162 | (magit-run-git-with-editor "notes" "prune" (and dry-run "--dry-run"))) 163 | 164 | ;;; Readers 165 | 166 | (defun magit-notes-read-ref (prompt _initial-input history) 167 | (and-let* ((ref (magit-completing-read 168 | prompt (magit-list-notes-refnames) nil nil 169 | (and-let* ((def (magit-get "core.notesRef"))) 170 | (if (string-prefix-p "refs/notes/" def) 171 | (substring def 11) 172 | def)) 173 | history))) 174 | (if (string-prefix-p "refs/" ref) 175 | ref 176 | (concat "refs/notes/" ref)))) 177 | 178 | (defun magit-notes-read-refs (prompt &optional _initial-input _history) 179 | (mapcar (lambda (ref) 180 | (if (string-prefix-p "refs/" ref) 181 | ref 182 | (concat "refs/notes/" ref))) 183 | (completing-read-multiple 184 | (concat prompt ": ") 185 | (magit-list-notes-refnames) nil nil 186 | (mapconcat (lambda (ref) 187 | (if (string-prefix-p "refs/notes/" ref) 188 | (substring ref 11) 189 | ref)) 190 | (magit-get-all "notes.displayRef") 191 | ",")))) 192 | 193 | (defun magit-notes-read-args (prompt) 194 | (list (magit-read-branch-or-commit prompt (magit-stash-at-point)) 195 | (and-let* ((str (--first (string-match "^--ref=\\(.+\\)" it) 196 | (transient-args 'magit-notes)))) 197 | (match-string 1 str)))) 198 | 199 | ;;; _ 200 | (provide 'magit-notes) 201 | ;;; magit-notes.el ends here 202 | -------------------------------------------------------------------------------- /lisp/magit-reflog.el: -------------------------------------------------------------------------------- 1 | ;;; magit-reflog.el --- Inspect ref history -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements support for looking at Git reflogs. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit-core) 30 | (require 'magit-log) 31 | 32 | ;;; Options 33 | 34 | (defcustom magit-reflog-limit 256 35 | "Maximal number of entries initially shown in reflog buffers. 36 | The limit in the current buffer can be changed using \"+\" 37 | and \"-\"." 38 | :package-version '(magit . "3.0.0") 39 | :group 'magit-commands 40 | :type 'number) 41 | 42 | (defcustom magit-reflog-margin 43 | (list (nth 0 magit-log-margin) 44 | (nth 1 magit-log-margin) 45 | 'magit-log-margin-width nil 46 | (nth 4 magit-log-margin)) 47 | "Format of the margin in `magit-reflog-mode' buffers. 48 | 49 | The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH). 50 | 51 | If INIT is non-nil, then the margin is shown initially. 52 | STYLE controls how to format the author or committer date. 53 | It can be one of `age' (to show the age of the commit), 54 | `age-abbreviated' (to abbreviate the time unit to a character), 55 | or a string (suitable for `format-time-string') to show the 56 | actual date. Option `magit-log-margin-show-committer-date' 57 | controls which date is being displayed. 58 | WIDTH controls the width of the margin. This exists for forward 59 | compatibility and currently the value should not be changed. 60 | AUTHOR controls whether the name of the author is also shown by 61 | default. 62 | AUTHOR-WIDTH has to be an integer. When the name of the author 63 | is shown, then this specifies how much space is used to do so." 64 | :package-version '(magit . "2.9.0") 65 | :group 'magit-log 66 | :group 'magit-margin 67 | :type magit-log-margin--custom-type 68 | :initialize #'magit-custom-initialize-reset 69 | :set-after '(magit-log-margin) 70 | :set (apply-partially #'magit-margin-set-variable 'magit-reflog-mode)) 71 | 72 | ;;; Faces 73 | 74 | (defface magit-reflog-commit '((t :foreground "green")) 75 | "Face for commit commands in reflogs." 76 | :group 'magit-faces) 77 | 78 | (defface magit-reflog-amend '((t :foreground "magenta")) 79 | "Face for amend commands in reflogs." 80 | :group 'magit-faces) 81 | 82 | (defface magit-reflog-merge '((t :foreground "green")) 83 | "Face for merge, checkout and branch commands in reflogs." 84 | :group 'magit-faces) 85 | 86 | (defface magit-reflog-checkout '((t :foreground "blue")) 87 | "Face for checkout commands in reflogs." 88 | :group 'magit-faces) 89 | 90 | (defface magit-reflog-reset '((t :foreground "red")) 91 | "Face for reset commands in reflogs." 92 | :group 'magit-faces) 93 | 94 | (defface magit-reflog-rebase '((t :foreground "magenta")) 95 | "Face for rebase commands in reflogs." 96 | :group 'magit-faces) 97 | 98 | (defface magit-reflog-cherry-pick '((t :foreground "green")) 99 | "Face for cherry-pick commands in reflogs." 100 | :group 'magit-faces) 101 | 102 | (defface magit-reflog-remote '((t :foreground "cyan")) 103 | "Face for pull and clone commands in reflogs." 104 | :group 'magit-faces) 105 | 106 | (defface magit-reflog-other '((t :foreground "cyan")) 107 | "Face for other commands in reflogs." 108 | :group 'magit-faces) 109 | 110 | ;;; Commands 111 | 112 | ;;;###autoload 113 | (defun magit-reflog-current () 114 | "Display the reflog of the current branch. 115 | If `HEAD' is detached, then show the reflog for that instead." 116 | (interactive) 117 | (magit-reflog-setup-buffer (or (magit-get-current-branch) "HEAD"))) 118 | 119 | ;;;###autoload 120 | (defun magit-reflog-other (ref) 121 | "Display the reflog of a branch or another ref." 122 | (interactive (list (magit-read-local-branch-or-ref "Show reflog for"))) 123 | (magit-reflog-setup-buffer ref)) 124 | 125 | ;;;###autoload 126 | (defun magit-reflog-head () 127 | "Display the `HEAD' reflog." 128 | (interactive) 129 | (magit-reflog-setup-buffer "HEAD")) 130 | 131 | ;;; Mode 132 | 133 | (defvar-keymap magit-reflog-mode-map 134 | :doc "Keymap for `magit-reflog-mode'." 135 | :parent magit-log-mode-map 136 | "C-c C-n" #'undefined 137 | "L" #'magit-margin-settings) 138 | 139 | (define-derived-mode magit-reflog-mode magit-mode "Magit Reflog" 140 | "Mode for looking at Git reflog. 141 | 142 | This mode is documented in info node `(magit)Reflog'. 143 | 144 | \\\ 145 | Type \\[magit-refresh] to refresh the current buffer. 146 | Type \\[magit-visit-thing] or \\[magit-diff-show-or-scroll-up] \ 147 | to visit the commit at point. 148 | 149 | Type \\[magit-cherry-pick] to apply the commit at point. 150 | Type \\[magit-reset] to reset `HEAD' to the commit at point. 151 | 152 | \\{magit-reflog-mode-map}" 153 | :group 'magit-log 154 | (hack-dir-local-variables-non-file-buffer) 155 | (setq magit--imenu-item-types 'commit)) 156 | 157 | (defun magit-reflog-setup-buffer (ref) 158 | (require 'magit) 159 | (magit-setup-buffer #'magit-reflog-mode nil 160 | (magit-buffer-refname ref) 161 | (magit-buffer-log-args (list (format "-n%s" magit-reflog-limit))))) 162 | 163 | (defun magit-reflog-refresh-buffer () 164 | (magit-set-header-line-format (concat "Reflog for " magit-buffer-refname)) 165 | (magit-insert-section (reflogbuf) 166 | (magit-git-wash (apply-partially #'magit-log-wash-log 'reflog) 167 | "reflog" "show" "--format=%h%x00%aN%x00%gd%x00%gs" "--date=raw" 168 | magit-buffer-log-args magit-buffer-refname "--"))) 169 | 170 | (cl-defmethod magit-buffer-value (&context (major-mode magit-reflog-mode)) 171 | magit-buffer-refname) 172 | 173 | (defvar magit-reflog-labels 174 | '(("commit" . magit-reflog-commit) 175 | ("amend" . magit-reflog-amend) 176 | ("merge" . magit-reflog-merge) 177 | ("checkout" . magit-reflog-checkout) 178 | ("branch" . magit-reflog-checkout) 179 | ("reset" . magit-reflog-reset) 180 | ("rebase" . magit-reflog-rebase) 181 | ("rewritten" . magit-reflog-rebase) 182 | ("cherry-pick" . magit-reflog-cherry-pick) 183 | ("initial" . magit-reflog-commit) 184 | ("pull" . magit-reflog-remote) 185 | ("clone" . magit-reflog-remote) 186 | ("autosave" . magit-reflog-commit) 187 | ("restart" . magit-reflog-reset))) 188 | 189 | (defun magit-reflog-format-subject (subject) 190 | (let* ((match (string-match magit-reflog-subject-re subject)) 191 | (command (and match (match-string 1 subject))) 192 | (option (and match (match-string 2 subject))) 193 | (type (and match (match-string 3 subject))) 194 | (label (if (string= command "commit") 195 | (or type command) 196 | command)) 197 | (text (if (string= command "commit") 198 | label 199 | (mapconcat #'identity 200 | (delq nil (list command option type)) 201 | " ")))) 202 | (format "%-16s " 203 | (magit--propertize-face 204 | text (or (cdr (assoc label magit-reflog-labels)) 205 | 'magit-reflog-other))))) 206 | 207 | ;;; _ 208 | (provide 'magit-reflog) 209 | ;;; magit-reflog.el ends here 210 | -------------------------------------------------------------------------------- /lisp/magit-gitignore.el: -------------------------------------------------------------------------------- 1 | ;;; magit-gitignore.el --- Intentionally untracked files -*- lexical-binding:t -*- 2 | 3 | ;; Copyright (C) 2008-2023 The Magit Project Contributors 4 | 5 | ;; Author: Jonas Bernoulli 6 | ;; Maintainer: Jonas Bernoulli 7 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later 9 | 10 | ;; Magit is free software: you can redistribute it and/or modify it 11 | ;; under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your option) any later version. 14 | ;; 15 | ;; Magit is distributed in the hope that it will be useful, but WITHOUT 16 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 17 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 18 | ;; License for more details. 19 | ;; 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with Magit. If not, see . 22 | 23 | ;;; Commentary: 24 | 25 | ;; This library implements gitignore commands. 26 | 27 | ;;; Code: 28 | 29 | (require 'magit) 30 | 31 | ;;; Transient 32 | 33 | ;;;###autoload (autoload 'magit-gitignore "magit-gitignore" nil t) 34 | (transient-define-prefix magit-gitignore () 35 | "Instruct Git to ignore a file or pattern." 36 | :man-page "gitignore" 37 | ["Gitignore" 38 | ("t" "shared at toplevel (.gitignore)" 39 | magit-gitignore-in-topdir) 40 | ("s" "shared in subdirectory (path/to/.gitignore)" 41 | magit-gitignore-in-subdir) 42 | ("p" "privately (.git/info/exclude)" 43 | magit-gitignore-in-gitdir) 44 | ("g" magit-gitignore-on-system 45 | :if (lambda () (magit-get "core.excludesfile")) 46 | :description (lambda () 47 | (format "privately for all repositories (%s)" 48 | (magit-get "core.excludesfile"))))] 49 | ["Skip worktree" 50 | (7 "w" "do skip worktree" magit-skip-worktree) 51 | (7 "W" "do not skip worktree" magit-no-skip-worktree)] 52 | ["Assume unchanged" 53 | (7 "u" "do assume unchanged" magit-assume-unchanged) 54 | (7 "U" "do not assume unchanged" magit-no-assume-unchanged)]) 55 | 56 | ;;; Gitignore Commands 57 | 58 | ;;;###autoload 59 | (defun magit-gitignore-in-topdir (rule) 60 | "Add the Git ignore RULE to the top-level \".gitignore\" file. 61 | Since this file is tracked, it is shared with other clones of the 62 | repository. Also stage the file." 63 | (interactive (list (magit-gitignore-read-pattern))) 64 | (magit-with-toplevel 65 | (magit--gitignore rule ".gitignore") 66 | (magit-run-git "add" ".gitignore"))) 67 | 68 | ;;;###autoload 69 | (defun magit-gitignore-in-subdir (rule directory) 70 | "Add the Git ignore RULE to a \".gitignore\" file in DIRECTORY. 71 | Prompt the user for a directory and add the rule to the 72 | \".gitignore\" file in that directory. Since such files are 73 | tracked, they are shared with other clones of the repository. 74 | Also stage the file." 75 | (interactive (list (magit-gitignore-read-pattern) 76 | (read-directory-name "Limit rule to files in: "))) 77 | (magit-with-toplevel 78 | (let ((file (expand-file-name ".gitignore" directory))) 79 | (magit--gitignore rule file) 80 | (magit-run-git "add" (magit-convert-filename-for-git file))))) 81 | 82 | ;;;###autoload 83 | (defun magit-gitignore-in-gitdir (rule) 84 | "Add the Git ignore RULE to \"$GIT_DIR/info/exclude\". 85 | Rules in that file only affects this clone of the repository." 86 | (interactive (list (magit-gitignore-read-pattern))) 87 | (magit--gitignore rule (expand-file-name "info/exclude" (magit-gitdir))) 88 | (magit-refresh)) 89 | 90 | ;;;###autoload 91 | (defun magit-gitignore-on-system (rule) 92 | "Add the Git ignore RULE to the file specified by `core.excludesFile'. 93 | Rules that are defined in that file affect all local repositories." 94 | (interactive (list (magit-gitignore-read-pattern))) 95 | (magit--gitignore rule 96 | (or (magit-get "core.excludesFile") 97 | (error "Variable `core.excludesFile' isn't set"))) 98 | (magit-refresh)) 99 | 100 | (defun magit--gitignore (rule file) 101 | (when-let ((directory (file-name-directory file))) 102 | (make-directory directory t)) 103 | (with-temp-buffer 104 | (when (file-exists-p file) 105 | (insert-file-contents file)) 106 | (goto-char (point-max)) 107 | (unless (bolp) 108 | (insert "\n")) 109 | (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" rule)) 110 | (insert "\n") 111 | (write-region nil nil file))) 112 | 113 | (defun magit-gitignore-read-pattern () 114 | (let* ((default (magit-current-file)) 115 | (base (car magit-buffer-diff-files)) 116 | (base (and base (file-directory-p base) base)) 117 | (choices 118 | (delete-dups 119 | (--mapcat 120 | (cons (concat "/" it) 121 | (and-let* ((ext (file-name-extension it))) 122 | (list (concat "/" (file-name-directory it) "*." ext) 123 | (concat "*." ext)))) 124 | (sort (nconc 125 | (magit-untracked-files nil base) 126 | ;; The untracked section of the status buffer lists 127 | ;; directories containing only untracked files. 128 | ;; Add those as candidates. 129 | (seq-filter #'directory-name-p 130 | (magit-list-files 131 | "--other" "--exclude-standard" "--directory" 132 | "--no-empty-directory" "--" base))) 133 | #'string-lessp))))) 134 | (when default 135 | (setq default (concat "/" default)) 136 | (unless (member default choices) 137 | (setq default (concat "*." (file-name-extension default))) 138 | (unless (member default choices) 139 | (setq default nil)))) 140 | (magit-completing-read "File or pattern to ignore" 141 | choices nil nil nil nil default))) 142 | 143 | ;;; Skip Worktree Commands 144 | 145 | ;;;###autoload 146 | (defun magit-skip-worktree (file) 147 | "Call \"git update-index --skip-worktree -- FILE\"." 148 | (interactive 149 | (list (magit-read-file-choice "Skip worktree for" 150 | (magit-with-toplevel 151 | (cl-set-difference 152 | (magit-list-files) 153 | (magit-skip-worktree-files) 154 | :test #'equal))))) 155 | (magit-with-toplevel 156 | (magit-run-git "update-index" "--skip-worktree" "--" file))) 157 | 158 | ;;;###autoload 159 | (defun magit-no-skip-worktree (file) 160 | "Call \"git update-index --no-skip-worktree -- FILE\"." 161 | (interactive 162 | (list (magit-read-file-choice "Do not skip worktree for" 163 | (magit-with-toplevel 164 | (magit-skip-worktree-files))))) 165 | (magit-with-toplevel 166 | (magit-run-git "update-index" "--no-skip-worktree" "--" file))) 167 | 168 | ;;; Assume Unchanged Commands 169 | 170 | ;;;###autoload 171 | (defun magit-assume-unchanged (file) 172 | "Call \"git update-index --assume-unchanged -- FILE\"." 173 | (interactive 174 | (list (magit-read-file-choice "Assume file to be unchanged" 175 | (magit-with-toplevel 176 | (cl-set-difference 177 | (magit-list-files) 178 | (magit-assume-unchanged-files) 179 | :test #'equal))))) 180 | (magit-with-toplevel 181 | (magit-run-git "update-index" "--assume-unchanged" "--" file))) 182 | 183 | ;;;###autoload 184 | (defun magit-no-assume-unchanged (file) 185 | "Call \"git update-index --no-assume-unchanged -- FILE\"." 186 | (interactive 187 | (list (magit-read-file-choice "Do not assume file to be unchanged" 188 | (magit-with-toplevel 189 | (magit-assume-unchanged-files))))) 190 | (magit-with-toplevel 191 | (magit-run-git "update-index" "--no-assume-unchanged" "--" file))) 192 | 193 | ;;; _ 194 | (provide 'magit-gitignore) 195 | ;;; magit-gitignore.el ends here 196 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | -include ../config.mk 2 | include ../default.mk 3 | 4 | ## ################################################################### 5 | 6 | .PHONY: texi install clean AUTHORS.md stats 7 | 8 | all: info 9 | 10 | ## Build ############################################################# 11 | 12 | info: $(INFOPAGES) dir 13 | html: $(HTMLFILES) 14 | pdf: $(PDFFILES) 15 | epub: $(EPUBFILES) 16 | 17 | %.info: %.texi 18 | @printf "Generating $@\n" 19 | @$(MAKEINFO) --no-split $< -o $@ 20 | 21 | dir: magit.info magit-section.info 22 | @printf "Generating dir\n" 23 | @echo $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@ 24 | 25 | HTML_FIXUP_CSS = '//a\ 26 | \ 27 | \n\ 28 | \n\ 29 | \n\ 30 | \n\ 31 | \n' 32 | HTML_FIXUP_ONLOAD = 's///' 33 | HTML_FIXUP_MENU = '/<\/body>/i
<\/div>' 34 | 35 | %.html: %.texi 36 | @printf "Generating $@\n" 37 | @$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $< 38 | @sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $@ 39 | 40 | html-dir: $(TEXIFILES) 41 | @printf "Generating magit/*.html\n" 42 | @$(MAKEINFO) --html -o $(PKG)/ $(MANUAL_HTML_ARGS) magit.texi 43 | @for f in $$(find magit -name '*.html') ; do \ 44 | sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $$f ; \ 45 | done 46 | @printf "Generating magit-section/*.html\n" 47 | @$(MAKEINFO) --html -o $(PKG)-section/ $(MANUAL_HTML_ARGS) magit-section.texi 48 | @for f in $$(find magit-section -name '*.html') ; do \ 49 | sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $$f ; \ 50 | done 51 | 52 | %.pdf: %.texi 53 | @printf "Generating $@\n" 54 | @texi2pdf --clean $< > /dev/null 55 | 56 | %.epub: %.texi 57 | @printf "Generating $@\n" 58 | @$(MAKEINFO) --docbook $< -o epub.xml 59 | @xsltproc $(DOCBOOK_XSL) epub.xml 2> /dev/null 60 | @echo "application/epub+zip" > mimetype 61 | @zip -X --quiet --recurse-paths -0 $@ mimetype 62 | @zip -X --quiet --recurse-paths -9 --no-dir-entries $@ META-INF OEBPS 63 | @$(RMDIR) $(EPUBTRASH) 64 | 65 | ## Install ########################################################### 66 | 67 | install: install-info install-docs 68 | 69 | install-docs: install-info 70 | @$(MKDIR) $(DESTDIR)$(docdir) 71 | $(CP) AUTHORS.md $(DESTDIR)$(docdir) 72 | 73 | install-info: info 74 | @$(MKDIR) $(DESTDIR)$(infodir) 75 | $(CP) $(INFOPAGES) $(DESTDIR)$(infodir) 76 | 77 | ## Clean ############################################################# 78 | 79 | clean: 80 | @printf " Cleaning docs/*...\n" 81 | @$(RMDIR) dir $(INFOPAGES) $(HTMLFILES) $(HTMLDIRS) $(PDFFILES) 82 | @$(RMDIR) $(EPUBFILES) $(EPUBTRASH) 83 | @$(RMDIR) $(GENSTATS_DIR) 84 | 85 | ## Release management ################################################ 86 | 87 | ORG_ARGS = --batch -Q $(ORG_LOAD_PATH) -l ol-man 88 | ORG_EVAL += --eval "(progn $$ORG_MAN_EXPORT)" 89 | ORG_EVAL += --eval "(setq indent-tabs-mode nil)" 90 | ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)" 91 | ORG_EVAL += --funcall org-texinfo-export-to-texinfo 92 | 93 | texi: 94 | @printf "Generating $(PKG).texi\n" 95 | @$(EMACS) $(ORG_ARGS) $(PKG).org $(ORG_EVAL) 96 | @printf "\n" >> $(PKG).texi 97 | @rm -f $(PKG).texi~ 98 | @$(EMACS) $(ORG_ARGS) magit-section.org $(ORG_EVAL) 99 | @printf "\n" >> magit-section.texi 100 | @rm -f magit-section.texi~ 101 | 102 | authors: AUTHORS.md 103 | 104 | AUTHORS.md: 105 | @printf "Generating AUTHORS.md..." 106 | @test -e $(TOP).git \ 107 | && (printf "$$AUTHORS_HEADER\n" > $@ \ 108 | && git log --pretty=format:'- %aN' | sort -u | \ 109 | grep -v dependabot >> $@ \ 110 | && printf "done\n" ; ) \ 111 | || printf "FAILED (non-fatal)\n" 112 | @git commit --gpg-sign -m "AUTHORS.md: Update list of contributors" \ 113 | -o -- $@ ../.mailmap || true 114 | @git show --pretty= -p HEAD 115 | 116 | PUBLISH_PATH ?= /manual/ 117 | RELEASE_PATH ?= /manual/$(VERSION)/ 118 | S3_BUCKET ?= s3://$(DOMAIN) 119 | PUBLISH_TARGET = $(S3_BUCKET)$(PUBLISH_PATH) 120 | RELEASE_TARGET = $(S3_BUCKET)$(RELEASE_PATH) 121 | CFRONT_PATHS = $(PKG).html $(PKG).pdf $(PKG)/* 122 | 123 | comma := , 124 | empty := 125 | space := $(empty) $(empty) 126 | 127 | publish: $(PUBLISH_TARGETS) 128 | @printf "Uploading manuals... $(PUBLISH_TARGETS)\n" 129 | @aws s3 cp $(PKG).html $(PUBLISH_TARGET) 130 | @aws s3 cp $(PKG).pdf $(PUBLISH_TARGET) 131 | @printf "upload: ./$(PKG)/* to $(PUBLISH_TARGET)*\n" 132 | @aws s3 sync --delete $(PKG) $(PUBLISH_TARGET)$(PKG)/ > /dev/null 133 | @aws s3 cp magit-section.html $(PUBLISH_TARGET) 134 | @aws s3 cp magit-section.pdf $(PUBLISH_TARGET) 135 | @printf "upload: ./magit-section/* to $(PUBLISH_TARGET)*\n" 136 | @aws s3 sync --delete magit-section $(PUBLISH_TARGET)magit-section/ > /dev/null 137 | @printf "Generating CDN invalidation\n" 138 | @aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \ 139 | "$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null 140 | 141 | release: $(PUBLISH_TARGETS) 142 | @printf "Uploading release manuals...\n" 143 | @aws s3 cp $(PKG).html $(RELEASE_TARGET) 144 | @aws s3 cp $(PKG).pdf $(RELEASE_TARGET) 145 | @printf "upload: ./$(PKG)/* to $(RELEASE_TARGET)*\n" 146 | @aws s3 sync --delete $(PKG) $(RELEASE_TARGET)$(PKG)/ > /dev/null 147 | @aws s3 cp magit-section.html $(RELEASE_TARGET) 148 | @aws s3 cp magit-section.pdf $(RELEASE_TARGET) 149 | @printf "upload: ./magit-section/* to $(RELEASE_TARGET)*\n" 150 | @aws s3 sync --delete magit-section $(RELEASE_TARGET)magit-section/ > /dev/null 151 | @aws s3 cp $(PUBLISH_TARGET)dir.html $(RELEASE_TARGET)dir.html 152 | @aws s3 cp $(PUBLISH_TARGET)dir/index.html $(RELEASE_TARGET)dir/index.html 153 | @printf "Generating CDN invalidation\n" 154 | @aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \ 155 | "$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null 156 | 157 | # Statistics ######################################################### 158 | 159 | stats: 160 | @printf "Generating statistics\n" 161 | @$(GITSTATS) $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR) 162 | 163 | stats-upload: 164 | @printf "Uploading statistics...\n" 165 | @aws s3 sync $(GITSTATS_DIR) $(S3_BUCKET)/stats/$(PKG) 166 | @printf "Uploaded to $(S3_BUCKET)/stats/$(PKG)\n" 167 | @printf "Generating CDN invalidation\n" 168 | @aws cloudfront create-invalidation \ 169 | --distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null 170 | 171 | # Lisp ############################################################### 172 | 173 | # When making changes here, then also adjust the copy in magit-base.el. 174 | define ORG_MAN_EXPORT 175 | (advice-add 'org-man-export :around 'org-man-export--magit-gitman) 176 | (defun org-man-export--magit-gitman (fn link description format) 177 | (if (and (eq format 'texinfo) ;' 178 | (string-match-p "\\`git" link)) 179 | (replace-regexp-in-string "%s" link " 180 | @ifinfo 181 | @ref{%s,,,gitman,}. 182 | @end ifinfo 183 | @ifhtml 184 | @html 185 | the %s(1) manpage. 186 | @end html 187 | @end ifhtml 188 | @iftex 189 | the %s(1) manpage. 190 | @end iftex 191 | ") 192 | (funcall fn link description format))) 193 | endef 194 | export ORG_MAN_EXPORT 195 | 196 | # Templates ########################################################## 197 | 198 | define AUTHORS_HEADER 199 | The following people have contributed to Magit. 200 | For statistics see https://magit.vc/stats/magit/authors.html. 201 | 202 | Authors 203 | ------- 204 | 205 | - Marius Vollmer 206 | - Jonas Bernoulli 207 | 208 | Active Maintainers 209 | ------------------ 210 | 211 | - Jonas Bernoulli 212 | - Kyle Meyer 213 | 214 | Former Maintainers 215 | ------------------ 216 | 217 | - Nicolas Dudebout 218 | - Noam Postavsky 219 | - Peter J. Weisberg 220 | - Phil Jackson 221 | - Rémi Vanicat 222 | - Yann Hodique 223 | 224 | All Contributors 225 | ---------------- 226 | 227 | endef 228 | export AUTHORS_HEADER 229 | -------------------------------------------------------------------------------- /docs/AUTHORS.md: -------------------------------------------------------------------------------- 1 | The following people have contributed to Magit. 2 | For statistics see https://magit.vc/stats/magit/authors.html. 3 | 4 | Authors 5 | ------- 6 | 7 | - Marius Vollmer 8 | - Jonas Bernoulli 9 | 10 | Active Maintainers 11 | ------------------ 12 | 13 | - Jonas Bernoulli 14 | - Kyle Meyer 15 | 16 | Former Maintainers 17 | ------------------ 18 | 19 | - Nicolas Dudebout 20 | - Noam Postavsky 21 | - Peter J. Weisberg 22 | - Phil Jackson 23 | - Rémi Vanicat 24 | - Yann Hodique 25 | 26 | All Contributors 27 | ---------------- 28 | 29 | - Aaron Culich 30 | - Aaron L. Zeng 31 | - Aaron Madlon-Kay 32 | - Abdo Roig-Maranges 33 | - Adam Benanti 34 | - Adam Kruszewski 35 | - Adam Porter 36 | - Adam Spiers 37 | - Adeodato Simó 38 | - Ævar Arnfjörð Bjarmason 39 | - Alan Falloon 40 | - Alban Gruin 41 | - Aleksey Uimanov 42 | - Alexander Gramiak 43 | - Alexander Miller 44 | - Alex Branham 45 | - Alex Dunn 46 | - Alexey Voinov 47 | - Alex Kost 48 | - Alex Kreisher 49 | - Alex Ott 50 | - Allen Li 51 | - Andreas Fuchs 52 | - Andreas Liljeqvist 53 | - Andreas Rottmann 54 | - Andrei Chițu 55 | - Andrew Eggenberger 56 | - Andrew Kirkpatrick 57 | - Andrew Psaltis 58 | - Andrew Schwartzmeyer 59 | - Andrey Smirnov 60 | - Andriy Kmit' 61 | - Andy Sawyer 62 | - Angel de Vicente 63 | - Aria Edmonds 64 | - Arialdo Martini 65 | - Arnau Roig Ninerola 66 | - Ashlynn Anderson 67 | - Barak A. Pearlmutter 68 | - Bar Magal 69 | - Bart Bakker 70 | - Basil L. Contovounesios 71 | - Bastian Beischer 72 | - Bastian Beranek 73 | - Benjamin Motz 74 | - Ben North 75 | - Ben Walton 76 | - Ben Zanin 77 | - Bob Uhl 78 | - Boruch Baum 79 | - Bradley Wright 80 | - Brandon W Maister 81 | - Brennan Vincent 82 | - Brian Leung 83 | - Brian Warner 84 | - Bryan Shell 85 | - Buster Copley 86 | - Cameron Chaparro 87 | - Carl Lieberman 88 | - Chillar Anand 89 | - Chris Bernard 90 | - Chris Done 91 | - Chris LaRose 92 | - Chris Moore 93 | - Chris Ring 94 | - Chris Shoemaker 95 | - Christian Dietrich 96 | - Christian Kluge 97 | - Christian Tietze 98 | - Christophe Junke 99 | - Christopher Carlile 100 | - Christopher Monsanto 101 | - Clément Pit-Claudel 102 | - Cornelius Mika 103 | - Craig Andera 104 | - Daanturo 105 | - Dale Hagglund 106 | - Damien Cassou 107 | - Dan Davison 108 | - Dan Erikson 109 | - Daniel Brockman 110 | - Daniel Farina 111 | - Daniel Fleischer 112 | - Daniel Gröber 113 | - Daniel Hackney 114 | - Daniel Kraus 115 | - Daniel Mai 116 | - Daniel Martín 117 | - Daniel Mendler 118 | - Daniel Nagy 119 | - Dan Kessler 120 | - Dan LaManna 121 | - Danny Zhu 122 | - Dato Simó 123 | - David Abrahams 124 | - David Ellison 125 | - David Hull 126 | - David L. Rager 127 | - David Wallin 128 | - Dean Kariniemi 129 | - Dennis Paskorz 130 | - Divye Kapoor 131 | - Dominique Quatravaux 132 | - Duianto Vebotci 133 | - Eli Barzilay 134 | - Ellis Kenyo 135 | - Eric 136 | - Eric Davis 137 | - Eric Prud'hommeaux 138 | - Eric Schulte 139 | - Erik Anderson 140 | - Eugene Mikhaylov 141 | - Evan Torrie 142 | - Evgkeni Sampelnikof 143 | - Eyal Lotem 144 | - Eyal Soha 145 | - Fabian Wiget 146 | - Felix Geller 147 | - Felix Yan 148 | - Feng Li 149 | - Florian Ragwitz 150 | - Franklin Delehelle 151 | - Frédéric Giquel 152 | - Fritz Grabo 153 | - Fritz Stelzer 154 | - Geoff Shannon 155 | - George Kadianakis 156 | - Géza Herman 157 | - Graham Clark 158 | - Graham Dobbins 159 | - Greg A. Woods 160 | - Greg Lucas 161 | - Gregory Heytings 162 | - Greg Sexton 163 | - Greg Steuck 164 | - Guillaume Martres 165 | - Hannu Koivisto 166 | - Hans-Peter Deifel 167 | - hokomo 168 | - Hussein Ait-Lahcen 169 | - Ian Eure 170 | - Ian Milligan 171 | - Ilya Grigoriev 172 | - Ingmar Sittl 173 | - Ingo Lohmar 174 | - Ioan-Adrian Ratiu 175 | - Ivan Brennan 176 | - Jan Tatarik 177 | - Jasper St. Pierre 178 | - Jean-Louis Giordano 179 | - Jeff Bellegarde 180 | - Jeff Dairiki 181 | - Jeremy Meng 182 | - Jesse Alama 183 | - Jim Blandy 184 | - Joakim Jalap 185 | - Johannes Altmanninger 186 | - Johannes Maier 187 | - Johann Klähn 188 | - John Mastro 189 | - John Morris 190 | - John Wiegley 191 | - Jonas Bernoulli 192 | - Jonas Galvão Xavier 193 | - Jonathan Arnett 194 | - Jonathan del Strother 195 | - Jonathan Leech-Pepin 196 | - Jonathan Roes 197 | - Jonathon McKitrick 198 | - Jon Vanderwijk 199 | - Jordan Galby 200 | - Jordan Greenberg 201 | - Jorge Israel Peña 202 | - Josh Elsasser 203 | - Josiah Schwab 204 | - Julien Danjou 205 | - Justin Burkett 206 | - Justin Caratzas 207 | - Justin Guenther 208 | - Justin Thomas 209 | - Kan-Ru Chen 210 | - Kenny Ballou 211 | - Keshav Kini 212 | - Kevin Brubeck Unhammer 213 | - Kevin J. Foley 214 | - Kévin Le Gouguec 215 | - Kimberly Wolk 216 | - Knut Olav Bøhmer 217 | - Kyle Meyer 218 | - Laurent Laffont 219 | - Laverne Schrock 220 | - Leandro Facchinetti 221 | - Lele Gaifax 222 | - Lénaïc Huard 223 | - Leo Liu 224 | - Leonardo Etcheverry 225 | - Leo Vivier 226 | - Li Chen 227 | - Lingchao Xin 228 | - Lin Sun 229 | - Li-Yun Chang 230 | - Lluís Vilanova 231 | - Loic Dachary 232 | - Louis Roché 233 | - Luís Oliveira 234 | - Luke Amdor 235 | - Magnus Malm 236 | - Mak Kolybabi 237 | - Manuel Vázquez Acosta 238 | - Marcel Wolf 239 | - Marc Herbert 240 | - Marcin Bachry 241 | - Marco Craveiro 242 | - Marco Wahl 243 | - Marc Sherry 244 | - Marian Schubert 245 | - Mario Rodas 246 | - Marius Vollmer 247 | - Mark Hepburn 248 | - Mark Karpov 249 | - Mark Oteiza 250 | - Markus Beppler 251 | - Martin Joerg 252 | - Martin Polden 253 | - Matthew Fluet 254 | - Matthew Kraai 255 | - Matthieu Hauglustaine 256 | - Matus Goljer 257 | - Maxim Cournoyer 258 | - Michael Fogleman 259 | - Michael Griffiths 260 | - Michael Heerdegen 261 | - Michal Sojka 262 | - Miciah Masters 263 | - Miles Bader 264 | - Miloš Mošić 265 | - Mitchel Humpherys 266 | - Moritz Bunkus 267 | - Nacho Barrientos 268 | - Naoya Yamashita 269 | - Natalie Weizenbaum 270 | - Nguyễn Tuấn Anh 271 | - Nic Ferier 272 | - Nicholas Vollmer 273 | - Nick Alcock 274 | - Nick Alexander 275 | - Nick Dimiduk 276 | - Nicklas Lindgren 277 | - Nicolas Dudebout 278 | - Nicolas Petton 279 | - Nicolas Richard 280 | - Nikolay Martynov 281 | - Noam Postavsky 282 | - N. Troy de Freitas 283 | - Ola x Nilsson 284 | - Ole Arndt 285 | - Oleh Krehel 286 | - Orivej Desh 287 | - Óscar Fuentes 288 | - Pancho Horrillo 289 | - Paul Stadig 290 | - Pavel Holejsovsky 291 | - Pekka Pessi 292 | - Peter Eisentraut 293 | - Peter Jaros 294 | - Peter J. Weisberg 295 | - Peter Vasil 296 | - Philippe Cavalaria 297 | - Philippe Vaucher 298 | - Philipp Fehre 299 | - Philipp Haselwarter 300 | - Philipp Stephani 301 | - Philip Weaver 302 | - Phil Jackson 303 | - Phil Sainty 304 | - Pierre Neidhardt 305 | - Pieter Praet 306 | - Prathamesh Sonpatki 307 | - Pritam Baral 308 | - rabio 309 | - Radon Rosborough 310 | - Rafael Laboissiere 311 | - Rahul Rameshbabu 312 | - Raimon Grau 313 | - Ramkumar Ramachandra 314 | - Remco van 't Veer 315 | - Rémi Vanicat 316 | - René Stadler 317 | - Richard Kim 318 | - Robert Boone 319 | - Robert Irelan 320 | - Robin Green 321 | - Roey Darwish Dror 322 | - Roger Crew 323 | - Romain Francoise 324 | - Ron Parker 325 | - Roy Crihfield 326 | - Rüdiger Sonderfeld 327 | - Russell Black 328 | - Ryan C. Thompson 329 | - Sam Cedarbaum 330 | - Samuel Bronson 331 | - Samuel W. Flint 332 | - Sanjoy Das 333 | - Sean Allred 334 | - Sean Bryant 335 | - Sean Farley 336 | - Sean Whitton 337 | - Sebastian Wiesner 338 | - Sébastien Gross 339 | - Seong-Kook Shin 340 | - Sergey Pashinin 341 | - Sergey Vinokurov 342 | - Servilio Afre Puentes 343 | - shoefone 344 | - Shuguang Sun 345 | - Siavash Askari Nasr 346 | - Silent Sphere 347 | - Simon Pintarelli 348 | - Stefan Kangas 349 | - Štěpán Němec 350 | - Steven Chow 351 | - Steven E. Harris 352 | - Steven Thomas 353 | - Steven Vancoillie 354 | - Steve Purcell 355 | - Suhail Shergill 356 | - Sylvain Rousseau 357 | - Syohei Yoshida 358 | - Szunti 359 | - Takafumi Arakaki 360 | - Tassilo Horn 361 | - TEC 362 | - Teemu Likonen 363 | - Teruki Shigitani 364 | - Thierry Volpiatto 365 | - Thomas A Caswell 366 | - Thomas Fini Hansen 367 | - Thomas Frössman 368 | - Thomas Jost 369 | - Thomas Riccardi 370 | - Tibor Simko 371 | - Timo Juhani Lindfors 372 | - Tim Perkins 373 | - Tim Wraight 374 | - Ting-Yu Lin 375 | - Tom Feist 376 | - Toon Claes 377 | - Topi Miettinen 378 | - Troy Hinckley 379 | - Tsuyoshi Kitamoto 380 | - Tunc Uzlu 381 | - Ulrich Müller 382 | - Vineet Naik 383 | - Vitaly Ostashov 384 | - Vladimir Ivanov 385 | - Vladimir Panteleev 386 | - Vladimir Sedach 387 | - Waqar Hameed 388 | - Wei Huang 389 | - Wilfred Hughes 390 | - Win Treese 391 | - Wojciech Siewierski 392 | - Wouter Bolsterlee 393 | - Xavier Noria 394 | - Xu Chunyang 395 | - Yann Herklotz 396 | - Yann Hodique 397 | - Ynilu 398 | - York Zhao 399 | - Yuichi Higashi 400 | - Yuri Khan 401 | - Zach Latta 402 | - zakora 403 | - Zhu Zihao 404 | - ziggy 405 | - zilongshanren 406 | -------------------------------------------------------------------------------- /default.mk: -------------------------------------------------------------------------------- 1 | TOP := $(dir $(lastword $(MAKEFILE_LIST))) 2 | 3 | ## User options ###################################################### 4 | # 5 | # You can override these settings in "config.mk" or on the command 6 | # line. 7 | # 8 | # You might also want to set LOAD_PATH. If you do, then it must 9 | # contain "-L .". 10 | # 11 | # If you don't do so, then the default is set in the "Load-Path" 12 | # section below. The default assumes that all dependencies are 13 | # installed either at "../", or when using package.el 14 | # at "ELPA_DIR/-". 15 | 16 | PREFIX ?= /usr/local 17 | sharedir ?= $(PREFIX)/share 18 | lispdir ?= $(sharedir)/emacs/site-lisp/magit 19 | infodir ?= $(sharedir)/info 20 | docdir ?= $(sharedir)/doc/magit 21 | 22 | CP ?= install -p -m 644 23 | MKDIR ?= install -p -m 755 -d 24 | RMDIR ?= rm -rf 25 | TAR ?= tar 26 | SED ?= sed 27 | 28 | EMACS ?= emacs 29 | EMACS_ARGS ?= 30 | BATCH = $(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) 31 | 32 | LISP_EXTRA_TARGETS ?= check-declare 33 | 34 | INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info) 35 | MAKEINFO ?= makeinfo 36 | MANUAL_HTML_ARGS ?= --css-ref /assets/page.css 37 | 38 | GITSTATS ?= gitstats 39 | GITSTATS_DIR ?= $(TOP)docs/stats 40 | GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999 41 | 42 | BUILD_MAGIT_LIBGIT ?= false 43 | 44 | ## Files ############################################################# 45 | 46 | PKG = magit 47 | PACKAGES = magit magit-section git-commit 48 | 49 | TEXIPAGES = $(addsuffix .texi,$(filter-out git-commit,$(PACKAGES))) 50 | INFOPAGES = $(addsuffix .info,$(filter-out git-commit,$(PACKAGES))) 51 | HTMLFILES = $(addsuffix .html,$(filter-out git-commit,$(PACKAGES))) 52 | HTMLDIRS = $(filter-out git-commit,$(PACKAGES)) 53 | PDFFILES = $(addsuffix .pdf,$(filter-out git-commit,$(PACKAGES))) 54 | EPUBFILES = $(addsuffix .epub,$(filter-out git-commit,$(PACKAGES))) 55 | 56 | ELS = git-commit.el 57 | ELS += magit-section.el 58 | ELS += magit-base.el 59 | ifeq "$(BUILD_MAGIT_LIBGIT)" "true" 60 | ELS += magit-libgit.el 61 | endif 62 | ELS += magit-git.el 63 | ELS += magit-mode.el 64 | ELS += magit-margin.el 65 | ELS += magit-process.el 66 | ELS += magit-transient.el 67 | ELS += magit-autorevert.el 68 | ELS += magit-core.el 69 | ELS += magit-diff.el 70 | ELS += magit-log.el 71 | ELS += magit-wip.el 72 | ELS += magit-reflog.el 73 | ELS += magit-apply.el 74 | ELS += magit-repos.el 75 | ELS += magit.el 76 | ELS += magit-status.el 77 | ELS += magit-refs.el 78 | ELS += magit-files.el 79 | ELS += magit-reset.el 80 | ELS += magit-branch.el 81 | ELS += magit-merge.el 82 | ELS += magit-tag.el 83 | ELS += magit-worktree.el 84 | ELS += magit-notes.el 85 | ELS += magit-sequence.el 86 | ELS += magit-commit.el 87 | ELS += magit-remote.el 88 | ELS += magit-clone.el 89 | ELS += magit-fetch.el 90 | ELS += magit-pull.el 91 | ELS += magit-push.el 92 | ELS += magit-patch.el 93 | ELS += magit-bisect.el 94 | ELS += magit-stash.el 95 | ELS += magit-blame.el 96 | ELS += magit-sparse-checkout.el 97 | ELS += magit-submodule.el 98 | ELS += magit-subtree.el 99 | ELS += magit-ediff.el 100 | ELS += magit-gitignore.el 101 | ELS += magit-bundle.el 102 | ELS += magit-extras.el 103 | ELS += git-rebase.el 104 | ELS += magit-bookmark.el 105 | ELCS = $(ELS:.el=.elc) 106 | ELMS = magit.el $(filter-out $(addsuffix .el,$(PACKAGES)),$(ELS)) 107 | ELGS = magit-autoloads.el magit-version.el 108 | 109 | ## Versions ########################################################## 110 | 111 | VERSION ?= $(shell \ 112 | test -e $(TOP).git && \ 113 | git describe --tags --abbrev=0 --always | cut -c2-) 114 | # TODO Deal with the fact that timestamps are no longer in sync. 115 | TIMESTAMP = 20230101 116 | 117 | COMPAT_VERSION = 29.1.3.4 118 | DASH_VERSION = 2.19.1 119 | GIT_COMMIT_VERSION = $(VERSION) 120 | LIBGIT_VERSION = 0 121 | MAGIT_VERSION = $(VERSION) 122 | MAGIT_LIBGIT_VERSION = $(VERSION) 123 | MAGIT_SECTION_VERSION = $(VERSION) 124 | SEQ_VERSION = 2.24 125 | TRANSIENT_VERSION = 0.3.6 126 | WITH_EDITOR_VERSION = 3.0.5 127 | 128 | COMPAT_SNAPSHOT = 29.1.3.4 129 | DASH_MELPA_SNAPSHOT = 20221013 130 | GIT_COMMIT_MELPA_SNAPSHOT = $(TIMESTAMP) 131 | LIBGIT_MELPA_SNAPSHOT = 0 132 | MAGIT_MELPA_SNAPSHOT = $(TIMESTAMP) 133 | MAGIT_LIBGIT_MELPA_SNAPSHOT = $(TIMESTAMP) 134 | MAGIT_SECTION_MELPA_SNAPSHOT = $(TIMESTAMP) 135 | SEQ_MELPA_SNAPSHOT = $(SEQ_VERSION) 136 | TRANSIENT_MELPA_SNAPSHOT = 20230201 137 | WITH_EDITOR_MELPA_SNAPSHOT = 20230118 138 | 139 | DEV_VERSION_SUFFIX = .50-git 140 | 141 | EMACS_VERSION = 25.1 142 | LIBGIT_EMACS_VERSION = 26.1 143 | 144 | EMACSOLD := $(shell $(BATCH) --eval \ 145 | "(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))") 146 | ifeq "$(EMACSOLD)" "true" 147 | $(error At least version $(EMACS_VERSION) of Emacs is required) 148 | endif 149 | 150 | ## Load-Path ######################################################### 151 | 152 | # Remember to also update magit-emacs-Q-command! 153 | 154 | ifndef LOAD_PATH 155 | 156 | USER_EMACS_DIR = $(HOME)/.emacs.d 157 | ifeq "$(wildcard $(USER_EMACS_DIR))" "" 158 | XDG_CONFIG_DIR = $(or $(XDG_CONFIG_HOME),$(HOME)/.config) 159 | ifneq "$(wildcard $(XDG_CONFIG_DIR)/emacs)" "" 160 | USER_EMACS_DIR = $(XDG_CONFIG_DIR)/emacs 161 | endif 162 | endif 163 | 164 | ELPA_DIR ?= $(USER_EMACS_DIR)/elpa 165 | 166 | COMPAT_DIR ?= $(shell \ 167 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/compat-[.0-9]*' 2> /dev/null | \ 168 | sort | tail -n 1) 169 | ifeq "$(COMPAT_DIR)" "" 170 | COMPAT_DIR = $(TOP)../compat 171 | endif 172 | 173 | DASH_DIR ?= $(shell \ 174 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/dash-[.0-9]*' 2> /dev/null | \ 175 | sort | tail -n 1) 176 | ifeq "$(DASH_DIR)" "" 177 | DASH_DIR = $(TOP)../dash 178 | endif 179 | 180 | LIBGIT_DIR ?= $(shell \ 181 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/libgit-[.0-9]*' 2> /dev/null | \ 182 | sort | tail -n 1) 183 | ifeq "$(LIBGIT_DIR)" "" 184 | LIBGIT_DIR = $(TOP)../libgit 185 | endif 186 | 187 | SEQ_DIR ?= $(shell \ 188 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/seq-[.0-9]*' 2> /dev/null | \ 189 | sort | tail -n 1) 190 | ifeq "$(SEQ_DIR)" "" 191 | SEQ_DIR = $(TOP)../seq 192 | endif 193 | 194 | TRANSIENT_DIR ?= $(shell \ 195 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/transient-[.0-9]*' 2> /dev/null | \ 196 | sort | tail -n 1) 197 | ifeq "$(TRANSIENT_DIR)" "" 198 | TRANSIENT_DIR = $(TOP)../transient/lisp 199 | endif 200 | 201 | WITH_EDITOR_DIR ?= $(shell \ 202 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/with-editor-[.0-9]*' 2> /dev/null | \ 203 | sort | tail -n 1) 204 | ifeq "$(WITH_EDITOR_DIR)" "" 205 | WITH_EDITOR_DIR = $(TOP)../with-editor/lisp 206 | endif 207 | 208 | MAGIT_SECTION_DIR ?= $(shell \ 209 | find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/magit-section-[.0-9]*' 2> /dev/null | \ 210 | sort | tail -n 1) 211 | 212 | SYSTYPE := $(shell $(EMACS) -Q --batch --eval "(princ system-type)") 213 | ifeq ($(SYSTYPE), windows-nt) 214 | CYGPATH := $(shell cygpath --version 2>/dev/null) 215 | endif 216 | 217 | LOAD_PATH = -L $(TOP)lisp 218 | 219 | # When making changes here, then don't forget to adjust "Makefile", 220 | # ".github/workflows/test.yml", ".github/ISSUE_TEMPLATE/bug_report.md", 221 | # `magit-emacs-Q-command' and the "Installing from the Git Repository" 222 | # info node accordingly. Also don't forget to "rgrep \b\b". 223 | 224 | ifdef CYGPATH 225 | LOAD_PATH += -L $(shell cygpath --mixed $(COMPAT_DIR)) 226 | LOAD_PATH += -L $(shell cygpath --mixed $(DASH_DIR)) 227 | LOAD_PATH += -L $(shell cygpath --mixed $(LIBGIT_DIR)) 228 | LOAD_PATH += -L $(shell cygpath --mixed $(SEQ_DIR)) 229 | LOAD_PATH += -L $(shell cygpath --mixed $(TRANSIENT_DIR)) 230 | LOAD_PATH += -L $(shell cygpath --mixed $(WITH_EDITOR_DIR)) 231 | ifneq "$(MAGIT_SECTION_DIR)" "" 232 | LOAD_PATH += -L $(shell cygpath --mixed $(MAGIT_SECTION_DIR)) 233 | endif 234 | else 235 | LOAD_PATH += -L $(COMPAT_DIR) 236 | LOAD_PATH += -L $(DASH_DIR) 237 | LOAD_PATH += -L $(LIBGIT_DIR) 238 | LOAD_PATH += -L $(SEQ_DIR) 239 | LOAD_PATH += -L $(TRANSIENT_DIR) 240 | LOAD_PATH += -L $(WITH_EDITOR_DIR) 241 | ifneq "$(MAGIT_SECTION_DIR)" "" 242 | LOAD_PATH += -L $(MAGIT_SECTION_DIR) 243 | endif 244 | endif 245 | 246 | endif # ifndef LOAD_PATH 247 | 248 | ifndef ORG_LOAD_PATH 249 | ORG_LOAD_PATH = -L ../../org/lisp 250 | endif 251 | 252 | ## Dependencies ###################################################### 253 | 254 | # This isn't used by make, but is needed for the Compile ci workflow. 255 | 256 | DEPS = compat 257 | DEPS += dash 258 | DEPS += seq 259 | DEPS += transient/lisp 260 | DEPS += vterm 261 | DEPS += with-editor/lisp 262 | 263 | ## Publish ########################################################### 264 | 265 | DOMAIN ?= magit.vc 266 | CFRONT_DIST ?= E2LUHBKU1FBV02 267 | 268 | PUBLISH_TARGETS ?= html html-dir pdf 269 | 270 | DOCBOOK_XSL ?= /usr/share/xml/docbook/stylesheet/docbook-xsl/epub/docbook.xsl 271 | 272 | EPUBTRASH = epub.xml META-INF OEBPS 273 | --------------------------------------------------------------------------------