1445 lines
95 KiB
Plaintext
1445 lines
95 KiB
Plaintext
This is magit.info, produced by makeinfo version 5.2 from magit.texi.
|
||
|
||
Copyright (C) 2015-2017 Jonas Bernoulli <jonas@bernoul.li>
|
||
|
||
You can redistribute this document and/or modify it under the terms
|
||
of the GNU General Public License as published by the Free Software
|
||
Foundation, either version 3 of the License, or (at your option)
|
||
any later version.
|
||
|
||
This document is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
General Public License for more details.
|
||
INFO-DIR-SECTION Emacs
|
||
START-INFO-DIR-ENTRY
|
||
* Magit: (magit). Using Git from Emacs with Magit.
|
||
END-INFO-DIR-ENTRY
|
||
|
||
|
||
File: magit.info, Node: I am using OS X and SOMETHING works in shell but not in Magit, Next: Diffs contain control sequences, Prev: I am using MS Windows and cannot push with Magit, Up: FAQ - Issues and Errors
|
||
|
||
A.2.5 I am using OS X and SOMETHING works in shell, but not in Magit
|
||
--------------------------------------------------------------------
|
||
|
||
This usually occurs because Emacs doesn’t have the same environment
|
||
variables as your shell. Try installing and configuring
|
||
<https://github.com/purcell/exec-path-from-shell>. By default it
|
||
synchronizes ‘$PATH’, which helps Magit find the same ‘git’ as the one
|
||
you are using on the shell.
|
||
|
||
If SOMETHING is "passphrase caching with gpg-agent for commit and/or
|
||
tag signing", then you’ll also need to synchronize ‘$GPG_AGENT_INFO’.
|
||
|
||
|
||
File: magit.info, Node: Diffs contain control sequences, Next: Expanding a file to show the diff causes it to disappear, Prev: I am using OS X and SOMETHING works in shell but not in Magit, Up: FAQ - Issues and Errors
|
||
|
||
A.2.6 Diffs contain control sequences
|
||
-------------------------------------
|
||
|
||
This happens when you configure Git to always color diffs and/or all of
|
||
its output. The valid values for relevant Git variables ‘color.ui’ and
|
||
‘color.diff’ are ‘false’, ‘true’ and ‘always’, and the default is
|
||
‘true’. You should leave it that because then you get colorful output
|
||
in terminals but git’s output is consumed by something else, then no
|
||
colors are used.
|
||
|
||
If you actually use some other tool which expects that requires that
|
||
you force git to output control sequences (which is highly unlikely),
|
||
then you can override these settings just for Magit by using:
|
||
|
||
(setq magit-git-global-arguments
|
||
(nconc magit-git-global-arguments
|
||
'("-c" "color.ui=false"
|
||
"-c" "color.diff=false")))
|
||
|
||
|
||
File: magit.info, Node: Expanding a file to show the diff causes it to disappear, Next: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Prev: Diffs contain control sequences, Up: FAQ - Issues and Errors
|
||
|
||
A.2.7 Expanding a file to show the diff causes it to disappear
|
||
--------------------------------------------------------------
|
||
|
||
This is probably caused by a change of a ‘diff.*’ Git variable. You
|
||
probably set that variable for a reason, and should therefore only undo
|
||
that setting in Magit by customizing ‘magit-git-global-arguments’.
|
||
|
||
|
||
File: magit.info, Node: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Next: The mode-line information isn't always up-to-date, Prev: Expanding a file to show the diff causes it to disappear, Up: FAQ - Issues and Errors
|
||
|
||
A.2.8 Point is wrong in the ‘COMMIT_EDITMSG’ buffer
|
||
---------------------------------------------------
|
||
|
||
Neither Magit nor ‘git-commit‘ fiddle with point in the buffer used to
|
||
write commit messages, so something else must be doing it.
|
||
|
||
You have probably globally enabled a mode which does restore point in
|
||
file-visiting buffers. It might be a bit surprising, but when you write
|
||
a commit message, then you are actually editing a file.
|
||
|
||
So you have to figure out which package is doing. ‘saveplace’,
|
||
‘pointback’, and ‘session’ are likely candidates. These snippets might
|
||
help:
|
||
|
||
(setq session-name-disable-regexp "\\(?:\\`'\\.git/[A-Z_]+\\'\\)")
|
||
|
||
(with-eval-after-load 'pointback
|
||
(lambda ()
|
||
(when (or git-commit-mode git-rebase-mode)
|
||
(pointback-mode -1))))
|
||
|
||
|
||
File: magit.info, Node: The mode-line information isn't always up-to-date, Next: Emacs 245 hangs when loading Magit, Prev: Point is wrong in the ‘COMMIT_EDITMSG’ buffer, Up: FAQ - Issues and Errors
|
||
|
||
A.2.9 The mode-line information isn’t always up-to-date
|
||
-------------------------------------------------------
|
||
|
||
Magit is not responsible for the version control information that is
|
||
being displayed in the mode-line and looks something like ‘Git-master’.
|
||
The built-in "Version Control" package, also known as "VC", updates that
|
||
information, and can be told to do so more often:
|
||
|
||
(setq auto-revert-check-vc-info t)
|
||
|
||
But doing so isn’t good for performance. For more (overly
|
||
optimistic) information see *note (emacs)VC Mode Line::.
|
||
|
||
If you don’t really care about seeing that information in the
|
||
mode-line, but just don’t want to see _incorrect_ information, then
|
||
consider disabling VC when using Git:
|
||
|
||
(setq vc-handled-backends (delq 'Git vc-handled-backends))
|
||
|
||
Or to disable it completely:
|
||
|
||
(setq vc-handled-backends nil)
|
||
|
||
|
||
File: magit.info, Node: Emacs 245 hangs when loading Magit, Next: A branch and tag sharing the same name breaks SOMETHING, Prev: The mode-line information isn't always up-to-date, Up: FAQ - Issues and Errors
|
||
|
||
A.2.10 Emacs 24.5 hangs when loading Magit
|
||
------------------------------------------
|
||
|
||
This is actually triggered by loading Tramp. See
|
||
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20015> for details. You
|
||
can work around the problem by setting
|
||
‘tramp-ssh-controlmaster-options’. Changing your DNS server (e.g. to
|
||
Google’s ‘8.8.8.8’) may also be sufficient to work around the issue.
|
||
|
||
|
||
File: magit.info, Node: A branch and tag sharing the same name breaks SOMETHING, Prev: Emacs 245 hangs when loading Magit, Up: FAQ - Issues and Errors
|
||
|
||
A.2.11 A branch and tag sharing the same name breaks SOMETHING
|
||
--------------------------------------------------------------
|
||
|
||
Or more generally, ambiguous refnames break SOMETHING.
|
||
|
||
Magit assumes that refs are named non-ambiguously across the
|
||
"refs/heads/", "refs/tags/", and "refs/remotes/" namespaces (i.e., all
|
||
the names remain unique when those prefixes are stripped). We consider
|
||
ambiguous refnames unsupported and recommend that you use a
|
||
non-ambiguous naming scheme. However, if you do work with a repository
|
||
that has ambiguous refnames, please report any issues you encounter so
|
||
that we can investigate whether there is a simple fix.
|
||
|
||
|
||
File: magit.info, Node: Debugging Tools, Next: Keystroke Index, Prev: FAQ, Up: Top
|
||
|
||
B Debugging Tools
|
||
*****************
|
||
|
||
Magit and its dependencies provide a few debugging tools, and we
|
||
appreciate it very much if you use those tools before reporting an
|
||
issue. Please include all relevant output when reporting an issue.
|
||
|
||
‘M-x magit-version’ (‘magit-version’)
|
||
|
||
This command shows the currently used versions of Magit, Git, and
|
||
Emacs in the echo area. Non-interactively this just returns the
|
||
Magit version.
|
||
|
||
‘M-x magit-emacs-Q-command’ (‘magit-emacs-Q-command’)
|
||
|
||
This command shows a debugging shell command in the echo area and
|
||
adds it to the kill ring. Paste that command into a shell an run
|
||
it.
|
||
|
||
This shell command starts ‘emacs’ with only ‘magit’ and its
|
||
dependencies loaded. Neither your configuration nor other
|
||
installed packages are loaded. This makes it easier to determine
|
||
whether some issue lays with Magit or something else.
|
||
|
||
‘M-x magit-debug-git-executable’ (‘magit-debug-git-executable’)
|
||
|
||
This command displays a buffer containing information about the
|
||
available and used ‘git’ executable(s), and can be useful when
|
||
investigating ‘exec-path’ issues.
|
||
|
||
Also see *note Git Executable::.
|
||
|
||
‘M-x with-editor-debug’ (‘with-editor-debug’)
|
||
|
||
This command displays a buffer containing information about the
|
||
available and used ‘git’ executable(s), and can be useful when
|
||
investigating why Magit (or rather ‘with-editor’) cannot find an
|
||
appropriate ‘emacsclient’ executable.
|
||
|
||
Also see *note (with-editor)Debugging::.
|
||
|
||
Please also see the *note FAQ::.
|
||
|
||
|
||
File: magit.info, Node: Keystroke Index, Next: Command Index, Prev: Debugging Tools, Up: Top
|
||
|
||
Appendix C Keystroke Index
|
||
**************************
|
||
|
||
|