git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Pat Thoyts <patthoyts@googlemail.com>
Cc: git@vger.kernel.org
Subject: [PATCH] git-gui: deal with unknown files when pressing the "Stage Changed" button
Date: Fri, 27 May 2011 17:40:24 +0200	[thread overview]
Message-ID: <20110527154020.GA2273@book.hvoigt.net> (raw)

As a shortcut the "Stage Changed" button can be used to stage all current
changes in the worktree which are not set to ignore. Previously unknown
files would be ignored. The user might want to say: "Just save everything
in my worktree". To support this workflow we now ask whether the user also
wants to stage the unknown files if there are some present.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
 lib/index.tcl |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/index.tcl b/lib/index.tcl
index 5d7bbf2..e38b647 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -356,12 +356,21 @@ proc do_add_all {} {
 	global file_states
 
 	set paths [list]
+	set unknown_paths [list]
 	foreach path [array names file_states] {
 		switch -glob -- [lindex $file_states($path) 0] {
 		U? {continue}
 		?M -
 		?T -
 		?D {lappend paths $path}
+		?O {lappend unknown_paths $path}
+		}
+	}
+	if {[llength $unknown_paths]} {
+		set reply [ask_popup [mc "There are unknown files do you also want
+to stage those?"]]
+		if {$reply} {
+			set paths [concat $paths $unknown_paths]
 		}
 	}
 	add_helper {Adding all changed files} $paths
-- 
1.7.5.1.219.g4c6b2

                 reply	other threads:[~2011-05-27 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110527154020.GA2273@book.hvoigt.net \
    --to=hvoigt@hvoigt.net \
    --cc=git@vger.kernel.org \
    --cc=patthoyts@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).