...
 
Commits (396)
((nil
(bug-reference-bug-regexp . "#\\(?2:[0-9]+\\)")
(bug-reference-url-format . "https://github.com/magit/magit/issues/%s"))
(emacs-lisp-mode
(eval . (bug-reference-mode 1))
(indent-tabs-mode . nil))
(makefile-gmake-mode
(outline-regexp . "##")))
(outline-regexp . "##"))
(git-commit-mode
(git-commit-major-mode . git-commit-elisp-text-mode)))
../Documentation/CONTRIBUTING.md
\ No newline at end of file
Reporting issues and suggesting features
========================================
To report bugs and suggest new feature use the [issue tracker][issues].
Code contributions
==================
If you have some code which you would like to be merged, then open a
[pull request][pulls]. Please create atomic commits with descriptive
commit messages and use a dedicated feature branch (`b s` might help
with the latter).
Documentation contributions
===========================
Improving the documentation is always a good way to get started
contributing to some project.
In the case of Magit this is somewhat complicated by the fact that
we use some custom extensions. Some meta documentation can be found
[here][metadocs].
TL;DR — Edit `magit.org`. Do not edit `magit.texi`. And don't touch
the version numbers. The maintainers will then update `magit.texi`
and the version numbers in `magit.org` and amend those changes to your
commit.
Donations
=========
Please also consider to contribute by making a
[monetary donation][donations].
[donations]: https://magit.vc/donate/
[issues]: https://github.com/magit/magit/issues
[metadocs]: https://github.com/magit/magit/wiki/Documentation-tools-and-conventions
[pulls]: https://github.com/magit/magit/pulls
../Documentation/ISSUE_TEMPLATE
\ No newline at end of file
=================================================================
DO NOT use this issue tracker for support requests
=================================================================
Please use the Emacs StackExchange site [1] for support requests. But before you do that please read the list of frequently asked questions [2] and consult the manual [3] and a search engine.
We only use this issue tracker for feature requests and for defects.
[1]: https://emacs.stackexchange.com
[2]: https://magit.vc/manual/magit/FAQ.html
[3]: https://magit.vc/manual/magit/#Top
=================================================================
How to ask for a new feature and other improvements
=================================================================
Before you ask for a new feature to be added to Magit or for an existing feature to be improved, please make sure that what are asking for does not already exist by consulting the documentation [5].
Then explain the feature you would like to see in Magit and why that is useful to you.
[5]: https://magit.vc/manual/magit/#Top
=================================================================
How to report defects
=================================================================
---
name: Bug report
about: Report a defect
---
Please explain
(1) what behavior you expected
......
---
name: Feature request
about: Suggest a new feature
---
Before you ask for a new feature to be added to Magit or for an existing feature to be improved, please make sure that what are asking for does not already exist by consulting the documentation [1].
Before you ask for a new argument to be added to some popup, see this [2] page.
Then describe the feature you would like to see in Magit and why it would be useful to you. You might also want to describe any alternative solutions or features you've considered.
[1]: https://magit.vc/manual/magit/#Top
[2]: https://github.com/magit/magit/wiki/Additional-proposed-infix-arguments-and-suffix-commands
---- now delete this line and everything above ----
---
name: Support request
about: Do NOT open support requests here
---
DO NOT use this issue tracker for support requests.
Please use the Emacs StackExchange site [1] or Emacs subreddit [2] for support requests.
But before you do that please read the list of frequently asked questions [3] and consult the manual [4] and a search engine.
We only use this issue tracker for feature requests and bug reports.
[1]: https://emacs.stackexchange.com
[2]: https://www.reddit.com/r/emacs
[3]: https://magit.vc/manual/magit/FAQ.html
[4]: https://magit.vc/manual/magit/#Top
../Documentation/PULL_REQUEST_TEMPLATE
\ No newline at end of file
=================================================================
Use a dedicated feature branch
=================================================================
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.
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.
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.
[1]: https://github.com/magit/magit/wiki/Dedicated-pull-request-branches
=================================================================
Do NOT use Github to edit files and create commit messages
=================================================================
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 <noreply@github.com>" being used as the committer. The last one cannot even be avoided, which I consider as an affront.
Github is an insufficient interface for editing files and creating commits. Please don't do it when contributing to Magit.
=================================================================
What you should write here
=================================================================
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.
=================================================================
How to update the manual
=================================================================
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.
[2]: https://github.com/magit/magit/wiki/Documentation-tools-and-conventions
......@@ -2,12 +2,16 @@
*~
/*.tar
/*.tar.gz
/Documentation/*.epub
/Documentation/*.html
/Documentation/*.info
/Documentation/*.pdf
/Documentation/META-INF/
/Documentation/OEBPS/
/Documentation/dir
/Documentation/epub.xml
/Documentation/magit/
/Documentation/magit-popup/
/Documentation/mimetype
/Documentation/stats/
/config.mk
/lisp/magit-autoloads.el
......
......@@ -2,6 +2,7 @@ Alex Dunn <adunn@ucsb.edu> <dunn.alex@gmail.com>
Alex Ott <alexott@gmail.com> <ott@flash.lan>
Andriy Kmit' <dev@madand.net>
Bar Magal <bmagamb@gmail.com>
Benjamin Motz <benjamin.motz@mailbox.org> <Benjamin.Motz@3ds.com>
Bradley Wright <brad@intranation.com> <bradley.wright@digital.cabinet-office.gov.uk>
Buster Copley <buster@buster.me.uk>
Chillar Anand <anand21nanda@gmail.com>
......@@ -35,6 +36,7 @@ Marius Vollmer <marius.vollmer@gmail.com> <mvo@bright.(none)>
Marius Vollmer <marius.vollmer@gmail.com> <mvo@esdhcp03984.research.nokia.com>
Marius Vollmer <marius.vollmer@gmail.com> <mvo@manamana.(none)>
Mark Karpov <markkarpov@opmbx.org>
N. Troy de Freitas <me@ntdef.com> <9503857+ntdef@users.noreply.github.com>
Natalie Weizenbaum <nex342@gmail.com> Nathan Weizenbaum
Noam Postavsky <npostavs@users.sourceforge.net>
Noam Postavsky <npostavs@users.sourceforge.net> <github.10.npostavs@spamgourmet.com>
......
......@@ -3,27 +3,29 @@ language: generic
env:
global:
- CURL="curl -fsSkL --retry 9 --retry-delay 9"
- GHRAW="https://raw.githubusercontent.com"
matrix:
- EMACS_VERSION=24.4
- EMACS_VERSION=24.5
- EMACS_VERSION=25.1
# 25.2 is identical to 25.3 except for a critical security bug in
# enriched text mode (see Emacs Bug#28350).
- EMACS_VERSION=25.3
- EMACS_VERSION=26 # emacs-26 branch, built daily
- EMACS_VERSION=master # master branch, built daily
- EMACS_VERSION=25.1
# 25.2 is identical to 25.3 except for a critical security bug in
# enriched text mode (see Emacs Bug#28350).
- EMACS_VERSION=25.3
- EMACS_VERSION=26.1
- EMACS_VERSION=26 # 26.1.50, emacs-26 branch, built daily
- EMACS_VERSION=master # 27.0.50, master branch, built daily
allow_failures:
- env: EMACS_VERSION=master
install:
- $CURL -O https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
- tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
- export EMACS=/tmp/emacs/bin/emacs
- $CURL -O https://raw.githubusercontent.com/magnars/dash.el/master/dash.el
- $CURL -O https://raw.githubusercontent.com/tarsius/ghub/master/ghub.el
- $CURL -o let-alist.el https://elpa.gnu.org/packages/let-alist-1.0.5.el
- $CURL -O https://raw.githubusercontent.com/magit/magit-popup/master/magit-popup.el
- $CURL -O https://raw.githubusercontent.com/magit/with-editor/master/with-editor.el
- $EMACS -Q --batch -L . -f batch-byte-compile dash.el ghub.el let-alist.el magit-popup.el with-editor.el
- $CURL -O ${GHRAW}/magnars/dash.el/master/dash.el
- $CURL -O ${GHRAW}/magit/ghub/master/ghub.el
- $CURL -O ${GHRAW}/magit/ghub/master/ghub-graphql.el
- $CURL -O ${GHRAW}/vermiculus/graphql.el/master/graphql.el
- $CURL -O ${GHRAW}/magit/magit-popup/master/magit-popup.el
- $CURL -O ${GHRAW}/volrath/treepy.el/master/treepy.el
- $CURL -O ${GHRAW}/magit/with-editor/master/with-editor.el
- $EMACS -Q --batch -L . -f batch-byte-compile dash.el ghub.el ghub-graphql.el graphql.el magit-popup.el treepy.el with-editor.el
- $EMACS --version
script:
- git config --global user.name "A U Thor"
......
......@@ -65,13 +65,17 @@ Contributors
- Andrey Smirnov <andrew.smirnov@gmail.com>
- Andriy Kmit' <dev@madand.net>
- Andy Sawyer <git@pureabstract.org>
- Aria Edmonds <aria@ar1as.space>
- Arialdo Martini <arialdomartini@gmail.com>
- Barak A. Pearlmutter <barak+git@pearlmutter.net>
- Bar Magal <bmagamb@gmail.com>
- Bart Bakker <bart@thesoftwarecraft.com>
- Basil L. Contovounesios <contovob@tcd.ie>
- Bastian Beischer <beischer@physik.rwth-aachen.de>
- Benjamin Motz <benjamin.motz@mailbox.org>
- Ben North <ben@redfrontdoor.org>
- Ben Walton <bwalton@artsci.utoronto.ca>
- Bob Uhl <buhl@zvelo.com>
- Bradley Wright <brad@intranation.com>
- Brandon W Maister <quodlibetor@gmail.com>
- Brian Warner <warner@lothar.com>
......@@ -114,12 +118,14 @@ Contributors
- Duianto Vebotci <vebotci@openmailbox.org>
- Eli Barzilay <eli@barzilay.org>
- Eric Davis <ed@npri.org>
- Eric Prud'hommeaux <eric@w3.org>
- Eric Schulte <schulte.eric@gmail.com>
- Erik Anderson <erikbpanderson@gmail.com>
- Evgkeni Sampelnikof <esabof@gmail.com>
- Eyal Lotem <eyal.lotem@gmail.com>
- Fabian Wiget <fabacino@gmail.com>
- Felix Geller <fgeller@gmail.com>
- Felix Yan <felixonmars@archlinux.org>
- Feng Li <fengli@blackmagicdesign.com>
- Florian Ragwitz <rafl@debian.org>
- Fritz Grabo <fritz.grabo@gmail.com>
......@@ -153,6 +159,7 @@ Contributors
- Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
- Jonathan Roes <jroes@jroes.net>
- Jon Vanderwijk <jonathn@github.com>
- Jordan Galby <gravemind2a@gmail.com>
- Jordan Greenberg <jordan@softwareslave.com>
- Josiah Schwab <jschwab@gmail.com>
- Julien Danjou <julien@danjou.info>
......@@ -176,8 +183,10 @@ Contributors
- Li-Yun Chang <michael142536@gmail.com>
- Lluís Vilanova <vilanova@ac.upc.edu>
- Loic Dachary <loic@dachary.org>
- Louis Roché <louis@louisroche.net>
- Luís Oliveira <luismbo@gmail.com>
- Luke Amdor <luke.amdor@gmail.com>
- Mak Kolybabi <mak@kolybabi.com>
- Manuel Vázquez Acosta <mva.led@gmail.com>
- Marcel Wolf <mwolf@ml1.net>
- Marc Herbert <marc.herbert@gmail.com>
......@@ -198,6 +207,7 @@ Contributors
- Michael Griffiths <mikey@cich.li>
- Michael Heerdegen <michael_heerdegen@web.de>
- Michal Sojka <sojkam1@fel.cvut.cz>
- Miciah Masters <miciah.masters@gmail.com>
- Miles Bader <miles@gnu.org>
- Miloš Mošić <mosic.milos@gmail.com>
- Mitchel Humpherys <mitch.special@gmail.com>
......@@ -214,6 +224,7 @@ Contributors
- Nicolas Richard <theonewiththeevillook@yahoo.fr>
- Nikolay Martynov <mar.kolya@gmail.com>
- Noam Postavsky <npostavs@users.sourceforge.net>
- N. Troy de Freitas <me@ntdef.com>
- Ole Arndt <oliver.arndt@cegedim.com>
- Oleh Krehel <ohwoeowho@gmail.com>
- Orivej Desh <orivej@gmx.fr>
......@@ -231,6 +242,7 @@ Contributors
- Philip Weaver <philip.weaver@gmail.com>
- Phil Jackson <phil@shellarchive.co.uk>
- Phil Sainty <phil@catalyst.net.nz>
- Pierre Neidhardt <ambrevar@gmail.com>
- Pieter Praet <pieter@praet.org>
- Prathamesh Sonpatki <csonpatki@gmail.com>
- rabio <rabiodev@o2.pl>
......
Reporting issues and suggesting features
========================================
To report bugs and suggest new feature use the [issue tracker][issues].
Code contributions
==================
If you have some code which you would like to be merged, then open a
[pull request][pulls]. Please create atomic commits with descriptive
commit messages and use a dedicated feature branch (`b s` might help
with the latter).
Documentation contributions
===========================
Improving the documentation is always a good way to get started
contributing to some project.
In the case of Magit this is somewhat complicated by the fact that
we use some custom extensions. Some meta documentation can be found
[here][metadocs].
TL;DR — Edit `magit.org`. Do not edit `magit.texi`. And don't touch
the version numbers. The maintainers will then update `magit.texi`
and the version numbers in `magit.org` and amend those changes to your
commit.
Donations
=========
Please also consider to contribute by making a
[monetary donation][donations].
[donations]: https://magit.vc/donate/
[issues]: https://github.com/magit/magit/issues
[metadocs]: https://github.com/magit/magit/wiki/Documentation-tools-and-conventions
[pulls]: https://github.com/magit/magit/pulls
......@@ -12,6 +12,7 @@ all: info
info: $(INFOPAGES) dir
html: $(HTMLFILES)
pdf: $(PDFFILES)
epub: $(EPUBFILES)
%.info: %.texi
@printf "Generating $@\n"
......@@ -46,6 +47,15 @@ html-dir: $(TEXIFILES)
@printf "Generating $@\n"
@texi2pdf --clean $< > /dev/null
%.epub: %.texi
@printf "Generating $@\n"
@makeinfo --docbook $< -o epub.xml
@xsltproc $(DOCBOOK_XSL) epub.xml 2> /dev/null
@echo "application/epub+zip" > mimetype
@zip -X --quiet --recurse-paths -0 $@ mimetype
@zip -X --quiet --recurse-paths -9 --no-dir-entries $@ META-INF OEBPS
@$(RMDIR) $(EPUBTRASH)
## Install ###########################################################
install: install-info install-docs
......@@ -63,6 +73,7 @@ install-info: info
clean:
@printf "Cleaning Documentation/*...\n"
@$(RMDIR) dir $(INFOPAGES) $(HTMLFILES) $(HTMLDIRS) $(PDFFILES)
@$(RMDIR) $(EPUBFILES) $(EPUBTRASH)
## Release management ################################################
......@@ -122,18 +133,24 @@ publish-stats: stats
@aws cloudfront create-invalidation \
--distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null
publish-manuals: html html-dir pdf
publish-manuals: $(PUBLISH_TARGETS)
@printf "Uploading manuals... $(PUBLISH_TARGETS)\n"
@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
@aws s3 cp $(PKG).pdf $(PUBLISH_TARGET)
@aws s3 sync --delete $(PKG) $(PUBLISH_TARGET)$(PKG)/
@aws s3 cp $(PKG).epub $(PUBLISH_TARGET)
@printf "upload: ./$(PKG)/* to $(PUBLISH_TARGET)*\n"
@aws s3 sync --delete $(PKG) $(PUBLISH_TARGET)$(PKG)/ > /dev/null
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null
release-manuals: html html-dir pdf
release-manuals: $(PUBLISH_TARGETS)
@printf "Uploading release manuals...\n"
@aws s3 cp $(PKG).html $(RELEASE_TARGET)
@aws s3 cp $(PKG).pdf $(RELEASE_TARGET)
@aws s3 sync --delete $(PKG) $(RELEASE_TARGET)$(PKG)/
@aws s3 cp $(PKG).epub $(RELEASE_TARGET)
@printf "upload: ./$(PKG)/* to $(RELEASE_TARGET)*\n"
@aws s3 sync --delete $(PKG) $(RELEASE_TARGET)$(PKG)/ > /dev/null
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
......
=================================================================
What you should write here
=================================================================
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.
=================================================================
How to update the manual
=================================================================
If you make changes to the manual, then edit only "magit.org". Do not manually edit "magit.texi". The latter has to be generate from the former. If you want to do that yourself, then follow the instructions at [1]. Otherwise a maintainer will do it and amend that to your commit.
[1]: https://github.com/magit/magit/wiki/Documentation-tools-and-conventions
Magit v2.13.1 Release Notes
===========================
Fixes since v2.13.0
-------------------
* The prompt used by `magit-rebase-interactive-assert' was wrong.
37d76f409
* `magit-rebase-autosquash' asked for confirmation when the user
already confirmed earlier. 02e6c75b6
* `magit-log-wash-rev` errored in ~magit-cherry-mode~, starting with
Emacs 26.1. 1ee577b35
* Magit used a completion function to make the built-in completion
respect the collection's order. Even though that wasn't necessary
for Ivy and Helm it did the same here, which became a problem when a
change in Helm caused fuzzy completion to break in combination with
a completion function. Likewise a change in Ivy caused Magit's sort
order to be ignored, which we work around now. #3476, #3477
* When using cygwin, then `git-commit-setup-font-lock' could end up
trying to run git in a non-existent directory. #3505
* `magit-insert-modules-unpushed-to-pushremote' failed to insert
anything due to a typo in the used commit range. d4e159f35
Authors
-------
11 Jonas Bernoulli
8 Kyle Meyer
5 Noam Postavsky
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,7 @@ help:
$(info make html - generate html manual files)
$(info make html-dir - generate html manual directories)
$(info make pdf - generate pdf manuals)
$(info make epub - generate epub manuals)
$(info )
$(info Install)
$(info =======)
......@@ -52,8 +53,8 @@ help:
$(info make test-interactive - run tests interactively)
$(info make emacs-Q - run emacs -Q plus Magit)
$(info )
$(info Release Managment)
$(info =================)
$(info Release Management)
$(info ==================)
$(info )
$(info make texi - regenerate texi from org)
$(info make stats - regenerate statistics)
......@@ -86,6 +87,9 @@ html-dir:
pdf:
@$(MAKE) -C Documentation pdf
epub:
@$(MAKE) -C Documentation epub
## Install ###########################################################
install: install-lisp install-docs
......@@ -190,19 +194,18 @@ define set_package_requires
(re-search-forward "^;; Package-Requires: ")
(delete-region (point) (line-end-position))
(insert (format "%S"
`((emacs "24.4") ;`
`((emacs ,emacs-version) ;`
(dash ,dash-version)
(with-editor ,with-editor-version))))
(with-temp-file "lisp/magit-pkg.el"
(insert (pp-to-string
`(define-package "magit" "2.12.0" ;`
`(define-package "magit" "$(VERSION)" ;`
"A Git porcelain inside Emacs."
'((emacs "24.4") ;'
'((emacs ,emacs-version) ;'
(async ,async-version)
(dash ,dash-version)
(ghub ,ghub-version)
(git-commit ,git-commit-version)
(let-alist ,let-alist-version)
(magit-popup ,magit-popup-version)
(with-editor ,with-editor-version)))))
(goto-char (point-min))
......@@ -215,35 +218,23 @@ export set_package_requires
bump-versions: bump-versions-1 texi
bump-versions-1:
@$(BATCH) --eval "(let (\
(emacs-version \"$(EMACS_VERSION)\")\
(async-version \"$(ASYNC_VERSION)\")\
(dash-version \"$(DASH_VERSION)\")\
(ghub-version \"$(GHUB_VERSION)\")\
(git-commit-version \"$(GIT_COMMIT_VERSION)\")\
(let-alist-version \"$(LET_ALIST_VERSION)\")\
(magit-popup-version \"$(MAGIT_POPUP_VERSION)\")\
(with-editor-version \"$(WITH_EDITOR_VERSION)\"))\
$$set_package_requires)"
bump-snapshots:
@$(BATCH) --eval "(let (\
(emacs-version \"$(EMACS_VERSION)\")\
(async-version \"$(ASYNC_MELPA_SNAPSHOT)\")\
(dash-version \"$(DASH_MELPA_SNAPSHOT)\")\
(ghub-version \"$(GHUB_MELPA_SNAPSHOT)\")\
(git-commit-version \"$(GIT_COMMIT_MELPA_SNAPSHOT)\")\
(let-alist-version \"$(LET_ALIST_VERSION)\")\
(magit-popup-version \"$(MAGIT_POPUP_MELPA_SNAPSHOT)\")\
(with-editor-version \"$(WITH_EDITOR_MELPA_SNAPSHOT)\"))\
$$set_package_requires)"
@git commit -a -m "Reset Package-Requires for Melpa"
define suppress_warnings
(fset 'original-message (symbol-function 'message))
(fset 'message ;'
(lambda (f &rest a)
(unless (or (equal f "Wrote %s")
(equal f "pcase-memoize: equal first branch, yet different")
(and (equal f "Warning: Unknown defun property `%S' in %S")
(memq (car a) '(pure side-effect-free interactive-only))))
(apply 'original-message f a))))
endef
export suppress_warnings
......@@ -26,17 +26,19 @@
<hr>
<div align="center">
<a href="https://www.kickstarter.com/projects/1681258897/its-magit-the-magical-git-client/updates">
<img src="https://magit.vc/assets/kickstarter-k.png">
<a href="https://magit.vc/buy">
<img src="https://magit.vc/assets/stickers1x.png">
</a>
<br>
Please support Magit by
<a href="https://magit.vc/buy">buying some stickers</a>!
</div>
<br>
<hr>
<div align="justify">
Thanks to
<a href="https://github.com/magit/magit/blob/master/Documentation/BACKERS.md">1987 backers</a>
the Kickstarter campaign was a huge success!
This September was very exciting and I would like to thank you all
for your generosity and enthusiastic support!
made sure the Kickstarter campaign was a huge success!
Thanks for your generosity and enthusiastic support!
</div>
<div align="center">
<em><b>Thank you!</b> &mdash; Jonas Bernoulli</em><br><br>
......@@ -61,42 +63,6 @@
<br>
<hr>
<div align="center">
Keeping its users <a href= "https://magit.vc/quotes">this excited</a> is
<a href="https://magit.vc/stats/authors.html#cumulated_added_lines_of_code_per_author">
a lot of work
</a>.
If Magit makes you <br> more productive too,
then <b>please consider making a donation</b>.
</div>
<div align="center">
<em>Thank you! &mdash; Jonas Bernoulli</em>
</div>
<br>
<div align="center">
<a href="https://www.paypal.me/JonasBernoulli/20">
<img title="Donate using PayPal"
alt="Donate using PayPal"
style="height: 50px; width: auto;"
src="https://magit.vc/assets/paypal.png"></a>
&nbsp;&nbsp;
<a href="https://www.patreon.com/tarsius">
<img title="Donate monthly using Patreon"
alt="Donate monthly using Patreon"
style="height: 50px; width: auto;"
src="https://magit.vc/assets/patreon-50px.png"></a>
&nbsp;&nbsp;
<a href="https://liberapay.com/magit">
<img title="Donate weekly using Liberapay"
alt="Donate weekly using Liberapay"
src="https://magit.vc/assets/liberapay-50px.png"></a>
</div>
<br>
<div align="center">
Some alternative donation methods are <a href="https://magit.vc/donate">available</a>.
</div>
<hr>
Support
=======
......@@ -144,7 +110,7 @@ Thanks to all of you, may (the history of) the source be with you!
[![Paren Xkcb](https://img.shields.io/badge/%28-%20%20%20-red.svg)](https://xkcd.com/859)
[contrib]: https://github.com/magit/magit/blob/master/Documentation/CONTRIBUTING.md
[contrib]: https://github.com/magit/magit/blob/master/.github/CONTRIBUTING.md
[issues]: https://github.com/magit/magit/issues
[pulls]: https://github.com/magit/magit/pulls
......
Documentation/RelNotes/2.13.0.txt
\ No newline at end of file
Documentation/RelNotes/2.90.0.org
\ No newline at end of file
......@@ -43,6 +43,7 @@ INFOPAGES = $(addsuffix .info,$(filter-out git-commit,$(PACKAGES)))
HTMLFILES = $(addsuffix .html,$(filter-out git-commit,$(PACKAGES)))
HTMLDIRS = $(filter-out git-commit,$(PACKAGES))
PDFFILES = $(addsuffix .pdf,$(filter-out git-commit,$(PACKAGES)))
EPUBFILES = $(addsuffix .epub,$(filter-out git-commit,$(PACKAGES)))
ELS = git-commit.el
ELS += magit-utils.el
......@@ -73,12 +74,18 @@ ELS += magit-obsolete.el
ELS += magit-sequence.el
ELS += magit-commit.el
ELS += magit-remote.el
ELS += magit-clone.el
ELS += magit-fetch.el
ELS += magit-pull.el
ELS += magit-push.el
ELS += magit-patch.el
ELS += magit-bisect.el
ELS += magit-stash.el
ELS += magit-blame.el
ELS += magit-submodule.el
ELS += magit-subtree.el
ELS += magit-ediff.el
ELS += magit-gitignore.el
ELS += magit-extras.el
ELS += git-rebase.el
ELS += magit-imenu.el
......@@ -93,20 +100,19 @@ VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0)
ASYNC_VERSION = 1.9.3
DASH_VERSION = 2.14.1
GHUB_VERSION = 2.0.1
GIT_COMMIT_VERSION = 2.12.1
LET_ALIST_VERSION = 1.0.5
MAGIT_POPUP_VERSION = 2.12.3
WITH_EDITOR_VERSION = 2.7.3
GHUB_VERSION = 3.0.0
GIT_COMMIT_VERSION = 2.13.0
MAGIT_POPUP_VERSION = 2.12.4
WITH_EDITOR_VERSION = 2.8.0
ASYNC_MELPA_SNAPSHOT = 20180527
DASH_MELPA_SNAPSHOT = 20180413
GHUB_MELPA_SNAPSHOT = 20180417
GIT_COMMIT_MELPA_SNAPSHOT = 20180411
MAGIT_POPUP_MELPA_SNAPSHOT = 20180509
WITH_EDITOR_MELPA_SNAPSHOT = 20180414
DASH_MELPA_SNAPSHOT = 20180910
GHUB_MELPA_SNAPSHOT = 20181107
GIT_COMMIT_MELPA_SNAPSHOT = 20181104
MAGIT_POPUP_MELPA_SNAPSHOT = 20181003
WITH_EDITOR_MELPA_SNAPSHOT = 20181103
EMACS_VERSION = 24.4
EMACS_VERSION = 25.1
EMACSOLD := $(shell $(BATCH) --eval \
"(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))")
......@@ -134,6 +140,13 @@ ifeq "$(GHUB_DIR)" ""
GHUB_DIR = $(TOP)../ghub
endif
GRAPHQL_DIR ?= $(shell \
find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/graphql-[.0-9]*' 2> /dev/null | \
sort | tail -n 1)
ifeq "$(GRAPHQL_DIR)" ""
GRAPHQL_DIR = $(TOP)../graphql
endif
MAGIT_POPUP_DIR ?= $(shell \
find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/magit-popup-[.0-9]*' 2> /dev/null | \
sort | tail -n 1)
......@@ -141,6 +154,13 @@ ifeq "$(MAGIT_POPUP_DIR)" ""
MAGIT_POPUP_DIR = $(TOP)../magit-popup
endif
TREEPY_DIR ?= $(shell \
find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/treepy-[.0-9]*' 2> /dev/null | \
sort | tail -n 1)
ifeq "$(TREEPY_DIR)" ""
TREEPY_DIR = $(TOP)../treepy
endif
WITH_EDITOR_DIR ?= $(shell \
find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/with-editor-[.0-9]*' 2> /dev/null | \
sort | tail -n 1)
......@@ -155,15 +175,23 @@ endif
LOAD_PATH = -L $(TOP)/lisp
# When making changes here, then don't forget to adjust Makefile,
# .travis.yml, magit-emacs-Q-command and the "Installing from the
# Git Repository" info node accordingly.
ifdef CYGPATH
LOAD_PATH += -L $(shell cygpath --mixed $(DASH_DIR))
LOAD_PATH += -L $(shell cygpath --mixed $(GHUB_DIR))
LOAD_PATH += -L $(shell cygpath --mixed $(GRAPHQL_DIR))
LOAD_PATH += -L $(shell cygpath --mixed $(MAGIT_POPUP_DIR))
LOAD_PATH += -L $(shell cygpath --mixed $(TREEPY_DIR))
LOAD_PATH += -L $(shell cygpath --mixed $(WITH_EDITOR_DIR))
else
LOAD_PATH += -L $(DASH_DIR)
LOAD_PATH += -L $(GHUB_DIR)
LOAD_PATH += -L $(GRAPHQL_DIR)
LOAD_PATH += -L $(MAGIT_POPUP_DIR)
LOAD_PATH += -L $(TREEPY_DIR)
LOAD_PATH += -L $(WITH_EDITOR_DIR)
endif
......@@ -175,3 +203,11 @@ ORG_LOAD_PATH += -L ../../org/lisp
ORG_LOAD_PATH += -L ../../org/contrib/lisp
ORG_LOAD_PATH += -L ../../ox-texinfo+
endif
## Publish ###########################################################
PUBLISH_TARGETS ?= html html-dir pdf epub
DOCBOOK_XSL ?= /usr/share/xml/docbook/stylesheet/docbook-xsl/epub/docbook.xsl
EPUBTRASH = epub.xml META-INF OEBPS
((emacs-lisp-mode
(indent-tabs-mode . nil)))
......@@ -41,6 +41,11 @@ magit-notes.elc: magit.elc
magit-sequence.elc: magit.elc
magit-commit.elc: magit.elc magit-sequence.elc
magit-remote.elc: magit.elc
magit-clone.elc: magit.elc
magit-fetch.elc: magit.elc
magit-pull.elc: magit.elc
magit-push.elc: magit.elc
magit-patch.elc: magit.elc
magit-bisect.elc: magit.elc
magit-stash.elc: magit.elc
magit-blame.elc: magit.elc
......@@ -48,6 +53,7 @@ magit-obsolete.elc: magit.elc
magit-submodule.elc: magit.elc
magit-subtree.elc: magit.elc
magit-ediff.elc: magit.elc
magit-gitignore.elc: magit.elc
magit-extras.elc: magit.elc magit-merge.elc
git-rebase.elc: magit.elc
magit-imenu.elc: magit.elc git-rebase.elc
......@@ -135,3 +141,15 @@ define VERSIONLIB_TMPL
endef
export VERSIONLIB_TMPL
#'
define suppress_warnings
(fset 'original-message (symbol-function 'message))
(fset 'message ;'
(lambda (f &rest a)
(unless (or (equal f "Wrote %s")
(equal f "pcase-memoize: equal first branch, yet different")
(and (equal f "Warning: Unknown defun property `%S' in %S")
(memq (car a) '(pure side-effect-free interactive-only))))
(apply 'original-message f a))))
endef
export suppress_warnings
......@@ -11,7 +11,7 @@
;; Marius Vollmer <marius.vollmer@gmail.com>
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
;; Package-Requires: ((emacs "24.4") (dash "2.14.1") (with-editor "2.7.3"))
;; Package-Requires: ((emacs "25.1") (dash "2.14.1") (with-editor "2.8.0"))
;; Keywords: git tools vc
;; Homepage: https://github.com/magit/magit
......@@ -188,6 +188,25 @@ The major mode configured here is turned on by the minor mode
bug-reference-mode
with-editor-usage-message))
(defcustom git-commit-post-finish-hook nil
"Hook run after the user finished writing a commit message.
\\<with-editor-mode-map>\
This hook is only run after pressing \\[with-editor-finish] in a buffer used
to edit a commit message. If a commit is created without the
user typing a message into a buffer, then this hook is not run.
This hook is not run until the new commit has been created. If
doing so takes Git longer than one second, then this hook isn't
run at all. For certain commands such as `magit-rebase-continue'
this hook is never run because doing so would lead to a race
condition.
Also see `magit-post-commit-hook'."
:group 'git-commit
:type 'hook
:get (and (featurep 'magit-utils) 'magit-hook-custom-get))
(defcustom git-commit-finish-query-functions
'(git-commit-check-style-conventions)
"List of functions called to query before performing commit.
......@@ -417,13 +436,16 @@ This is only used if Magit is available."
(defvar git-commit-mode)
;;;###autoload
(defun git-commit-setup ()
(defun git-commit-file-not-found ()
;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...),
;; try to handle this in window-nt Emacs.
(--when-let
(and (eq system-type 'windows-nt)
(not (file-accessible-directory-p default-directory))
(and (or (string-match-p git-commit-filename-regexp buffer-file-name)
(and (boundp 'git-rebase-filename-regexp)
(string-match-p git-rebase-filename-regexp
buffer-file-name)))
(not (file-accessible-directory-p
(file-name-directory buffer-file-name)))
(if (require 'magit-git nil t)
;; Emacs prepends a "c:".
(magit-expand-git-file-name (substring buffer-file-name 2))
......@@ -433,7 +455,32 @@ This is only used if Magit is available."
(concat (match-string 2 buffer-file-name) ":/"
(match-string 3 buffer-file-name)))))
(when (file-accessible-directory-p (file-name-directory it))
(find-alternate-file it)))
(let ((inhibit-read-only t))
(insert-file-contents it t)
t))))
(when (eq system-type 'windows-nt)
(add-hook 'find-file-not-found-functions #'git-commit-file-not-found))
;;;###autoload
(defun git-commit-setup ()
;; Pretend that git-commit-mode is a major-mode,
;; so that directory-local settings can be used.
(let ((default-directory
(if (or (file-exists-p ".dir-locals.el")
(not (fboundp 'magit-toplevel)))
default-directory
;; When $GIT_DIR/.dir-locals.el doesn't exist,
;; fallback to $GIT_WORK_TREE/.dir-locals.el,
;; because the maintainer can use the latter
;; to enforce conventions, while s/he has no
;; control over the former.
(and (fboundp 'magit-toplevel) ; silence byte-compiler
(magit-toplevel)))))
(let ((buffer-file-name nil) ; trick hack-dir-local-variables
(major-mode 'git-commit-mode)) ; trick dir-locals-collect-variables
(hack-dir-local-variables)
(hack-local-variables-apply)))
(when git-commit-major-mode
(let ((auto-mode-alist (list (cons (concat "\\`"
(regexp-quote buffer-file-name)
......@@ -455,6 +502,20 @@ This is only used if Magit is available."
'git-commit-save-message nil t)
(add-hook 'with-editor-pre-cancel-hook
'git-commit-save-message nil t)
(when (and (fboundp 'magit-rev-parse)
(not (memq last-command
'(magit-sequencer-continue
magit-sequencer-skip
magit-am-continue
magit-am-skip
magit-rebase-continue
magit-rebase-skip))))
(add-hook 'with-editor-post-finish-hook
(apply-partially 'git-commit-run-post-finish-hook
(magit-rev-parse "HEAD"))
nil t)
(when (fboundp 'magit-wip-maybe-add-commit-hook)
(magit-wip-maybe-add-commit-hook)))
(setq with-editor-cancel-message
'git-commit-cancel-message)
(make-local-variable 'log-edit-comment-ring-index)
......@@ -469,6 +530,19 @@ This is only used if Magit is available."
(run-hooks 'git-commit-setup-hook)
(set-buffer-modified-p nil))
(defun git-commit-run-post-finish-hook (previous)
(when git-commit-post-finish-hook
(cl-block nil
(let ((break (time-add (current-time)
(seconds-to-time 1))))
(while (equal (magit-rev-parse "HEAD") previous)
(if (time-less-p (current-time) break)
(sit-for 0.01)
(message "No commit created after 1 second. Not running %s."
'git-commit-post-finish-hook)
(cl-return))))
(run-hooks 'git-commit-post-finish-hook))))
(define-minor-mode git-commit-mode
"Auxiliary minor mode used when editing Git commit messages.
This mode is only responsible for setting up some key bindings.
......@@ -719,7 +793,7 @@ Added to `font-lock-extend-region-functions'."
(0 'git-commit-pseudo-header))
;; Summary
(eval . `(,(git-commit-summary-regexp)
(1 'git-commit-summary t)))
(1 'git-commit-summary)))
;; - Note (overrides summary)
("\\[.+?\\]"
(0 'git-commit-note t))
......@@ -792,7 +866,11 @@ Added to `font-lock-extend-region-functions'."
(setq-local comment-end-skip "\n")
(setq-local comment-use-syntax nil)
(setq-local git-commit--branch-name-regexp
(if (featurep 'magit-git)
(if (and (featurep 'magit-git)
;; When using cygwin git, we may end up in a
;; non-existing directory, which would cause
;; any git calls to signal an error.
(file-accessible-directory-p default-directory))
(progn
;; Make sure the below functions are available.
(require 'magit)
......@@ -844,5 +922,22 @@ Added to `font-lock-extend-region-functions'."
(get-text-property pos 'face)))
(buffer-string)))))))
;;; Elisp Text Mode
(define-derived-mode git-commit-elisp-text-mode text-mode "ElText"
"Major mode for editing commit messages of elisp projects.
This is intended for use as `git-commit-major-mode' for projects
that expect `symbols' to look like this. I.e. like they look in
Elisp doc-strings, including this one. Unlike in doc-strings,
\"strings\" also look different than the other text."
(setq font-lock-defaults '(git-commit-elisp-text-mode-keywords)))
(defvar git-commit-elisp-text-mode-keywords
`((,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)"
lisp-mode-symbol-regexp "\\)[']")
(1 font-lock-constant-face prepend))
("\"[^\"]*\"" (0 font-lock-string-face prepend))))
;;; _
(provide 'git-commit)
;;; git-commit.el ends here
......@@ -276,11 +276,12 @@ If N is negative, move the commit up instead. With an active
region, move all the lines that the region touches, not just the
current line."
(interactive "p")
(-let* (((beg end) (or (git-rebase-region-bounds)
(list (line-beginning-position)
(1+ (line-end-position)))))
(pt-offset (- (point) beg))
(mark-offset (and mark-active (- (mark) beg))))
(pcase-let* ((`(,beg ,end)
(or (git-rebase-region-bounds)
(list (line-beginning-position)
(1+ (line-end-position)))))
(pt-offset (- (point) beg))
(mark-offset (and mark-active (- (mark) beg))))
(save-restriction
(narrow-to-region
(point-min)
......@@ -545,11 +546,11 @@ By default, this is the same except for the \"pick\" command."
(concat git-rebase-comment-re "\\s-+p, pick")
nil t))
(goto-char (line-beginning-position))
(--each git-rebase-command-descriptions
(pcase-dolist (`(,cmd . ,desc) git-rebase-command-descriptions)
(insert (format "%s %-8s %s\n"
comment-start
(substitute-command-keys (format "\\[%s]" (car it)))
(cdr it))))
(substitute-command-keys (format "\\[%s]" cmd))
desc)))
(while (re-search-forward (concat git-rebase-comment-re
"\\( ?\\)\\([^\n,],\\) "
"\\([^\n ]+\\) ")
......@@ -587,5 +588,6 @@ By default, this is the same except for the \"pick\" command."
(add-to-list 'with-editor-file-name-history-exclude git-rebase-filename-regexp)
;;; _
(provide 'git-rebase)
;;; git-rebase.el ends here
......@@ -30,6 +30,9 @@
;;; Code:
(eval-when-compile
(require 'subr-x))
(require 'magit-core)
(require 'magit-diff)
(require 'magit-wip)
......@@ -91,6 +94,28 @@ rejected reversals."
:group 'magit-commands
:type 'boolean)
(defcustom magit-post-stage-hook nil
"Hook run after staging changes.
This hook is run by `magit-refresh' if `this-command'
is a member of `magit-post-stage-hook-commands'."
:package-version '(magit . "2.90.0")
:group 'magit-commands
:type 'hook)
(defvar magit-post-stage-hook-commands
'(magit-stage magit-stage-file magit-stage-modified))
(defcustom magit-post-unstage-hook nil
"Hook run after unstaging changes.
This hook is run by `magit-refresh' if `this-command'
is a member of `magit-post-unstage-hook-commands'."
:package-version '(magit . "2.90.0")
:group 'magit-commands
:type 'hook)
(defvar magit-post-unstage-hook-commands
'(magit-unstage magit-unstage-file magit-unstage-all))
;;; Commands
;;;; Apply
......@@ -165,14 +190,17 @@ so causes the change to be applied to the index as well."
(command (symbol-name this-command))
(command (if (and command (string-match "^magit-\\([^-]+\\)" command))
(match-string 1 command)
"apply")))
"apply"))
(no-context (not (magit-diff-context-p)))
(ignore-context (magit-diff-ignore-any-space-p)))
(when (and magit-wip-before-change-mode (not inhibit-magit-refresh))
(magit-wip-commit-before-change files (concat " before " command)))
(with-temp-buffer
(insert patch)
(magit-run-git-with-input
"apply" args "-p0"
(unless (magit-diff-context-p) "--unidiff-zero")
(and no-context "--unidiff-zero")
(and ignore-context "-C0")
"--ignore-space-change" "-"))
(unless inhibit-magit-refresh
(when magit-wip-after-apply-mode
......@@ -243,7 +271,7 @@ With a prefix argument or when there is no file at point ask for
the file to be staged. Otherwise stage the file at point without
requiring confirmation."
(interactive
(let* ((atpoint (magit-section-when (file)))
(let* ((atpoint (magit-section-value-if 'file))
(current (magit-file-relative-name))
(choices (nconc (magit-unstaged-files)
(magit-untracked-files)))
......@@ -355,7 +383,7 @@ With a prefix argument or when there is no file at point ask for
the file to be unstaged. Otherwise unstage the file at point
without requiring confirmation."
(interactive
(let* ((atpoint (magit-section-when (file)))
(let* ((atpoint (magit-section-value-if 'file))
(current (magit-file-relative-name))
(choices (magit-staged-files))
(default (car (member (or atpoint current) choices))))
......@@ -457,8 +485,8 @@ without requiring confirmation."
(`unstaged ?Y)
(`untracked ?Z))
(cddr (assoc file status)))
(`(?Z) (--each (magit-untracked-files nil file)
(push it delete)))
(`(?Z) (dolist (f (magit-untracked-files nil file))
(push f delete)))
((or `(?Z ?? ??) `(?Z ?! ?!)) (push file delete))
((or `(?Z ?D ? ) `(,_ ?D ?D)) (push file delete))
((or `(,_ ?U ,_) `(,_ ,_ ?U)) (push file resolve))
......@@ -476,8 +504,7 @@ without requiring confirmation."
(let ((inhibit-magit-refresh t))
(magit-wip-commit-before-change files " before discard")
(when resolve
(dolist (file (nreverse resolve))
(magit-checkout-stage file (magit-checkout-read-stage file))))
(magit-discard-files--resolve (nreverse resolve)))
(when resurrect
(magit-discard-files--resurrect (nreverse resurrect)))
(when delete
......@@ -490,6 +517,24 @@ without requiring confirmation."
(magit-wip-commit-after-apply files " after discard"))
(magit-refresh))))
(defun magit-discard-files--resolve (files)
(if-let ((arg (and (cdr files)
(magit-read-char-case
(format "For these %i files\n%s\ncheckout:\n"
(length files)
(mapconcat (lambda (file)
(concat " " file))
files "\n"))
t
(?o "[o]ur stage" "--ours")
(?t "[t]heir stage" "--theirs")
(?c "[c]onflict" "--merge")
(?i "decide [i]ndividually" nil)))))
(dolist (file files)
(magit-checkout-stage file arg))
(dolist (file files)
(magit-checkout-stage file (magit-checkout-read-stage file)))))
(defun magit-discard-files--resurrect (files)
(magit-confirm-files 'resurrect files)
(if (eq (magit-diff-type) 'staged)
......@@ -544,7 +589,7 @@ without requiring confirmation."
(when new-files
(magit-call-git "add" "--" new-files)
(magit-call-git "reset" "--" new-files))
(let ((binaries (magit-staged-binary-files)))
(let ((binaries (magit-binary-files "--cached")))
(when binaries
(setq sections
(--remove (member (oref it value) binaries)
......@@ -601,14 +646,22 @@ so causes the change to be applied to the index as well."
(magit-reverse-files (list section) args))
(defun magit-reverse-files (sections args)
(-let [(binaries sections)
(let ((bs (magit-staged-binary-files)))
(--separate (member (oref it value) bs)
sections))]
(pcase-let ((`(,binaries ,sections)
(let ((bs (magit-binary-files
(cond ((derived-mode-p 'magit-revision-mode)
(let ((rev (car magit-refresh-args)))
(format "%s^..%s" rev rev)))
((derived-mode-p 'magit-diff-mode)
(car magit-refresh-args))
(t
"--cached")))))
(--separate (member (oref it value) bs)
sections))))
(magit-confirm-files 'reverse (--map (oref it value) sections))
(if (= (length sections) 1)
(magit-reverse-apply (car sections) 'magit-apply-diff args)
(magit-reverse-apply sections 'magit-apply-diffs args))
(cond ((= (length sections) 1)
(magit-reverse-apply (car sections) 'magit-apply-diff args))
(sections
(magit-reverse-apply sections 'magit-apply-diffs args)))
(when binaries
(user-error "Cannot reverse binary files"))))
......@@ -637,5 +690,6 @@ a separate commit. A typical workflow would be:
(interactive)
(magit-reverse (cons "--cached" args)))
;;; _
(provide 'magit-apply)
;;; magit-apply.el ends here
......@@ -115,9 +115,6 @@ seconds of user inactivity. That is not desirable."
(not global-auto-revert-mode)) ; see #3460
(auto-revert-mode 1))))
;;;###autoload
(defvar magit-revert-buffers t) ; obsolete
;;;###autoload
(define-globalized-minor-mode magit-auto-revert-mode auto-revert-mode
magit-turn-on-auto-revert-mode-if-desired
......@@ -125,14 +122,16 @@ seconds of user inactivity. That is not desirable."
:link '(info-link "(magit)Automatic Reverting of File-Visiting Buffers")
:group 'magit-auto-revert
:group 'magit-essentials
;; When `global-auto-revert-mode' is enabled, then this mode is
;; redundant. When `magit-revert-buffers' is nil, then the user has
;; opted out of the automatic reverts while the old implementation
;; was still in use. In all other cases enable the mode because if
;; buffers are not automatically reverted that would make many very
;; common tasks much more cumbersome.
:init-value (and (with-no-warnings magit-revert-buffers)
(not global-auto-revert-mode)
;; - When `global-auto-revert-mode' is enabled, then this mode is
;; redundant.
;; - In all other cases enable the mode because if buffers are not
;; automatically reverted that would make many very common tasks
;; much more cumbersome.
;; - When `magit-revert-buffers' is nil, then the user has opted out
;; of the automatic reverts while a very old implementation was
;; still in use. We continued to respect that setting for another
;; two and a half years, but no longer do so now.
:init-value (and (not global-auto-revert-mode)
(not noninteractive)))
;; - Unfortunately `:init-value t' only sets the value of the mode
;; variable but does not cause the mode function to be called.
......@@ -152,9 +151,7 @@ seconds of user inactivity. That is not desirable."
Do not use this function elsewhere, and don't remove it from
the `after-init-hook'. For more information see the comments
and code surrounding the definition of this function."
;; `magit-revert-buffers' may have been set to nil before the alias
;; had been established, so consult the value of both variables.
(if (and magit-auto-revert-mode (with-no-warnings magit-revert-buffers))
(if magit-auto-revert-mode
(let ((start (current-time)))
(magit-message "Turning on magit-auto-revert-mode...")
(magit-auto-revert-mode 1)
......@@ -259,5 +256,6 @@ located. If there is no current repository, then return FALLBACK
(advice-add 'auto-revert-buffers :before
'auto-revert-buffers--buffer-list-filter)
;;; _
(provide 'magit-autorevert)
;;; magit-autorevert.el ends here
......@@ -79,6 +79,12 @@ other actions from the bisect popup (\
(interactive (if (magit-bisect-in-progress-p)
(user-error "Already bisecting")
(magit-bisect-start-read-args)))
(unless (magit-rev-ancestor-p good bad)
(user-error
"The good revision (%s) has to be an ancestor of the bad one (%s)"
good bad))
(when (magit-anything-modified-p)
(user-error "Cannot bisect with uncommitted changes"))
(magit-git-bisect "start" (list bad good) t))
(defun magit-bisect-start-read-args ()
......@@ -206,5 +212,6 @@ bisect run'."
(magit-insert-section (bisect-item)
(insert hash " is the first bad commit\n"))))))
;;; _
(provide 'magit-bisect)
;;; magit-bisect.el ends here
......@@ -28,6 +28,9 @@
;;; Code:
(eval-when-compile
(require 'subr-x))
(require 'magit)
;;; Options
......@@ -239,8 +242,8 @@ Also see option `magit-blame-styles'."
(car (magit-blame--parse-chunk type))))))))
(defun magit-blame-chunk-at (pos)
(--any (overlay-get it 'magit-blame-chunk)
(overlays-at pos)))
(--some (overlay-get it 'magit-blame-chunk)
(overlays-at pos)))
(defun magit-blame--overlay-at (&optional pos key)
(unless pos
......@@ -267,7 +270,7 @@ in `magit-blame-read-only-mode-map' instead.")
(define-key map (kbd "I") 'magit-blame-previous-chunk-same-commit)
(define-key map (kbd "k") 'magit-blame-next-chunk)
(define-key map (kbd "K") 'magit-blame-next-chunk-same-commit)
(define-key map (kbd "j") 'magit-blame)
(define-key map (kbd "j") 'magit-blame-addition)
(define-key map (kbd "l") 'magit-blame-removal)
(define-key map (kbd "f") 'magit-blame-reverse)
(define-key map (kbd "b") 'magit-blame-popup))
......@@ -277,7 +280,7 @@ in `magit-blame-read-only-mode-map' instead.")
(define-key map (kbd "P") 'magit-blame-previous-chunk-same-commit)
(define-key map (kbd "n") 'magit-blame-next-chunk)
(define-key map (kbd "N") 'magit-blame-next-chunk-same-commit)
(define-key map (kbd "b") 'magit-blame)
(define-key map (kbd "b") 'magit-blame-addition)
(define-key map (kbd "r") 'magit-blame-removal)
(define-key map (kbd "f") 'magit-blame-reverse)
(define-key map (kbd "B") 'magit-blame-popup)))
......@@ -473,13 +476,12 @@ modes is toggled, then this mode also gets toggled automatically.
(defun magit-blame--parse-chunk (type)
(let (chunk revinfo)
(looking-at "^\\(.\\{40\\}\\) \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)")
(setq chunk (let ((fn 'magit-blame-chunk))
(funcall fn "" ; Suppress warning about obsolete name arg.
:orig-rev (match-string 1)
:orig-line (string-to-number (match-string 2))
:final-line (string-to-number (match-string 3))
:num-lines (string-to-number (match-string 4)))))
(with-slots (orig-rev orig-file prev-rev prev-file) chunk
(with-slots (orig-rev orig-file prev-rev prev-file)
(setq chunk (magit-blame-chunk
:orig-rev (match-string 1)
:orig-line (string-to-number (match-string 2))
:final-line (string-to-number (match-string 3))
:num-lines (string-to-number (match-string 4))))
(forward-line)
(let (done)
(while (not done)
......@@ -660,8 +662,8 @@ modes is toggled, then this mode also gets toggled automatically.
(?A . ,(p2 "author-time" "author-tz" 'magit-blame-date))
(?C . ,(p2 "committer-time" "committer-tz" 'magit-blame-date))
(?f . "")))))))
(-if-let (width (and (string-suffix-p "%f" format)
(magit-blame--style-get 'margin-width)))
(if-let ((width (and (string-suffix-p "%f" format)
(magit-blame--style-get 'margin-width))))
(concat str
(propertize (make-string (max 0 (- width (length str))) ?\s)
'face face))
......@@ -695,10 +697,10 @@ modes is toggled, then this mode also gets toggled automatically.
(defun magit-blame-maybe-show-message ()
(when (magit-blame--style-get 'show-message)
(let ((message-log-max 0))
(-if-let (msg (cdr (assq 'heading
(if-let ((msg (cdr (assq 'heading
(gethash (oref (magit-current-blame-chunk)
orig-rev)
magit-blame-cache))))
magit-blame-cache)))))
(progn (setq msg (substring msg 0 -1))
(set-text-properties 0 (length msg) nil msg)
(message msg))
......@@ -721,12 +723,12 @@ not turn on `read-only-mode'."
(cons 'eldoc-mode magit-blame-disable-modes))
(if (not magit-blame-mode)
(let ((magit-blame-read-only nil))
(magit-blame))
(magit-blame-addition))
(read-only-mode -1)
(magit-blame--update-overlays)))
;;;###autoload
(defun magit-blame ()
(defun magit-blame-addition ()
"For each line show the revision in which it was added."
(interactive)
(magit-blame--pre-blame-assert 'addition)
......@@ -758,7 +760,7 @@ not turn on `read-only-mode'."
(magit--not-inside-repository-error))
(if (and magit-blame-mode
(eq type magit-blame-type))
(-if-let (chunk (magit-current-blame-chunk))
(if-let ((chunk (magit-current-blame-chunk)))
(unless (oref chunk prev-rev)
(user-error "Chunk has no further history"))
(user-error "Commit data not available yet. Still blaming."))
......@@ -828,7 +830,7 @@ then also kill the buffer."
(defun magit-blame-next-chunk-same-commit (&optional previous)
"Move to the next chunk from the same commit.\n\n(fn)"
(interactive)
(-if-let (rev (oref (magit-current-blame-chunk) orig-rev))
(if-let ((rev (oref (magit-current-blame-chunk) orig-rev)))
(let ((pos (point)) ov)
(save-excursion
(while (and (not ov)
......@@ -883,7 +885,7 @@ instead of the hash, like `kill-ring-save' would."
:options '((?M "Detect lines moved or copied within a file" "-M")
(?C "Detect lines moved or copied between files" "-C"))
:actions '("Actions"
(?b "Show commits adding lines" magit-blame)
(?b "Show commits adding lines" magit-blame-addition)
(?r (lambda ()
(with-current-buffer magit-pre-popup-buffer
(and (not buffer-file-name)
......@@ -903,16 +905,16 @@ instead of the hash, like `kill-ring-save' would."
(?c "Cycle style" magit-blame-cycle-style))
:default-arguments '("-w")
:max-action-columns 1
:default-action 'magit-blame)
:default-action 'magit-blame-addition)
;;; Utilities
(defun magit-blame-maybe-update-revision-buffer ()
(unless magit--update-revision-buffer
(setq magit--update-revision-buffer nil)
(-when-let* ((chunk (magit-current-blame-chunk))
(commit (oref chunk orig-rev))
(buffer (magit-mode-get-buffer 'magit-revision-mode nil t)))
(when-let ((chunk (magit-current-blame-chunk))
(commit (oref chunk orig-rev))
(buffer (magit-mode-get-buffer 'magit-revision-mode nil t)))
(setq magit--update-revision-buffer (list commit buffer))
(run-with-idle-timer
magit-update-other-window-delay nil
......@@ -923,5 +925,6 @@ instead of the hash, like `kill-ring-save' would."
(let ((magit-display-buffer-noselect t))
(apply #'magit-show-commit rev (magit-diff-arguments))))))))))
;;; _
(provide 'magit-blame)
;;; magit-blame.el ends here
......@@ -27,6 +27,9 @@
;;; Code:
(eval-when-compile
(require 'subr-x))
(require 'magit)
(require 'bookmark)
......@@ -49,14 +52,14 @@ This function will:
(apply fn args)
(signal 'bookmark-error-no-filename (list 'stringp default-directory)))
(when (derived-mode-p 'magit-mode)
(-when-let (hidden-sections (bookmark-prop-get bookmark
'magit-hidden-sections))
(--each (oref magit-root-section children)
(if (member (cons (oref it type)
(oref it value))
(when-let ((hidden-sections (bookmark-prop-get bookmark
'magit-hidden-sections)))
(dolist (child (oref magit-root-section children))
(if (member (cons (oref child type)
(oref child value))
hidden-sections)
(magit-section-hide it)
(magit-section-show it)))))
(magit-section-hide child)
(magit-section-show child)))))
(--when-let (bookmark-get-position bookmark)
(goto-char it))