41 | 41 |
Documentation/RelNotes/2.6.0.txt | 147 +
|
42 | 42 |
Documentation/RelNotes/2.6.1.txt | 40 +
|
43 | 43 |
Documentation/RelNotes/2.6.2.txt | 52 +
|
|
44 |
Documentation/RelNotes/2.7.0.txt | 94 +
|
44 | 45 |
Documentation/magit-popup.org | 632 ++++
|
45 | |
Documentation/magit.org | 6007 ++++++++++++++++++++++++++++++++++++++
|
|
46 |
Documentation/magit.org | 6312 ++++++++++++++++++++++++++++++++++++++
|
46 | 47 |
ISSUE_TEMPLATE | 52 +
|
47 | 48 |
t/magit-tests.el | 265 ++
|
48 | |
33 files changed, 9466 insertions(+)
|
|
49 |
34 files changed, 9865 insertions(+)
|
49 | 50 |
create mode 100644 CONTRIBUTING.md
|
50 | 51 |
create mode 100644 Documentation/RelNotes/0.5.1.txt
|
51 | 52 |
create mode 100644 Documentation/RelNotes/0.6.1.txt
|
|
75 | 76 |
create mode 100644 Documentation/RelNotes/2.6.0.txt
|
76 | 77 |
create mode 100644 Documentation/RelNotes/2.6.1.txt
|
77 | 78 |
create mode 100644 Documentation/RelNotes/2.6.2.txt
|
|
79 |
create mode 100644 Documentation/RelNotes/2.7.0.txt
|
78 | 80 |
create mode 100644 Documentation/magit-popup.org
|
79 | 81 |
create mode 100644 Documentation/magit.org
|
80 | 82 |
create mode 100644 ISSUE_TEMPLATE
|
|
2764 | 2766 |
+ 1 John Mastro
|
2765 | 2767 |
+ 1 Kyle Meyer
|
2766 | 2768 |
+ 1 Noam Postavsky
|
|
2769 |
diff --git a/Documentation/RelNotes/2.7.0.txt b/Documentation/RelNotes/2.7.0.txt
|
|
2770 |
new file mode 100644
|
|
2771 |
index 0000000..683e4e7
|
|
2772 |
--- /dev/null
|
|
2773 |
+++ b/Documentation/RelNotes/2.7.0.txt
|
|
2774 |
@@ -0,0 +1,94 @@
|
|
2775 |
+It's Magit! A Git Porcelain inside Emacs
|
|
2776 |
+=========================================
|
|
2777 |
+
|
|
2778 |
+Magit is an interface to the version control system Git, implemented
|
|
2779 |
+as an Emacs package. Magit aspires to be a complete Git porcelain.
|
|
2780 |
+While we cannot (yet) claim that Magit wraps and improves upon each
|
|
2781 |
+and every Git command, it is complete enough to allow even experienced
|
|
2782 |
+Git users to perform almost all of their daily version control tasks
|
|
2783 |
+directly from within Emacs. While many fine Git clients exist, only
|
|
2784 |
+Magit and Git itself deserve to be called porcelains.
|
|
2785 |
+
|
|
2786 |
+For more information about Magit, see http://magit.vc.
|
|
2787 |
+
|
|
2788 |
+Magit v2.7.0 Release Notes
|
|
2789 |
+==========================
|
|
2790 |
+
|
|
2791 |
+Released 19 May 2016 by Jonas Bernoulli.
|
|
2792 |
+
|
|
2793 |
+We are pleased to announce the release of Magit version 2.7.0,
|
|
2794 |
+representing 116 commits by 7 people over 7 weeks.
|
|
2795 |
+
|
|
2796 |
+Also see http://emacsair.me/2016/05/19/magit-2.7.
|
|
2797 |
+
|
|
2798 |
+Changes since v2.6.0
|
|
2799 |
+--------------------
|
|
2800 |
+
|
|
2801 |
+* Added new popup `magit-subtree-popup' and bound "O" to it.
|
|
2802 |
+
|
|
2803 |
+* Added new popup `magit-branch-config-popup' and made it available
|
|
2804 |
+ from the popups `magit-branch-popup', `magit-pull-and-fetch-popup',
|
|
2805 |
+ `magit-pull-popup', `magit-fetch-popup', and `magit-push-popup'.
|
|
2806 |
+
|
|
2807 |
+ With a prefix argument it reads a the branch to be configured in
|
|
2808 |
+ the minibuffer instead of using the current branch.
|
|
2809 |
+
|
|
2810 |
+* Added new option `magit-branch-popup-show-variables', defaulting to
|
|
2811 |
+ t to avoid changing key bindings. When set to nil, no variables are
|
|
2812 |
+ displayed directly in the `magit-branch-popup', instead the subpopup
|
|
2813 |
+ `magit-branch-config-popup' has to be used.
|
|
2814 |
+
|
|
2815 |
+* Added new popup command `magit-log-buffer-file-popup'.
|
|
2816 |
+
|
|
2817 |
+* Added new command `magit-diff-buffer-file' and new option
|
|
2818 |
+ `magit-diff-buffer-file-locked'. The the value of the option is
|
|
2819 |
+ non-nil, the default, then the command uses a dedicated buffer.
|
|
2820 |
+
|
|
2821 |
+* Added new option `magit-log-buffer-file-locked'. When its value is
|
|
2822 |
+ non-nil, the default, then `magit-log-buffer-file' uses a dedicated
|
|
2823 |
+ buffer.
|
|
2824 |
+
|
|
2825 |
+* Added new commands `magit-worktree-checkout',
|
|
2826 |
+ `magit-worktree-branch', `magit-worktree-delete',
|
|
2827 |
+ and `magit-worktree-status'.
|
|
2828 |
+
|
|
2829 |
+* Added new section inserter `magit-insert-worktrees'
|
|
2830 |
+
|
|
2831 |
+* The command `magit-clone' now runs asynchronously, which avoids
|
|
2832 |
+ blocking Emacs and allows handling password prompts.
|
|
2833 |
+
|
|
2834 |
+* The command `magit-stage' learned to stage an untracked file while
|
|
2835 |
+ leaving its content unstaged (i.e. `git add --intent-to-add') when
|
|
2836 |
+ called with a prefix argument.
|
|
2837 |
+
|
|
2838 |
+* The command `magit-reverse' learned to use `--reject' to ensure that
|
|
2839 |
+ non-conflicting hunks are applied and that conflicting hunks are put
|
|
2840 |
+ into reject files.
|
|
2841 |
+
|
|
2842 |
+* When the command `magit-discard' is used on staged changes, then
|
|
2843 |
+ that is done by first reversing the changes in the index and then in
|
|
2844 |
+ the working tree. The second step could fail due to conflicts. Now
|
|
2845 |
+ the `--reject' argument is used, which ensures that non-conflicting
|
|
2846 |
+ hunks are applied and that conflicting hunks are put into reject
|
|
2847 |
+ files.
|
|
2848 |
+
|
|
2849 |
+* The command `magit-rebase-continue' learned to reuse the old commit
|
|
2850 |
+ message as-is when called with a prefix argument.
|
|
2851 |
+
|
|
2852 |
+* In the refs buffer symbolic refs, such as "remotes/origin/HEAD", are
|
|
2853 |
+ no longer omitted from the lists of local and remote branches.
|
|
2854 |
+
|
|
2855 |
+This release also contains the fixes described in the v2.6.1 and
|
|
2856 |
+v2.6.2 release notes, as well as various other documentation fixes,
|
|
2857 |
+code clean-ups, bug fixes, and other small to medium improvements.
|
|
2858 |
+
|
|
2859 |
+Authors
|
|
2860 |
+-------
|
|
2861 |
+
|
|
2862 |
+ 95 Jonas Bernoulli
|
|
2863 |
+ 10 Kyle Meyer
|
|
2864 |
+ 7 Noam Postavsky
|
|
2865 |
+ 1 Bart Bakker
|
|
2866 |
+ 1 Fritz Grabo
|
|
2867 |
+ 1 Ingo Lohmar
|
|
2868 |
+ 1 John Mastro
|
2767 | 2869 |
diff --git a/Documentation/magit-popup.org b/Documentation/magit-popup.org
|
2768 | 2870 |
new file mode 100644
|
2769 | |
index 0000000..7b1102e
|
|
2871 |
index 0000000..408654a
|
2770 | 2872 |
--- /dev/null
|
2771 | 2873 |
+++ b/Documentation/magit-popup.org
|
2772 | 2874 |
@@ -0,0 +1,632 @@
|
|
2779 | 2881 |
+#+TEXINFO_DIR_CATEGORY: Emacs
|
2780 | 2882 |
+#+TEXINFO_DIR_TITLE: Magit-Popup: (magit-popup).
|
2781 | 2883 |
+#+TEXINFO_DIR_DESC: Infix arguments with feedback
|
2782 | |
+#+SUBTITLE: for version 2.6
|
|
2884 |
+#+SUBTITLE: for version 2.7
|
2783 | 2885 |
+
|
2784 | 2886 |
+#+OPTIONS: H:4 num:3 toc:2
|
2785 | 2887 |
+
|
|
3404 | 3506 |
+# LocalWords: popups pre prepend
|
3405 | 3507 |
diff --git a/Documentation/magit.org b/Documentation/magit.org
|
3406 | 3508 |
new file mode 100644
|
3407 | |
index 0000000..7540e5b
|
|
3509 |
index 0000000..06dc359
|
3408 | 3510 |
--- /dev/null
|
3409 | 3511 |
+++ b/Documentation/magit.org
|
3410 | |
@@ -0,0 +1,6007 @@
|
|
3512 |
@@ -0,0 +1,6312 @@
|
3411 | 3513 |
+#+TITLE: Magit User Manual
|
3412 | 3514 |
+#+AUTHOR: Jonas Bernoulli
|
3413 | 3515 |
+#+EMAIL: jonas@bernoul.li
|
|
3417 | 3519 |
+#+TEXINFO_DIR_CATEGORY: Emacs
|
3418 | 3520 |
+#+TEXINFO_DIR_TITLE: Magit: (magit).
|
3419 | 3521 |
+#+TEXINFO_DIR_DESC: Using Git from Emacs with Magit.
|
3420 | |
+#+SUBTITLE: for version 2.6
|
|
3522 |
+#+SUBTITLE: for version 2.7
|
3421 | 3523 |
+
|
3422 | 3524 |
+#+OPTIONS: H:4 num:3 toc:2
|
3423 | 3525 |
+
|
|
5172 | 5274 |
+
|
5173 | 5275 |
+ Show log for the file visited in the current buffer.
|
5174 | 5276 |
+
|
|
5277 |
+Two additional commands that show the log for the file or blob that is
|
|
5278 |
+being visited in the current buffer exists, see [[*Minor mode for
|
|
5279 |
+buffers visiting files]].
|
|
5280 |
+
|
5175 | 5281 |
+*** Refreshing logs
|
5176 | 5282 |
+
|
5177 | 5283 |
+The prefix command ~magit-log-refresh-popup~, on ~L~, can be used to
|
|
5399 | 5505 |
+
|
5400 | 5506 |
+ Show all diffs of a stash in a buffer.
|
5401 | 5507 |
+
|
|
5508 |
+Two additional commands that show the diff for the file or blob that
|
|
5509 |
+is being visited in the current buffer exists, see [[*Minor mode for
|
|
5510 |
+buffers visiting files]].
|
|
5511 |
+
|
5402 | 5512 |
+*** Refreshing diffs
|
5403 | 5513 |
+
|
5404 | 5514 |
+The prefix command ~magit-diff-refresh-popup~, on ~D~, can be used to
|
|
5593 | 5703 |
+ be nil.
|
5594 | 5704 |
+
|
5595 | 5705 |
+** Ediffing
|
|
5706 |
+
|
|
5707 |
+This section describes how to enter Ediff from Magit buffers. For
|
|
5708 |
+information on how to use Ediff itself, see info:ediff.
|
5596 | 5709 |
+
|
5597 | 5710 |
+- Key: e, magit-ediff-dwim
|
5598 | 5711 |
+
|
|
6031 | 6144 |
+
|
6032 | 6145 |
+ Add the change at point to the staging area.
|
6033 | 6146 |
+
|
|
6147 |
+ With a prefix argument and an untracked file (or files) at point,
|
|
6148 |
+ stage the file but not its content. This makes it possible to stage
|
|
6149 |
+ only a subset of the new file's changes.
|
|
6150 |
+
|
6034 | 6151 |
+- Key: S, magit-stage-modified
|
6035 | 6152 |
+
|
6036 | 6153 |
+ Stage all changes to files modified in the worktree. Stage all new
|
|
6138 | 6255 |
+
|
6139 | 6256 |
+ Apply the change at point to the working tree.
|
6140 | 6257 |
+
|
|
6258 |
+ With a prefix argument fallback to a 3-way merge. Doing so causes
|
|
6259 |
+ the change to be applied to the index as well.
|
|
6260 |
+
|
6141 | 6261 |
+- Key: k, magit-discard
|
6142 | 6262 |
+
|
6143 | 6263 |
+ Remove the change at point from the working tree.
|
|
6145 | 6265 |
+- Key: v, magit-reverse
|
6146 | 6266 |
+
|
6147 | 6267 |
+ Reverse the change at point in the working tree.
|
|
6268 |
+
|
|
6269 |
+ With a prefix argument fallback to a 3-way merge. Doing so causes
|
|
6270 |
+ the change to be applied to the index as well.
|
6148 | 6271 |
+
|
6149 | 6272 |
+With a prefix argument all apply variants attempt a 3-way merge when
|
6150 | 6273 |
+appropriate (i.e. when ~git apply~ is used internally).
|
|
6503 | 6626 |
+
|
6504 | 6627 |
+** Branching
|
6505 | 6628 |
+
|
|
6629 |
+*** The two remotes
|
|
6630 |
+
|
6506 | 6631 |
+The upstream branch of some local branch is the branch into which the
|
6507 | 6632 |
+commits on that local branch should eventually be merged, usually
|
6508 | 6633 |
+something like ~origin/master~. For the ~master~ branch itself the
|
|
6539 | 6664 |
+It's fairly simple to configure these two remotes. The values of all
|
6540 | 6665 |
+the variables that are related to fetching, pulling, and pushing (as
|
6541 | 6666 |
+well as some other branch-related variables) can be inspected and
|
6542 | |
+changed in the branching popup. It is also possible to set the
|
6543 | |
+push-remote and/or upstream while pushing (see [[*Pushing]]).
|
|
6667 |
+changed using the popup ~magit-branch-config-popup~, which is a
|
|
6668 |
+sub-popup of many popups that deal with branches. It is also possible
|
|
6669 |
+to set the push-remote and/or upstream while pushing (see [[*Pushing]]).
|
|
6670 |
+
|
|
6671 |
+*** The branch popup
|
|
6672 |
+
|
|
6673 |
+The popup ~magit-branch-popup~ is used to create and checkout branches,
|
|
6674 |
+and to make changes to existing branches. It is not used to fetch,
|
|
6675 |
+pull, merge, rebase, or push branches, i.e. this popup deals with
|
|
6676 |
+branches themselves, not with the commits reachable from them. Those
|
|
6677 |
+features are available from separate popups.
|
6544 | 6678 |
+
|
6545 | 6679 |
+- Key: b, magit-branch-popup
|
6546 | 6680 |
+
|
6547 | 6681 |
+ This prefix command shows the following suffix commands in a popup
|
6548 | |
+ buffer. It also displays the values of the following variables and
|
6549 | |
+ allows changing their values.
|
|
6682 |
+ buffer.
|
|
6683 |
+
|
|
6684 |
+ By default it also displays the values of some branch-related Git
|
|
6685 |
+ variables and allows changing their values, just like the
|
|
6686 |
+ specialized ~magit-branch-config-popup~ does.
|
|
6687 |
+
|
|
6688 |
+- User Option: magit-branch-popup-show-variables
|
|
6689 |
+
|
|
6690 |
+ Whether the ~magit-branch-popup~ shows Git variables. This defaults
|
|
6691 |
+ to t to avoid changing key bindings. When set to nil, no variables
|
|
6692 |
+ are displayed directly in this popup, and the sub-popup
|
|
6693 |
+ ~magit-branch-config-popup~ has to be used indead to view and change
|
|
6694 |
+ branch related variables.
|
|
6695 |
+
|
|
6696 |
+- Key: b b, magit-checkout
|
|
6697 |
+
|
|
6698 |
+ Checkout a revision read in the minibuffer and defaulting to the
|
|
6699 |
+ branch or arbitrary revision at point. If the revision is a local
|
|
6700 |
+ branch then that becomes the current branch. If it is something
|
|
6701 |
+ else then ~HEAD~ becomes detached. Checkout fails if the working tree
|
|
6702 |
+ or the staging area contain changes.
|
|
6703 |
+
|
|
6704 |
+- Key: b n, magit-branch
|
|
6705 |
+
|
|
6706 |
+ Create a new branch. The user is asked for a branch or arbitrary
|
|
6707 |
+ revision to use as the starting point of the new branch. When a
|
|
6708 |
+ branch name is provided, then that becomes the upstream branch of
|
|
6709 |
+ the new branch. The name of the new branch is also read in the
|
|
6710 |
+ minibuffer.
|
|
6711 |
+
|
|
6712 |
+ Also see option ~magit-branch-prefer-remote-upstream~.
|
|
6713 |
+
|
|
6714 |
+- Key: b c, magit-branch-and-checkout
|
|
6715 |
+
|
|
6716 |
+ This command creates a new branch like ~magit-branch~, but then also
|
|
6717 |
+ checks it out.
|
|
6718 |
+
|
|
6719 |
+ Also see option ~magit-branch-prefer-remote-upstream~.
|
|
6720 |
+
|
|
6721 |
+- Key: b s, magit-branch-spinoff
|
|
6722 |
+
|
|
6723 |
+ This command creates and checks out a new branch starting at and
|
|
6724 |
+ tracking the current branch. That branch in turn is reset to the
|
|
6725 |
+ last commit it shares with its upstream. If the current branch has
|
|
6726 |
+ no upstream or no unpushed commits, then the new branch is created
|
|
6727 |
+ anyway and the previously current branch is not touched.
|
|
6728 |
+
|
|
6729 |
+ This is useful to create a feature branch after work has already
|
|
6730 |
+ began on the old branch (likely but not necessarily "master").
|
|
6731 |
+
|
|
6732 |
+ If the current branch is a member of the value of option
|
|
6733 |
+ ~magit-branch-prefer-remote-upstream~ (which see), then the current
|
|
6734 |
+ branch will be used as the starting point as usual, but the upstream
|
|
6735 |
+ of the starting-point may be used as the upstream of the new branch,
|
|
6736 |
+ instead of the starting-point itself.
|
|
6737 |
+
|
|
6738 |
+- Key: b x, magit-branch-reset
|
|
6739 |
+
|
|
6740 |
+ This command resets a branch, defaulting to the branch at point, to
|
|
6741 |
+ the tip of another branch or any other commit.
|
|
6742 |
+
|
|
6743 |
+ When the branch being reset is the current branch, then a hard reset
|
|
6744 |
+ is performed. If there are any uncommitted changes, then the user
|
|
6745 |
+ has to confirming the reset because those changes would be lost.
|
|
6746 |
+
|
|
6747 |
+ This is useful when you have started work on a feature branch but
|
|
6748 |
+ realize it's all crap and want to start over.
|
|
6749 |
+
|
|
6750 |
+ When resetting to another branch and a prefix argument is used, then
|
|
6751 |
+ the target branch is set as the upstream of the branch that is being
|
|
6752 |
+ reset.
|
|
6753 |
+
|
|
6754 |
+- Key: b d, magit-branch-delete
|
|
6755 |
+
|
|
6756 |
+ Delete one or multiple branches. If the region marks multiple
|
|
6757 |
+ branches, then offer to delete those. Otherwise, prompt for a single
|
|
6758 |
+ branch to be deleted, defaulting to the branch at point.
|
|
6759 |
+
|
|
6760 |
+- Key: b r, magit-branch-rename
|
|
6761 |
+
|
|
6762 |
+ Rename a branch. The branch and the new name are read in the
|
|
6763 |
+ minibuffer. With prefix argument the branch is renamed even if that
|
|
6764 |
+ name conflicts with an existing branch.
|
|
6765 |
+
|
|
6766 |
+- User Option: magit-branch-read-upstream-first
|
|
6767 |
+
|
|
6768 |
+ When creating a branch, whether to read the upstream branch before
|
|
6769 |
+ the name of the branch that is to be created. The default is ~nil~,
|
|
6770 |
+ and I recommend you leave it at that.
|
|
6771 |
+
|
|
6772 |
+- User Option: magit-branch-prefer-remote-upstream
|
|
6773 |
+
|
|
6774 |
+ This option specifies whether remote upstreams are favored over
|
|
6775 |
+ local upstreams when creating new branches.
|
|
6776 |
+
|
|
6777 |
+ When a new branch is created, Magit offers the branch, commit, or
|
|
6778 |
+ stash as the default starting point of the new branch. If there is
|
|
6779 |
+ no such thing at point, then it falls back to offer the current
|
|
6780 |
+ branch as starting-point. The user may then accept that default or
|
|
6781 |
+ pick something else.
|
|
6782 |
+
|
|
6783 |
+ If the chosen starting-point is a branch, then it may also be set
|
|
6784 |
+ as the upstream of the new branch, depending on the value of the
|
|
6785 |
+ Git variable `branch.autoSetupMerge'. By default this is done
|
|
6786 |
+ for remote branches, but not for local branches.
|
|
6787 |
+
|
|
6788 |
+ You might prefer to always use some remote branch as upstream.
|
|
6789 |
+ If the chosen starting-point is (1) a local branch, (2) whose
|
|
6790 |
+ name is a member of the value of this option, (3) the upstream of
|
|
6791 |
+ that local branch is a remote branch with the same name, and (4)
|
|
6792 |
+ that remote branch can be fast-forwarded to the local branch,
|
|
6793 |
+ then the chosen branch is used as starting-point, but its own
|
|
6794 |
+ upstream is used as the upstream of the new branch.
|
|
6795 |
+
|
|
6796 |
+ Assuming the chosen branch matches these conditions you would end
|
|
6797 |
+ up with with e.g.:
|
|
6798 |
+
|
|
6799 |
+ #+BEGIN_SRC text
|
|
6800 |
+ feature --upstream--> origin/master
|
|
6801 |
+ #+END_SRC
|
|
6802 |
+
|
|
6803 |
+ instead of
|
|
6804 |
+
|
|
6805 |
+ #+BEGIN_SRC text
|
|
6806 |
+ feature --upstream--> master --upstream--> origin/master
|
|
6807 |
+ #+END_SRC
|
|
6808 |
+
|
|
6809 |
+ Which you prefer is a matter of personal preference. If you do
|
|
6810 |
+ prefer the former, then you should add branches such as ~master~,
|
|
6811 |
+ ~next~, and ~maint~ to the value of this options.
|
|
6812 |
+
|
|
6813 |
+*** The branch config popup
|
|
6814 |
+
|
|
6815 |
+- Command: magit-branch-popup
|
|
6816 |
+
|
|
6817 |
+ This prefix command shows the following branch-related Git variables
|
|
6818 |
+ in a popup buffer. The values can be changed from that buffer.
|
|
6819 |
+
|
|
6820 |
+ This popup is a sub-popup of several popups that deal with branches,
|
|
6821 |
+ including ~magit-branch-popup~, ~magit-pull-popup~, ~magit-fetch-popup~,
|
|
6822 |
+ ~magit-pull-and-fetch-popup~, and ~magit-push-popup~. In all of these
|
|
6823 |
+ popups "C" is bound to this popup.
|
6550 | 6824 |
+
|
6551 | 6825 |
+The following variables are used to configure a specific branch. The
|
6552 | 6826 |
+values are being displayed for the current branch (if any). To change
|
6553 | |
+the value for another branch use a prefix argument.
|
|
6827 |
+the value for another branch invoke ~magit-branch-config-popup~ with a
|
|
6828 |
+prefix argument.
|
6554 | 6829 |
+
|
6555 | 6830 |
+- Variable: branch.NAME.merge
|
6556 | 6831 |
+
|
|
6671 | 6946 |
+ ~magit-read-starting-point~, which includes all commands that change
|
6672 | 6947 |
+ the upstream and many which create new branches.
|
6673 | 6948 |
+
|
6674 | |
+- Key: b b, magit-checkout
|
6675 | |
+
|
6676 | |
+ Checkout a revision read in the minibuffer and defaulting to the
|
6677 | |
+ branch or arbitrary revision at point. If the revision is a local
|
6678 | |
+ branch then that becomes the current branch. If it is something
|
6679 | |
+ else then ~HEAD~ becomes detached. Checkout fails if the working tree
|
6680 | |
+ or the staging area contain changes.
|
6681 | |
+
|
6682 | |
+- Key: b n, magit-branch
|
6683 | |
+
|
6684 | |
+ Create a new branch. The user is asked for a branch or arbitrary
|
6685 | |
+ revision to use as the starting point of the new branch. When a
|
6686 | |
+ branch name is provided, then that becomes the upstream branch of
|
6687 | |
+ the new branch. The name of the new branch is also read in the
|
6688 | |
+ minibuffer.
|
6689 | |
+
|
6690 | |
+ Also see option ~magit-branch-prefer-remote-upstream~.
|
6691 | |
+
|
6692 | |
+- Key: b c, magit-branch-and-checkout
|
6693 | |
+
|
6694 | |
+ This command creates a new branch like ~magit-branch~, but then also
|
6695 | |
+ checks it out.
|
6696 | |
+
|
6697 | |
+ Also see option ~magit-branch-prefer-remote-upstream~.
|
6698 | |
+
|
6699 | |
+- Key: b s, magit-branch-spinoff
|
6700 | |
+
|
6701 | |
+ This command creates and checks out a new branch starting at and
|
6702 | |
+ tracking the current branch. That branch in turn is reset to the
|
6703 | |
+ last commit it shares with its upstream. If the current branch has
|
6704 | |
+ no upstream or no unpushed commits, then the new branch is created
|
6705 | |
+ anyway and the previously current branch is not touched.
|
6706 | |
+
|
6707 | |
+ This is useful to create a feature branch after work has already
|
6708 | |
+ began on the old branch (likely but not necessarily "master").
|
6709 | |
+
|
6710 | |
+ If the current branch is a member of the value of option
|
6711 | |
+ ~magit-branch-prefer-remote-upstream~ (which see), then the current
|
6712 | |
+ branch will be used as the starting point as usual, but the upstream
|
6713 | |
+ of the starting-point may be used as the upstream of the new branch,
|
6714 | |
+ instead of the starting-point itself.
|
6715 | |
+
|
6716 | |
+- Key: b x, magit-branch-reset
|
6717 | |
+
|
6718 | |
+ This command resets a branch, defaulting to the branch at point, to
|
6719 | |
+ the tip of another branch or any other commit.
|
6720 | |
+
|
6721 | |
+ When the branch being reset is the current branch, then a hard reset
|
6722 | |
+ is performed. If there are any uncommitted changes, then the user
|
6723 | |
+ has to confirming the reset because those changes would be lost.
|
6724 | |
+
|
6725 | |
+ This is useful when you have started work on a feature branch but
|
6726 | |
+ realize it's all crap and want to start over.
|
6727 | |
+
|
6728 | |
+ When resetting to another branch and a prefix argument is used, then
|
6729 | |
+ the target branch is set as the upstream of the branch that is being
|
6730 | |
+ reset.
|
6731 | |
+
|
6732 | |
+- Key: b d, magit-branch-delete
|
6733 | |
+
|
6734 | |
+ Delete one or multiple branches. If the region marks multiple
|
6735 | |
+ branches, then offer to delete those. Otherwise, prompt for a single
|
6736 | |
+ branch to be deleted, defaulting to the branch at point.
|
6737 | |
+
|
6738 | |
+- Key: b r, magit-branch-rename
|
6739 | |
+
|
6740 | |
+ Rename a branch. The branch and the new name are read in the
|
6741 | |
+ minibuffer. With prefix argument the branch is renamed even if that
|
6742 | |
+ name conflicts with an existing branch.
|
6743 | |
+
|
6744 | |
+- User Option: magit-branch-read-upstream-first
|
6745 | |
+
|
6746 | |
+ When creating a branch, whether to read the upstream branch before
|
6747 | |
+ the name of the branch that is to be created. The default is ~nil~,
|
6748 | |
+ and I recommend you leave it at that.
|
6749 | |
+
|
6750 | |
+- User Option: magit-branch-prefer-remote-upstream
|
6751 | |
+
|
6752 | |
+ This option specifies whether remote upstreams are favored over
|
6753 | |
+ local upstreams when creating new branches.
|
6754 | |
+
|
6755 | |
+ When a new branch is created, Magit offers the branch, commit, or
|
6756 | |
+ stash as the default starting point of the new branch. If there is
|
6757 | |
+ no such thing at point, then it falls back to offer the current
|
6758 | |
+ branch as starting-point. The user may then accept that default or
|
6759 | |
+ pick something else.
|
6760 | |
+
|
6761 | |
+ If the chosen starting-point is a branch, then it may also be set
|
6762 | |
+ as the upstream of the new branch, depending on the value of the
|
6763 | |
+ Git variable `branch.autoSetupMerge'. By default this is done
|
6764 | |
+ for remote branches, but not for local branches.
|
6765 | |
+
|
6766 | |
+ You might prefer to always use some remote branch as upstream.
|
6767 | |
+ If the chosen starting-point is (1) a local branch, (2) whose
|
6768 | |
+ name is a member of the value of this option, (3) the upstream of
|
6769 | |
+ that local branch is a remote branch with the same name, and (4)
|
6770 | |
+ that remote branch can be fast-forwarded to the local branch,
|
6771 | |
+ then the chosen branch is used as starting-point, but its own
|
6772 | |
+ upstream is used as the upstream of the new branch.
|
6773 | |
+
|
6774 | |
+ Assuming the chosen branch matches these conditions you would end
|
6775 | |
+ up with with e.g.:
|
6776 | |
+
|
6777 | |
+ #+BEGIN_SRC text
|
6778 | |
+ feature --upstream--> origin/master
|
6779 | |
+ #+END_SRC
|
6780 | |
+
|
6781 | |
+ instead of
|
6782 | |
+
|
6783 | |
+ #+BEGIN_SRC text
|
6784 | |
+ feature --upstream--> master --upstream--> origin/master
|
6785 | |
+ #+END_SRC
|
6786 | |
+
|
6787 | |
+ Which you prefer is a matter of personal preference. If you do
|
6788 | |
+ prefer the former, then you should add branches such as ~master~,
|
6789 | |
+ ~next~, and ~maint~ to the value of this options.
|
6790 | |
+
|
6791 | 6949 |
+** Merging
|
6792 | 6950 |
+
|
6793 | |
+Also see [[info:gitman#git-merge]].
|
|
6951 |
+Also see [[info:gitman#git-merge]]. For information on how to resolve
|
|
6952 |
+merge conflicts see the next section.
|
6794 | 6953 |
+
|
6795 | 6954 |
+- Key: m, magit-merge-popup
|
6796 | 6955 |
+
|
|
6844 | 7003 |
+
|
6845 | 7004 |
+ Abort the current merge operation.
|
6846 | 7005 |
+
|
|
7006 |
+** Resolving conflicts
|
|
7007 |
+
|
|
7008 |
+When merging branches (or otherwise combining or changing history)
|
|
7009 |
+conflicts can occur. If you edited two completely different parts of
|
|
7010 |
+the same file in two branches and then merge one of these branches
|
|
7011 |
+into the other, then Git can resolve that on its own, but if you edit
|
|
7012 |
+the same area of a file, then a human is required to decide how the
|
|
7013 |
+two versions, or "sides of the conflict", are to be combined into one.
|
|
7014 |
+
|
|
7015 |
+Here we can only provide a brief introduction to the subject and point
|
|
7016 |
+you toward some tools that can help. If you are new to this, then
|
|
7017 |
+please also consult Git's own documentation as well as other
|
|
7018 |
+resources.
|
|
7019 |
+
|
|
7020 |
+If a file has conflicts and Git cannot resolve them by itself, then it
|
|
7021 |
+puts both versions into the affected file along with special markers
|
|
7022 |
+whose purpose is to denote the boundaries of the unresolved part of
|
|
7023 |
+the file and between the different versions. These boundary lines
|
|
7024 |
+begin with the strings "<<<<<<<", "|||||||", "=======", and ">>>>>>>"
|
|
7025 |
+and are followed by information about the source of the respective
|
|
7026 |
+versions, e.g.:
|
|
7027 |
+
|
|
7028 |
+#+BEGIN_SRC undefined
|
|
7029 |
+ <<<<<<< HEAD
|
|
7030 |
+ Take the blue pill.
|
|
7031 |
+ =======
|
|
7032 |
+ Take the red pill.
|
|
7033 |
+ >>>>>>> feature
|
|
7034 |
+#+END_SRC
|
|
7035 |
+
|
|
7036 |
+In this case you have chosen to take the red pill on one bracnh and on
|
|
7037 |
+another you picked the blue pill. Now that you are merging these two
|
|
7038 |
+diverging branches, Git cannot possibly know which pill you want to
|
|
7039 |
+take.
|
|
7040 |
+
|
|
7041 |
+To resolve that conflict you have to create a version of the affected
|
|
7042 |
+area of the file by keeping only one of the sides, possibly by editing
|
|
7043 |
+it in order to bring in the changes from the other side, remove the
|
|
7044 |
+other versions as well as the markers, and then stage the result. A
|
|
7045 |
+possible resolution might be:
|
|
7046 |
+
|
|
7047 |
+#+BEGIN_SRC undefined
|
|
7048 |
+ Take both pills.
|
|
7049 |
+#+END_SRC
|
|
7050 |
+
|
|
7051 |
+Often it is useful to see not only the two sides of the conflict but
|
|
7052 |
+also the "original" version from before the same area of the file was
|
|
7053 |
+modified twice on different branches. Instruct Git to insert that
|
|
7054 |
+version as well by running this command once:
|
|
7055 |
+
|
|
7056 |
+#+BEGIN_SRC shell
|
|
7057 |
+ git config --global merge.conflictStyle diff3
|
|
7058 |
+#+END_SRC
|
|
7059 |
+
|
|
7060 |
+The above conflict might then have looked like this:
|
|
7061 |
+
|
|
7062 |
+#+BEGIN_SRC undefined
|
|
7063 |
+ <<<<<<< HEAD
|
|
7064 |
+ Take the blue pill.
|
|
7065 |
+ ||||||| merged common ancestors
|
|
7066 |
+ Take either the blue or the red pill, but not both.
|
|
7067 |
+ =======
|
|
7068 |
+ Take the red pill.
|
|
7069 |
+ >>>>>>> feature
|
|
7070 |
+#+END_SRC
|
|
7071 |
+
|
|
7072 |
+If that were the case, then the above conflict resolution would not
|
|
7073 |
+have been correct, which demonstrates why seeing the original version
|
|
7074 |
+alongside the conflicting versions can be useful.
|
|
7075 |
+
|
|
7076 |
+You can perform the conflict resolution completely by hand, but Emacs
|
|
7077 |
+also provides some packages that help in the process: Smerge, Ediff
|
|
7078 |
+(info:ediff), and Emerge (info:emacs#Emerge). Magit does not provide
|
|
7079 |
+its own tools for conflict resolution, but it does make using Smerge
|
|
7080 |
+and Ediff more convenient. (Ediff supersedes Emerge, so you probably
|
|
7081 |
+don't want to use the latter anyway.)
|
|
7082 |
+
|
|
7083 |
+In the Magit status buffer, files with unresolved conflicts are listed
|
|
7084 |
+in the "Unstaged changes" and/or "Staged changes" sections. They are
|
|
7085 |
+prefixed with the word "unmerged", which in this context essentially
|
|
7086 |
+is a synonym for "unresolved".
|
|
7087 |
+
|
|
7088 |
+Pressing ~RET~ while point is on such a file section shows a buffer
|
|
7089 |
+visiting that file, turns on ~smerge-mode~ in that buffer, and places
|
|
7090 |
+point inside the first area with conflicts. You should then resolve
|
|
7091 |
+that conflict using regular edit commands and/or Smerge commands.
|
|
7092 |
+
|
|
7093 |
+Unfortunately Smerge does not have a manual, but you can get a list of
|
|
7094 |
+commands and binding ~C-c ^ C-h~ and press ~RET~ while point is on a
|
|
7095 |
+command name to read its documentation.
|
|
7096 |
+
|
|
7097 |
+Normally you would edit one version and then tell Smerge to keep only
|
|
7098 |
+that version. Use ~C-c ^ m~ (~smerge-keep-mine)~ to keep the "HEAD"
|
|
7099 |
+version or ~C-c ^ o~ (~smerge-keep-other~) to keep the version that
|
|
7100 |
+follows "|||||||". Then use ~C-c ^ n~ to move to the next conflicting
|
|
7101 |
+area in the same file. Once you are done resolving conflicts, return
|
|
7102 |
+to the Magit status buffer. The file should now be shown as
|
|
7103 |
+"modified", no longer as "unmerged", because Smerge automatically
|
|
7104 |
+stages the file when you save the buffer after resolving the last
|
|
7105 |
+conflict.
|
|
7106 |
+
|
|
7107 |
+Alternatively you could use Ediff, which uses separate buffers for the
|
|
7108 |
+different versions of the file. To resolve conflicts in a file using
|
|
7109 |
+Ediff press ~e~ while point is on such a file in the status buffer.
|
|
7110 |
+
|
|
7111 |
+Ediff can be used for other purposes as well. For more information on
|
|
7112 |
+how to enter Ediff from Magit, see [[*Ediffing]]. Explaining how to use
|
|
7113 |
+Ediff is beyond the scope of this manual, instead see info:ediff.
|
|
7114 |
+
|
|
7115 |
+If you are unsure whether you should Smerge or Ediff, then use the
|
|
7116 |
+former. It is much easier to understand and use, and except for
|
|
7117 |
+truely complex conflicts, the latter is usually overkill.
|
|
7118 |
+
|
6847 | 7119 |
+** Rebasing
|
6848 | 7120 |
+
|
6849 | |
+Also see [[info:gitman#git-rebase]].
|
|
7121 |
+Also see [[info:gitman#git-rebase]]. For information on how to resolve
|
|
7122 |
+conflicts that occur during rebases see the preceding section.
|
6850 | 7123 |
+
|
6851 | 7124 |
+- Key: r, magit-rebase-popup
|
6852 | 7125 |
+
|
|
6855 | 7128 |
+
|
6856 | 7129 |
+When no rebase is in progress, then the popup buffer features the
|
6857 | 7130 |
+following commands.
|
|
7131 |
+
|
|
7132 |
+Using one of these commands /starts/ a rebase sequence. Git might then
|
|
7133 |
+stop somewhere along the way, either because you told it to do so, or
|
|
7134 |
+because applying a commit failed due to a conflict. When that
|
|
7135 |
+happens, then the status buffer shows information about the rebase
|
|
7136 |
+sequence which is in progress in a section similar to a log section.
|
|
7137 |
+See [[*Information about in-progress rebase]].
|
6858 | 7138 |
+
|
6859 | 7139 |
+- Key: r p, magit-rebase-onto-pushremote
|
6860 | 7140 |
+
|
|
6916 | 7196 |
+
|
6917 | 7197 |
+ Restart the current rebasing operation.
|
6918 | 7198 |
+
|
|
7199 |
+ In some cases this pops up a commit message buffer for you do edit.
|
|
7200 |
+ With a prefix argument the old message is reused as-is.
|
|
7201 |
+
|
6919 | 7202 |
+- Key: r s, magit-rebase-skip
|
6920 | 7203 |
+
|
6921 | 7204 |
+ Skip the current commit and restart the current rebase operation.
|
|
6933 | 7216 |
+- Key: C-c C-c, with-editor-finish
|
6934 | 7217 |
+
|
6935 | 7218 |
+ Finish the current editing session by returning with exit code 0.
|
6936 | |
+ Git then creates the commit using the message it finds in the file.
|
|
7219 |
+ Git then uses the rebase instructions it finds in the file.
|
6937 | 7220 |
+
|
6938 | 7221 |
+- Key: C-c C-k, with-editor-cancel
|
6939 | 7222 |
+
|
6940 | 7223 |
+ Cancel the current editing session by returning with exit code 1.
|
6941 | |
+ Git then cancels the commit, but leaves the file untouched.
|
|
7224 |
+ Git then forgoes starting the rebase sequence.
|
6942 | 7225 |
+
|
6943 | 7226 |
+- Key: RET, git-rebase-show-commit
|
6944 | 7227 |
+
|
|
7029 | 7312 |
+- User Option: git-rebase-confirm-cancel
|
7030 | 7313 |
+
|
7031 | 7314 |
+ Whether confirmation is required to cancel.
|
7032 | |
+*** Rebase sequence log
|
|
7315 |
+
|
|
7316 |
+*** Information about in-progress rebase
|
7033 | 7317 |
+
|
7034 | 7318 |
+While a rebase sequence is in progress, the status buffer features a
|
7035 | 7319 |
+section which lists the commits that have already been applied as well
|
|
7103 | 7387 |
+ indicates that you reset to an earlier commit (and that this commit
|
7104 | 7388 |
+ therefore is no longer reachable from ~HEAD~), but that it might still
|
7105 | 7389 |
+ be possible to create a new commit with the exact same tree or at
|
7106 | |
+ least the same patch-id, without manually editing any file. Or at
|
7107 | |
+ the very least that there are some uncommitted remaining, which
|
7108 | |
+ may or may not originate from that commit.
|
|
7390 |
+ least the same patch-id [fn:patch-id], without manually editing any
|
|
7391 |
+ file. Or at the very least that there are some uncommitted
|
|
7392 |
+ remaining, which may or may not originate from that commit.
|
7109 | 7393 |
+
|
7110 | 7394 |
+ - When a commit is prefixed with ~goal~, then that indicates that it
|
7111 | 7395 |
+ is still possible to create a commit with the exact same tree
|
|
7154 | 7438 |
+other actions such as "rewording", and they do not keep track of the
|
7155 | 7439 |
+commits which have already been applied.
|
7156 | 7440 |
+
|
|
7441 |
+[fn:patch-id] The patch-id is a hash of the /changes/ introduced by
|
|
7442 |
+commit. It differs from hash of the commit itself, which is a hash of
|
|
7443 |
+the result of applying that change (i.e. the resulting trees and
|
|
7444 |
+blobs) as well as author and committer information, the commit
|
|
7445 |
+message, and the hashes of the parents of the commit. The patch-id
|
|
7446 |
+hash on the other hand is created only from the added and removed
|
|
7447 |
+lines, even line numbers and whitespace are created when calculating
|
|
7448 |
+the hash. The patch-ids of two commits can be used to answer the
|
|
7449 |
+question "Do these two commits make the same change?".
|
|
7450 |
+
|
7157 | 7451 |
+** Cherry picking
|
7158 | 7452 |
+
|
7159 | 7453 |
+Also see [[info:gitman#git-cherry-pick]].
|
|
7782 | 8076 |
+- Key: o i, magit-submodule-init
|
7783 | 8077 |
+
|
7784 | 8078 |
+ Unregister the submodule at PATH.
|
|
8079 |
+
|
|
8080 |
+** Subtree
|
|
8081 |
+
|
|
8082 |
+Also see [[info:gitman#git-subtree]].
|
|
8083 |
+
|
|
8084 |
+- Key: O, magit-tree-popup
|
|
8085 |
+
|
|
8086 |
+ This prefix command shows the following suffix commands along with
|
|
8087 |
+ the appropriate infix arguments in a popup buffer.
|
|
8088 |
+
|
|
8089 |
+Most infix arguments only apply to some of the ~git subtree~
|
|
8090 |
+subcommands. When an argument that does not apply to the invoked
|
|
8091 |
+command is set, then it is silently ignored.
|
|
8092 |
+
|
|
8093 |
+When the ~--prefix~ argument is set in the popup buffer, then that is
|
|
8094 |
+used. Otherwise the prefix is read in the minibuffer.
|
|
8095 |
+
|
|
8096 |
+- Key: O a, magit-subtree-add
|
|
8097 |
+
|
|
8098 |
+ Add COMMIT from REPOSITORY as a new subtree at PREFIX.
|
|
8099 |
+
|
|
8100 |
+- Key: O c, magit-subtree-add-commit
|
|
8101 |
+
|
|
8102 |
+ Add COMMIT as a new subtree at PREFIX.
|
|
8103 |
+
|
|
8104 |
+- Key: O m, magit-subtree-merge
|
|
8105 |
+
|
|
8106 |
+ Merge COMMIT into the PREFIX subtree.
|
|
8107 |
+
|
|
8108 |
+- Key: O f, magit-subtree-pull
|
|
8109 |
+
|
|
8110 |
+ Pull COMMIT from REPOSITORY into the PREFIX subtree.
|
|
8111 |
+
|
|
8112 |
+- Key: O p, magit-subtree-push
|
|
8113 |
+
|
|
8114 |
+ Extract the history of the subtree PREFIX and push it to REF on
|
|
8115 |
+ REPOSITORY.
|
|
8116 |
+
|
|
8117 |
+- Key: O s, magit-subtree-split
|
|
8118 |
+
|
|
8119 |
+ Extract the history of the subtree PREFIX.
|
7785 | 8120 |
+
|
7786 | 8121 |
+** Common commands
|
7787 | 8122 |
+
|
|
7980 | 8315 |
+using ~global-magit-file-mode~. Currently this mode only establishes a
|
7981 | 8316 |
+few key bindings, but this might be extended in the future.
|
7982 | 8317 |
+
|
7983 | |
+- User Option: global-magit-file-mode
|
|
8318 |
+- User Option: magit-file-mode
|
7984 | 8319 |
+
|
7985 | 8320 |
+ Whether to establish certain Magit key bindings in all file-visiting
|
7986 | 8321 |
+ buffers belonging to a Git repository. This establishes the
|
|
8005 | 8340 |
+ This prefix command shows suffix commands along with the appropriate
|
8006 | 8341 |
+ infix arguments in a popup buffer. See [[*Initiating a commit]].
|
8007 | 8342 |
+
|
8008 | |
+- Key: C-c M-g d, magit-diff-buffer-file-popup
|
|
8343 |
+- Key: C-c M-g D, magit-diff-buffer-file-popup
|
8009 | 8344 |
+
|
8010 | 8345 |
+ This prefix command shows the same suffix commands and infix
|
8011 | 8346 |
+ arguments in a popup buffer as ~magit-diff-popup~. But this variant
|
8012 | 8347 |
+ has to be called from a file-visiting buffer and the visited file
|
8013 | 8348 |
+ is automatically used in the popup to limit the diff to that file.
|
8014 | 8349 |
+
|
|
8350 |
+- Key: C-c M-g d, magit-diff-buffer-file
|
|
8351 |
+
|
|
8352 |
+ This command shows the diff for the file of blob that the current
|
|
8353 |
+ buffer visits. Renames are followed when a prefix argument is used
|
|
8354 |
+ or when ~--follow~ is part of ~magit-diff-arguments~.
|
|
8355 |
+
|
|
8356 |
+- User Option: magit-diff-buffer-file-locked
|
|
8357 |
+
|
|
8358 |
+ This option controls whether ~magit-diff-buffer-file~ uses a decicated
|
|
8359 |
+ buffer. See [[*Modes and Buffers]].
|
|
8360 |
+
|
|
8361 |
+- Key: C-c M-g L, magit-log-buffer-file-popup
|
|
8362 |
+
|
|
8363 |
+ This prefix command shows the same suffix commands and infix
|
|
8364 |
+ arguments in a popup buffer as ~magit-log-popup~. But this variant
|
|
8365 |
+ has to be called from a file-visiting buffer and the visited file
|
|
8366 |
+ is automatically used in the popup to limit the log to that file.
|
|
8367 |
+
|
8015 | 8368 |
+- Key: C-c M-g l, magit-log-buffer-file
|
8016 | 8369 |
+
|
8017 | 8370 |
+ This command shows the log for the file of blob that the current
|
8018 | 8371 |
+ buffer visits. Renames are followed when a prefix argument is used
|
8019 | 8372 |
+ or when ~--follow~ is part of ~magit-log-arguments~.
|
|
8373 |
+
|
|
8374 |
+- User Option: magit-log-buffer-file-locked
|
|
8375 |
+
|
|
8376 |
+ This option controls whether ~magit-log-buffer-file~ uses a decicated
|
|
8377 |
+ buffer. See [[*Modes and Buffers]].
|
8020 | 8378 |
+
|
8021 | 8379 |
+- Key: C-c M-g b, magit-blame-popup
|
8022 | 8380 |
+
|
|
8347 | 8705 |
+but doing it this way has the advantage that you usually get to see
|
8348 | 8706 |
+the diff, which is useful because it increases the odds that you spot
|
8349 | 8707 |
+potential issues.
|
|
8708 |
+
|
|
8709 |
+**** The built-in VC Package
|
|
8710 |
+:PROPERTIES:
|
|
8711 |
+:NONODE: t
|
|
8712 |
+:END:
|
|
8713 |
+
|
|
8714 |
+Emacs comes with a version control interface called "VC", see
|
|
8715 |
+[[info:emacs#Version Control]]. It is enabled be default and if you don't
|
|
8716 |
+use it in addition to Magit, then you should disable it to keep it
|
|
8717 |
+from performing unnecessary work:
|
|
8718 |
+
|
|
8719 |
+#+BEGIN_SRC emacs-lisp
|
|
8720 |
+ (setq vc-handled-backends nil)
|
|
8721 |
+#+END_SRC
|
|
8722 |
+
|
|
8723 |
+You can also disable its use only for Git but keep using it when using
|
|
8724 |
+another version control system:
|
|
8725 |
+
|
|
8726 |
+#+BEGIN_SRC emacs-lisp
|
|
8727 |
+ (setq vc-handled-backends (delq 'Git vc-handled-backends))
|
|
8728 |
+#+END_SRC
|
8350 | 8729 |
+
|
8351 | 8730 |
+* Plumbing
|
8352 | 8731 |
+
|
|
9313 | 9692 |
+ (lambda ()
|
9314 | 9693 |
+ (when (or git-commit-mode git-rebase-mode)
|
9315 | 9694 |
+ (pointback-mode -1))))
|
|
9695 |
+#+END_SRC
|
|
9696 |
+
|
|
9697 |
+** The mode-line information isn't always up-to-date
|
|
9698 |
+
|
|
9699 |
+Magit is not responsible for the version control information that is
|
|
9700 |
+being displayed in the mode-line and looks something like ~Git-master~.
|
|
9701 |
+The built-in "Version Control" package, also known as "VC", updates
|
|
9702 |
+that information, and can be told to do so more often:
|
|
9703 |
+
|
|
9704 |
+#+BEGIN_SRC emacs-lisp
|
|
9705 |
+ (setq auto-revert-check-vc-info t)
|
|
9706 |
+#+END_SRC
|
|
9707 |
+
|
|
9708 |
+But doing so isn't good for performance. For more (overly optimistic)
|
|
9709 |
+information see [[info:emacs#VC Mode Line]].
|
|
9710 |
+
|
|
9711 |
+If you don't really care about seeing that information in the
|
|
9712 |
+mode-line, but just don't want to see /incorrect/ information, then
|
|
9713 |
+consider disabling VC when using Git:
|
|
9714 |
+
|
|
9715 |
+#+BEGIN_SRC emacs-lisp
|
|
9716 |
+ (setq vc-handled-backends (delq 'Git vc-handled-backends))
|
|
9717 |
+#+END_SRC
|
|
9718 |
+
|
|
9719 |
+Or to disable it completely:
|
|
9720 |
+
|
|
9721 |
+#+BEGIN_SRC emacs-lisp
|
|
9722 |
+ (setq vc-handled-backends nil)
|
9316 | 9723 |
+#+END_SRC
|
9317 | 9724 |
+
|
9318 | 9725 |
+** Can Magit be used as ~ediff-version-control-package~?
|
|
9366 | 9773 |
+~tramp-ssh-controlmaster-options~. Changing your DNS server (e.g. to
|
9367 | 9774 |
+Google's ~8.8.8.8~) may also be sufficient to work around the issue.
|
9368 | 9775 |
+
|
9369 | |
+** ~Symbol's value as function is void --some~
|
|
9776 |
+** Symbol's value as function is void ~--some~
|
9370 | 9777 |
+
|
9371 | 9778 |
+Update ~dash~, restart Emacs, and then it will be defined.
|
9372 | 9779 |
+
|
|
9475 | 9882 |
+---- now delete this line and everything above ----
|
9476 | 9883 |
diff --git a/t/magit-tests.el b/t/magit-tests.el
|
9477 | 9884 |
new file mode 100644
|
9478 | |
index 0000000..d9044d7
|
|
9885 |
index 0000000..11067ee
|
9479 | 9886 |
--- /dev/null
|
9480 | 9887 |
+++ b/t/magit-tests.el
|
9481 | 9888 |
@@ -0,0 +1,265 @@
|
|
9498 | 9905 |
+ (let ((dir (make-symbol "dir")))
|
9499 | 9906 |
+ `(let ((,dir (file-name-as-directory (make-temp-file "magit-" t)))
|
9500 | 9907 |
+ (process-environment process-environment))
|
9501 | |
+ (setenv "GIT_AUTHOR_NAME" "A U Thor")
|
9502 | |
+ (setenv "GIT_AUTHOR_EMAIL" "a.u.thor@example.com")
|
|
9908 |
+ (push "GIT_AUTHOR_NAME=A U Thor" process-environment)
|
|
9909 |
+ (push "GIT_AUTHOR_EMAIL=a.u.thor@example.com" process-environment)
|
9503 | 9910 |
+ (condition-case err
|
9504 | 9911 |
+ (cl-letf (((symbol-function #'message) (lambda (&rest _))))
|
9505 | 9912 |
+ (let ((default-directory ,dir))
|