diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2015-05-23 13:20:34 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2015-05-23 13:20:34 +0200 |
| commit | 3026b56182c767e16f57707d440a680b60fc337a (patch) | |
| tree | 4d12fc556c864f37d472b968899ba9ffd41fa41d /Makefile | |
| parent | 9d7145a04de149aafbb8dc02e95c339133e2f360 (diff) | |
commit transient changes to two dedicated wip refs
Previously two modes existed which saved transient changes (i.e. changes
that have not been committed to regular refs yet) by either committing
to a work-in-progress ref or by creating a stash.
These two modes are being replaced with three new modes which all save
changes to two different work-in-progress refs. Previously only one wip
ref existed (per branch); it was used to save changes in the worktree.
Now there are two such refs; one for the worktree and one for the index.
The old `magit-backup-mode' which saved changes using stashes, is
removed without a direct replacement.
The old `[global-]magit-wip-save-mode's are renamed to
`magit-wip-after-save-[local-]mode', they behave mostly the same as
before. This mode is similar to `make-backup-files', but it creates
a backup whenever the buffer is saved, not only the first time (and
obviously it saves the "backups" elsewhere).
However "editing a file" is not the only way for users to change a file
when using Git/Magit. One can also "apply" a change to a file, in fact
that's the only way one can change the "index version" of a file.
`magit-wip-after-apply-mode' covers this case. When that mode is
enabled the Magit commands that apply changes to files and/or the index
then also explicitly commit the changes they have made to the wip refs.
They only commit the changes that were just made, which avoids having to
check each and every file for changes. Doing it this way is very
important for performance reasons. However if a user makes changes
through other means, then these changes are not being committed to the
wip refs after they are made and therefor it is possible to lose those.
`magit-wip-before-change-mode' solves that problem. When that mode is
enabled, then commands which may discard changes that have potentially
not been saved to the wip refs yet save them before making their own
changes. Again only the files known to be affected by the upcoming
change are saved.
Sometimes it might be useful to explicitly safe all changes to all files
to the wip refs, which can be done using the command `magit-wip-commit'.
Besides the performance gain, another advantage of explicitly saving
some changes instead of blindly saving everything, is that we can use
commit and ref-update messages which indicate which command caused
saving changes to which files. Those more informative messages make it
easier to find the changes one needs to recover from such wip commits.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -107,6 +107,7 @@ ELS += magit-mode.el ELS += magit-process.el ELS += magit-core.el ELS += magit-diff.el +ELS += magit-wip.el ELS += magit-apply.el ELS += magit-log.el ELS += magit.el @@ -117,8 +118,6 @@ ELS += magit-bisect.el ELS += magit-stash.el ELS += magit-blame.el ELS += magit-ediff.el -ELS += magit-wip.el -ELS += magit-backup.el ELS += magit-extras.el ELS += git-rebase.el ELCS = $(ELS:.el=.elc) @@ -135,7 +134,8 @@ magit-process.elc: with-editor.elc magit-utils.elc magit-section.elc \ magit-core.elc: magit-utils.elc magit-section.elc magit-git.elc \ magit-mode.elc magit-popup.elc magit-process.elc magit-diff.elc: git-commit.elc magit-core.elc -magit-apply.elc: magit-core.elc magit-diff.elc +magit-wip.elc: magit-core.elc +magit-apply.elc: magit-core.elc magit-diff.elc magit-wip.elc magit-log.elc: magit-core.elc magit-diff.elc magit.elc: with-editor.elc git-commit.elc \ magit-core.elc magit-diff.elc magit-apply.elc magit-log.elc @@ -146,9 +146,7 @@ magit-bisect.elc: magit.elc magit-stash.elc: magit.elc magit-blame.elc: magit.elc magit-ediff.elc: magit.elc -magit-wip.elc: magit-core.elc -magit-backup.elc: magit.elc magit-stash.elc -magit-extras.elc: magit.elc magit-backup.elc +magit-extras.elc: magit.elc git-rebase.elc: magit.elc with-editor.elc lisp: $(ELCS) magit-version.el magit-autoloads.el |
