git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add -p: warn if only binary changes present
@ 2008-10-24 21:48 Thomas Rast
  2008-10-26  5:10 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Rast @ 2008-10-24 21:48 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Current 'git add -p' will say "No changes." if there are no changes to
text files, which can be confusing if there _are_ changes to binary
files.  Add some code to distinguish the two cases, and give a
different message in the latter one.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>

---
 git-add--interactive.perl |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index da768ee..a560133 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -811,11 +811,16 @@ EOF
 }
 
 sub patch_update_cmd {
-	my @mods = grep { !($_->{BINARY}) } list_modified('file-only');
+	my @all_mods = list_modified('file-only');
+	my @mods = grep { !($_->{BINARY}) } @all_mods;
 	my @them;
 
 	if (!@mods) {
-		print STDERR "No changes.\n";
+		if (@all_mods) {
+			print STDERR "No changes except to binary files.\n";
+		} else {
+			print STDERR "No changes.\n";
+		}
 		return 0;
 	}
 	if ($patch_mode) {
-- 
tg: (759ad19..) t/add-p-binary-warn (depends on: origin/master)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-26 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-24 21:48 [PATCH] add -p: warn if only binary changes present Thomas Rast
2008-10-26  5:10 ` Jeff King
2008-10-26 10:28   ` Thomas Rast
2008-10-26 10:40     ` SZEDER Gábor
2008-10-26 19:37       ` [PATCH v2] " Thomas Rast
2008-10-26 19:38         ` Jeff King

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).