Stage all untracked files when on "Untracked files" title.

* magit.el (magit-stage-item): Here.
This commit is contained in:
Marius Vollmer 2009-07-27 23:12:44 +03:00
parent 6e33fdf6c7
commit aec91c216f
3 changed files with 10 additions and 2 deletions

3
NEWS
View file

@ -51,6 +51,9 @@ Changes in magit 0.7:
* Typing 'k' on the "Untracked files" section title will offer to
delete all untracked files.
* Similarily, hitting 's' on the "Untracked files" section title will
stage all untracked files.
* Magit understands a bit of git-svn: the status buffer shows unpushed
and unpulled commits, 'N r' runs git svn rebase, and 'N c' runs git
svn dcommit.

View file

@ -1949,6 +1949,9 @@ in log buffer."
(magit-section-action (item info "stage")
((untracked file)
(magit-run-git "add" info))
((untracked)
(apply #'magit-run-git "add" "--"
(magit-git-lines "ls-files" "--other" "--exclude-standard")))
((unstaged diff hunk)
(if (magit-hunk-item-is-conflict-p item)
(error (concat "Can't stage individual resolution hunks. "

View file

@ -200,7 +200,9 @@ During a history rewriting session, the status buffer shows the
Untracked files are shown in the @emph{Untracked files} section.
You can add a untracked file to the staging area with @kbd{s}.
You can add a untracked file to the staging area with @kbd{s}. If
point is on the @emph{Untracked files} section title when you it
@kbd{s}, all untracked files are staged.
You can instruct Git to ignore them by typing @kbd{i}. This will add
the filename to the @code{.gitignore} file. Typing @kbd{C-u i} will
@ -208,7 +210,7 @@ ask you for the name of the file to ignore. This is useful to ignore
whole directories, for example. The @kbd{I} command is similar to
@kbd{i} but will add the file to @code{.git/info/exclude} instead.
To delete a untracked file forever, use @kbd{k}. If point is one the
To delete a untracked file forever, use @kbd{k}. If point is on the
@emph{Untracked files} section title when you it @kbd{k}, all
untracked files are deleted.