From John Wiegly.
Defines a number of seconds, after which magit will automatically
popup the magit-process buffer so the user can see what git is up to.
Off by default. I use this because sometimes when a commit or push
takes more than an expected amount of time, I start to wonder what
happened.
This is different from regular stashing because there is no prompting for a
name, and the stash is immediately re-applied. It's just a way of taking a
quick snapshot of your working tree, so you can come back to later if need
be.
For example, if you had just made a lot of changes to your project, and then
needed to make another sweeping change before you could commit again, this
would let you safely store your changes without having to resort to a branch.
The other day I hacked some file, and all changes obviously split in
two commits logically, but I can't do that because changes from
"different commits" were to close to each other and diff shows them
ina single hunk. There's possibility in git add -i to split current
hunk into smaller ones in such situations. I wanted to do this without
leaving emacs.
Now magit have control over -U<n> option to git-diff.
It was imposible to see what was staged for a first commit on a fresh
git repository. The only visible lines was fatal error messages from
git. Now diff against null tree object is shown in magit status buffer
if nothing was yet commited to the repository. The cost is 15-byte
object added to the repo, but it shuld disappear on first call to git
gc.
The usual behavior of committing all unstaged changes when there are
no staged changes makes it impossible to amend a commit just to fix
the commit message, which is a quite common thing to do.
* magit.el (magit-log-edit-commit): Do not pass "--all" to git commit
when amending.
* magit.el (magit-section-lineage, magit-section-show-level, magit-show-level,
magit-define-level-shower-1): New.
(magit-mode-map): Bind the digits and M-digits to magit-show-level-N
and magit-show-level-N-all.
* magit.texi: Document it in a new chapter for Sections.
* magit.el (magit-status): Only read the top directory with e prefix
argument or when we are not inside a Git repository.
* magit.texi, NEWS: Document the new behavior.
* magit.el (magit-show-stash): New.
(magit-visit-item): Use it and pop to the buffer for stashes.
(magit-show-item-or-scroll-up, magit-show-item-or-scroll-down): Handle
stashes.
* magit.el (magit-read-rev-range): Don't do anything special when
current-prefix-arg is set.
(magit-log): Use magit-read-rev-range instead of read-string.
(magit-log-long): Likewise.
On non-existent directiories magit-get-top-dir was failing returning
garbage string like "zsh: cd: no such file or directory: ...". Now it
returns nil in such cases.
Signed-off-by: John Wiegley <johnw@newartisans.com>
* magit.el (magit-insert-section): Revert earlier change: first
argument is used as the section title and the section type is usually
nil. When the first argument is a pair, it specvifies both the title
and the type.
* magit.el (magit-section-hidden-default): New.
(magit-new-section): Only expect type as argument, not a general list
of slots. Take 'hidden' value from magit-section-hidden-default.
(magit-with-section): Likewise.
(magit-wash-diff): Adapted.
* magit.el (magit-refresh-commit-buffer): Use nil as type for outer
section so that the highlight is not used for it.
(magit-refresh-log-buffer): Likewise.
* magit.el (magit-with-section): Check that args is a list before
accessing its car.
(magit-insert-section): Set the title of the section from the real
title, and the txpe from the real type.