From aec91c216f1fbf1314f9ccdd7b51f77870d6d021 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 27 Jul 2009 23:12:44 +0300 Subject: [PATCH] Stage all untracked files when on "Untracked files" title. * magit.el (magit-stage-item): Here. --- NEWS | 3 +++ magit.el | 3 +++ magit.texi | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f1190c33..c51460b7 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/magit.el b/magit.el index 8e3b1861..fc3f90aa 100644 --- a/magit.el +++ b/magit.el @@ -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. " diff --git a/magit.texi b/magit.texi index 57bf8fcc..b5c69d3f 100644 --- a/magit.texi +++ b/magit.texi @@ -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.