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 * Typing 'k' on the "Untracked files" section title will offer to
delete all untracked files. 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 * 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 and unpulled commits, 'N r' runs git svn rebase, and 'N c' runs git
svn dcommit. svn dcommit.

View file

@ -1949,6 +1949,9 @@ in log buffer."
(magit-section-action (item info "stage") (magit-section-action (item info "stage")
((untracked file) ((untracked file)
(magit-run-git "add" info)) (magit-run-git "add" info))
((untracked)
(apply #'magit-run-git "add" "--"
(magit-git-lines "ls-files" "--other" "--exclude-standard")))
((unstaged diff hunk) ((unstaged diff hunk)
(if (magit-hunk-item-is-conflict-p item) (if (magit-hunk-item-is-conflict-p item)
(error (concat "Can't stage individual resolution hunks. " (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. 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 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 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 whole directories, for example. The @kbd{I} command is similar to
@kbd{i} but will add the file to @code{.git/info/exclude} instead. @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 @emph{Untracked files} section title when you it @kbd{k}, all
untracked files are deleted. untracked files are deleted.