git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Teach runstatus about --untracked
@ 2006-09-12 20:45 Johannes Schindelin
  2006-09-13  6:10 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2006-09-12 20:45 UTC (permalink / raw)
  To: git, junkio, Jeff King


Actually, teach runstatus what to do if it is not passed; it should not list
the contents of completely untracked directories, but only the name of that
directory (plus a trailing '/').

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 builtin-runstatus.c |    2 ++
 git-commit.sh       |    3 ++-
 wt-status.c         |    3 +++
 wt-status.h         |    1 +
 4 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/builtin-runstatus.c b/builtin-runstatus.c
index 7979d61..303c556 100644
--- a/builtin-runstatus.c
+++ b/builtin-runstatus.c
@@ -25,6 +25,8 @@ int cmd_runstatus(int argc, const char *
 		}
 		else if (!strcmp(argv[i], "--verbose"))
 			s.verbose = 1;
+		else if (!strcmp(argv[i], "--untracked"))
+			s.untracked = 1;
 		else
 			usage(runstatus_usage);
 	}
diff --git a/git-commit.sh b/git-commit.sh
index 10c269a..5a4c659 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -82,7 +82,8 @@ run_status () {
   esac
   git-runstatus ${color} \
                 ${verbose:+--verbose} \
-                ${amend:+--amend}
+                ${amend:+--amend} \
+		${untracked_files:+--untracked}
 }
 
 trap '
diff --git a/wt-status.c b/wt-status.c
index ec2c728..4398f9b 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -50,6 +50,7 @@ void wt_status_prepare(struct wt_status 
 	s->amend = 0;
 	s->verbose = 0;
 	s->commitable = 0;
+	s->untracked = 0;
 }
 
 static void wt_status_print_header(const char *main, const char *sub)
@@ -188,6 +189,8 @@ static void wt_status_print_untracked(co
 	memset(&dir, 0, sizeof(dir));
 
 	dir.exclude_per_dir = ".gitignore";
+	if (!s->untracked)
+		dir.show_other_directories = 1;
 	x = git_path("info/exclude");
 	if (file_exists(x))
 		add_excludes_from_file(&dir, x);
diff --git a/wt-status.h b/wt-status.h
index 75d3cfe..0a5a5b7 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -15,6 +15,7 @@ struct wt_status {
 	int commitable;
 	int verbose;
 	int amend;
+	int untracked;
 };
 
 int git_status_config(const char *var, const char *value);
-- 
1.4.2.g1734-dirty

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

* Re: [PATCH] Teach runstatus about --untracked
  2006-09-12 20:45 [PATCH] Teach runstatus about --untracked Johannes Schindelin
@ 2006-09-13  6:10 ` Jeff King
  2006-09-13  6:18   ` Junio C Hamano
  2006-09-13  7:21   ` Johannes Schindelin
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff King @ 2006-09-13  6:10 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, junkio

On Tue, Sep 12, 2006 at 10:45:12PM +0200, Johannes Schindelin wrote:

> +	if (!s->untracked)
> +		dir.show_other_directories = 1;

This should also set dir.hide_empty_directories to match the original
behavior.

-Peff

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

* Re: [PATCH] Teach runstatus about --untracked
  2006-09-13  6:10 ` Jeff King
@ 2006-09-13  6:18   ` Junio C Hamano
  2006-09-13  7:21   ` Johannes Schindelin
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2006-09-13  6:18 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Johannes Schindelin

Jeff King <peff@peff.net> writes:

> On Tue, Sep 12, 2006 at 10:45:12PM +0200, Johannes Schindelin wrote:
>
>> +	if (!s->untracked)
>> +		dir.show_other_directories = 1;
>
> This should also set dir.hide_empty_directories to match the original
> behavior.

Right.  Thanks for eyeballing.

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

* Re: [PATCH] Teach runstatus about --untracked
  2006-09-13  6:10 ` Jeff King
  2006-09-13  6:18   ` Junio C Hamano
@ 2006-09-13  7:21   ` Johannes Schindelin
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2006-09-13  7:21 UTC (permalink / raw)
  To: Jeff King; +Cc: git, junkio

Hi,

On Wed, 13 Sep 2006, Jeff King wrote:

> On Tue, Sep 12, 2006 at 10:45:12PM +0200, Johannes Schindelin wrote:
> 
> > +	if (!s->untracked)
> > +		dir.show_other_directories = 1;
> 
> This should also set dir.hide_empty_directories to match the original
> behavior.

But of course! Completely forgot that. Thanks.

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

end of thread, other threads:[~2006-09-13  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-12 20:45 [PATCH] Teach runstatus about --untracked Johannes Schindelin
2006-09-13  6:10 ` Jeff King
2006-09-13  6:18   ` Junio C Hamano
2006-09-13  7:21   ` Johannes Schindelin

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