Codebase list magit / 9f8247f
Update patches to 2.7.0 Rémi Vanicat 7 years ago
4 changed file(s) with 560 addition(s) and 153 deletion(s). Raw diff Collapse all Expand all
4141 Documentation/RelNotes/2.6.0.txt | 147 +
4242 Documentation/RelNotes/2.6.1.txt | 40 +
4343 Documentation/RelNotes/2.6.2.txt | 52 +
44 Documentation/RelNotes/2.7.0.txt | 94 +
4445 Documentation/magit-popup.org | 632 ++++
45 Documentation/magit.org | 6007 ++++++++++++++++++++++++++++++++++++++
46 Documentation/magit.org | 6312 ++++++++++++++++++++++++++++++++++++++
4647 ISSUE_TEMPLATE | 52 +
4748 t/magit-tests.el | 265 ++
48 33 files changed, 9466 insertions(+)
49 34 files changed, 9865 insertions(+)
4950 create mode 100644 CONTRIBUTING.md
5051 create mode 100644 Documentation/RelNotes/0.5.1.txt
5152 create mode 100644 Documentation/RelNotes/0.6.1.txt
7576 create mode 100644 Documentation/RelNotes/2.6.0.txt
7677 create mode 100644 Documentation/RelNotes/2.6.1.txt
7778 create mode 100644 Documentation/RelNotes/2.6.2.txt
79 create mode 100644 Documentation/RelNotes/2.7.0.txt
7880 create mode 100644 Documentation/magit-popup.org
7981 create mode 100644 Documentation/magit.org
8082 create mode 100644 ISSUE_TEMPLATE
27642766 + 1 John Mastro
27652767 + 1 Kyle Meyer
27662768 + 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
27672869 diff --git a/Documentation/magit-popup.org b/Documentation/magit-popup.org
27682870 new file mode 100644
2769 index 0000000..7b1102e
2871 index 0000000..408654a
27702872 --- /dev/null
27712873 +++ b/Documentation/magit-popup.org
27722874 @@ -0,0 +1,632 @@
27792881 +#+TEXINFO_DIR_CATEGORY: Emacs
27802882 +#+TEXINFO_DIR_TITLE: Magit-Popup: (magit-popup).
27812883 +#+TEXINFO_DIR_DESC: Infix arguments with feedback
2782 +#+SUBTITLE: for version 2.6
2884 +#+SUBTITLE: for version 2.7
27832885 +
27842886 +#+OPTIONS: H:4 num:3 toc:2
27852887 +
34043506 +# LocalWords: popups pre prepend
34053507 diff --git a/Documentation/magit.org b/Documentation/magit.org
34063508 new file mode 100644
3407 index 0000000..7540e5b
3509 index 0000000..06dc359
34083510 --- /dev/null
34093511 +++ b/Documentation/magit.org
3410 @@ -0,0 +1,6007 @@
3512 @@ -0,0 +1,6312 @@
34113513 +#+TITLE: Magit User Manual
34123514 +#+AUTHOR: Jonas Bernoulli
34133515 +#+EMAIL: jonas@bernoul.li
34173519 +#+TEXINFO_DIR_CATEGORY: Emacs
34183520 +#+TEXINFO_DIR_TITLE: Magit: (magit).
34193521 +#+TEXINFO_DIR_DESC: Using Git from Emacs with Magit.
3420 +#+SUBTITLE: for version 2.6
3522 +#+SUBTITLE: for version 2.7
34213523 +
34223524 +#+OPTIONS: H:4 num:3 toc:2
34233525 +
51725274 +
51735275 + Show log for the file visited in the current buffer.
51745276 +
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 +
51755281 +*** Refreshing logs
51765282 +
51775283 +The prefix command ~magit-log-refresh-popup~, on ~L~, can be used to
53995505 +
54005506 + Show all diffs of a stash in a buffer.
54015507 +
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 +
54025512 +*** Refreshing diffs
54035513 +
54045514 +The prefix command ~magit-diff-refresh-popup~, on ~D~, can be used to
55935703 + be nil.
55945704 +
55955705 +** 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.
55965709 +
55975710 +- Key: e, magit-ediff-dwim
55985711 +
60316144 +
60326145 + Add the change at point to the staging area.
60336146 +
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 +
60346151 +- Key: S, magit-stage-modified
60356152 +
60366153 + Stage all changes to files modified in the worktree. Stage all new
61386255 +
61396256 + Apply the change at point to the working tree.
61406257 +
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 +
61416261 +- Key: k, magit-discard
61426262 +
61436263 + Remove the change at point from the working tree.
61456265 +- Key: v, magit-reverse
61466266 +
61476267 + 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.
61486271 +
61496272 +With a prefix argument all apply variants attempt a 3-way merge when
61506273 +appropriate (i.e. when ~git apply~ is used internally).
65036626 +
65046627 +** Branching
65056628 +
6629 +*** The two remotes
6630 +
65066631 +The upstream branch of some local branch is the branch into which the
65076632 +commits on that local branch should eventually be merged, usually
65086633 +something like ~origin/master~. For the ~master~ branch itself the
65396664 +It's fairly simple to configure these two remotes. The values of all
65406665 +the variables that are related to fetching, pulling, and pushing (as
65416666 +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.
65446678 +
65456679 +- Key: b, magit-branch-popup
65466680 +
65476681 + 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.
65506824 +
65516825 +The following variables are used to configure a specific branch. The
65526826 +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.
65546829 +
65556830 +- Variable: branch.NAME.merge
65566831 +
66716946 + ~magit-read-starting-point~, which includes all commands that change
66726947 + the upstream and many which create new branches.
66736948 +
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 +
67916949 +** Merging
67926950 +
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.
67946953 +
67956954 +- Key: m, magit-merge-popup
67966955 +
68447003 +
68457004 + Abort the current merge operation.
68467005 +
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 +
68477119 +** Rebasing
68487120 +
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.
68507123 +
68517124 +- Key: r, magit-rebase-popup
68527125 +
68557128 +
68567129 +When no rebase is in progress, then the popup buffer features the
68577130 +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]].
68587138 +
68597139 +- Key: r p, magit-rebase-onto-pushremote
68607140 +
69167196 +
69177197 + Restart the current rebasing operation.
69187198 +
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 +
69197202 +- Key: r s, magit-rebase-skip
69207203 +
69217204 + Skip the current commit and restart the current rebase operation.
69337216 +- Key: C-c C-c, with-editor-finish
69347217 +
69357218 + 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.
69377220 +
69387221 +- Key: C-c C-k, with-editor-cancel
69397222 +
69407223 + 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.
69427225 +
69437226 +- Key: RET, git-rebase-show-commit
69447227 +
70297312 +- User Option: git-rebase-confirm-cancel
70307313 +
70317314 + Whether confirmation is required to cancel.
7032 +*** Rebase sequence log
7315 +
7316 +*** Information about in-progress rebase
70337317 +
70347318 +While a rebase sequence is in progress, the status buffer features a
70357319 +section which lists the commits that have already been applied as well
71037387 + indicates that you reset to an earlier commit (and that this commit
71047388 + therefore is no longer reachable from ~HEAD~), but that it might still
71057389 + 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.
71097393 +
71107394 + - When a commit is prefixed with ~goal~, then that indicates that it
71117395 + is still possible to create a commit with the exact same tree
71547438 +other actions such as "rewording", and they do not keep track of the
71557439 +commits which have already been applied.
71567440 +
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 +
71577451 +** Cherry picking
71587452 +
71597453 +Also see [[info:gitman#git-cherry-pick]].
77828076 +- Key: o i, magit-submodule-init
77838077 +
77848078 + 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.
77858120 +
77868121 +** Common commands
77878122 +
79808315 +using ~global-magit-file-mode~. Currently this mode only establishes a
79818316 +few key bindings, but this might be extended in the future.
79828317 +
7983 +- User Option: global-magit-file-mode
8318 +- User Option: magit-file-mode
79848319 +
79858320 + Whether to establish certain Magit key bindings in all file-visiting
79868321 + buffers belonging to a Git repository. This establishes the
80058340 + This prefix command shows suffix commands along with the appropriate
80068341 + infix arguments in a popup buffer. See [[*Initiating a commit]].
80078342 +
8008 +- Key: C-c M-g d, magit-diff-buffer-file-popup
8343 +- Key: C-c M-g D, magit-diff-buffer-file-popup
80098344 +
80108345 + This prefix command shows the same suffix commands and infix
80118346 + arguments in a popup buffer as ~magit-diff-popup~. But this variant
80128347 + has to be called from a file-visiting buffer and the visited file
80138348 + is automatically used in the popup to limit the diff to that file.
80148349 +
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 +
80158368 +- Key: C-c M-g l, magit-log-buffer-file
80168369 +
80178370 + This command shows the log for the file of blob that the current
80188371 + buffer visits. Renames are followed when a prefix argument is used
80198372 + 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]].
80208378 +
80218379 +- Key: C-c M-g b, magit-blame-popup
80228380 +
83478705 +but doing it this way has the advantage that you usually get to see
83488706 +the diff, which is useful because it increases the odds that you spot
83498707 +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
83508729 +
83518730 +* Plumbing
83528731 +
93139692 + (lambda ()
93149693 + (when (or git-commit-mode git-rebase-mode)
93159694 + (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)
93169723 +#+END_SRC
93179724 +
93189725 +** Can Magit be used as ~ediff-version-control-package~?
93669773 +~tramp-ssh-controlmaster-options~. Changing your DNS server (e.g. to
93679774 +Google's ~8.8.8.8~) may also be sufficient to work around the issue.
93689775 +
9369 +** ~Symbol's value as function is void --some~
9776 +** Symbol's value as function is void ~--some~
93709777 +
93719778 +Update ~dash~, restart Emacs, and then it will be defined.
93729779 +
94759882 +---- now delete this line and everything above ----
94769883 diff --git a/t/magit-tests.el b/t/magit-tests.el
94779884 new file mode 100644
9478 index 0000000..d9044d7
9885 index 0000000..11067ee
94799886 --- /dev/null
94809887 +++ b/t/magit-tests.el
94819888 @@ -0,0 +1,265 @@
94989905 + (let ((dir (make-symbol "dir")))
94999906 + `(let ((,dir (file-name-as-directory (make-temp-file "magit-" t)))
95009907 + (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)
95039910 + (condition-case err
95049911 + (cl-letf (((symbol-function #'message) (lambda (&rest _))))
95059912 + (let ((default-directory ,dir))
88 2 files changed, 2 insertions(+), 2 deletions(-)
99
1010 diff --git a/lisp/magit-popup.el b/lisp/magit-popup.el
11 index 1a7f587..883088d 100644
11 index 953e511..221217b 100644
1212 --- a/lisp/magit-popup.el
1313 +++ b/lisp/magit-popup.el
1414 @@ -12,7 +12,7 @@
2121 ;; Homepage: https://github.com/magit/magit
2222
2323 diff --git a/lisp/magit.el b/lisp/magit.el
24 index 5009795..38e961b 100644
24 index 6d579f3..dfa7484 100644
2525 --- a/lisp/magit.el
2626 +++ b/lisp/magit.el
2727 @@ -16,7 +16,7 @@
2828 ;; Rémi Vanicat <vanicat@debian.org>
2929 ;; Yann Hodique <yann.hodique@gmail.com>
3030
31 -;; Package-Requires: ((emacs "24.4") (async "1.5") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.1") (magit-popup "2.6.1"))
32 +;; Package-Requires: ((emacs "24.4") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.1") (magit-popup "2.6.1"))
31 -;; Package-Requires: ((emacs "24.4") (async "1.5") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.2") (magit-popup "2.6.2"))
32 +;; Package-Requires: ((emacs "24.4") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.2") (magit-popup "2.6.2"))
3333 ;; Keywords: git tools vc
3434 ;; Homepage: https://github.com/magit/magit
3535
88 1 file changed, 1 insertion(+), 1 deletion(-)
99
1010 diff --git a/default.mk b/default.mk
11 index 700ec6c..5d8cad5 100644
11 index 4fd8668..17a8c4c 100644
1212 --- a/default.mk
1313 +++ b/default.mk
14 @@ -50,7 +50,7 @@ ELS += magit-extras.el
14 @@ -51,7 +51,7 @@ ELS += magit-extras.el
1515 ELS += git-rebase.el
1616 ELCS = $(ELS:.el=.elc)
1717 ELMS = magit.el $(filter-out $(addsuffix .el,$(PACKAGES)),$(ELS))
2323 ;; Homepage: https://github.com/magit/magit
2424
2525 diff --git a/lisp/magit-popup.el b/lisp/magit-popup.el
26 index 883088d..45db0d1 100644
26 index 221217b..b5dc9df 100644
2727 --- a/lisp/magit-popup.el
2828 +++ b/lisp/magit-popup.el
2929 @@ -12,7 +12,7 @@
3636 ;; Homepage: https://github.com/magit/magit
3737
3838 diff --git a/lisp/magit.el b/lisp/magit.el
39 index 38e961b..b3f5d59 100644
39 index dfa7484..20b0ae0 100644
4040 --- a/lisp/magit.el
4141 +++ b/lisp/magit.el
4242 @@ -16,7 +16,7 @@
4343 ;; Rémi Vanicat <vanicat@debian.org>
4444 ;; Yann Hodique <yann.hodique@gmail.com>
4545
46 -;; Package-Requires: ((emacs "24.4") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.1") (magit-popup "2.6.1"))
47 +;; Package-Requires: ((emacs "24.4") (with-editor "2.5.1") (git-commit "2.6.1") (magit-popup "2.6.1"))
46 -;; Package-Requires: ((emacs "24.4") (dash "2.12.1") (with-editor "2.5.1") (git-commit "2.6.2") (magit-popup "2.6.2"))
47 +;; Package-Requires: ((emacs "24.4") (with-editor "2.5.1") (git-commit "2.6.2") (magit-popup "2.6.2"))
4848 ;; Keywords: git tools vc
4949 ;; Homepage: https://github.com/magit/magit
5050