git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git status: print files under untracked dir if -a is given
@ 2006-05-30  8:46 Yasushi SHOJI
  2006-05-30  9:34 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Yasushi SHOJI @ 2006-05-30  8:46 UTC (permalink / raw)
  To: git; +Cc: tetsuya

git status: print files under untracked dir if -a is given

git status (git-commit.sh) currently doesn't show files under
untracked directory.  this is inconvenient when adding many files
under new directory.

this patch change its behavior to show files under untracked directory
if option --all is given.

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>

---

3d3fa8f19c7d9b03b1a6e510970633ec8be7adac
 git-commit.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

3d3fa8f19c7d9b03b1a6e510970633ec8be7adac
diff --git a/git-commit.sh b/git-commit.sh
index 6ef1a9d..0cde305 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -134,13 +134,18 @@ #'
 	report "Changed but not updated" \
 	    "use git-update-index to mark for commit"
 
+	if test -z "$all"
+	then
+	    directory_opt="--directory"
+	fi
+
 	if test -f "$GIT_DIR/info/exclude"
 	then
-	    git-ls-files -z --others --directory \
+	    git-ls-files -z --others $directory_opt \
 		--exclude-from="$GIT_DIR/info/exclude" \
 		--exclude-per-directory=.gitignore
 	else
-	    git-ls-files -z --others --directory \
+	    git-ls-files -z --others $directory_opt \
 		--exclude-per-directory=.gitignore
 	fi |
 	perl -e '$/ = "\0";
-- 
1.3.3.g70f7

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

* Re: [PATCH] git status: print files under untracked dir if -a is given
  2006-05-30  8:46 [PATCH] git status: print files under untracked dir if -a is given Yasushi SHOJI
@ 2006-05-30  9:34 ` Junio C Hamano
  2006-05-30 12:55   ` Yasushi SHOJI
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-05-30  9:34 UTC (permalink / raw)
  To: Yasushi SHOJI; +Cc: git

Yasushi SHOJI <yashi@atmark-techno.com> writes:

> git status: print files under untracked dir if -a is given
>
> git status (git-commit.sh) currently doesn't show files under
> untracked directory.  this is inconvenient when adding many files
> under new directory.
>
> this patch change its behavior to show files under untracked directory
> if option --all is given.
>
> Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>

I do not quite understand your rationale behind linking -a and
"show untracked" behaviour.  In many cases, after modifying
multiple files "commit -a" is the preferred way to make commits
for people who keep their tree clean (meaning, they do not leave
unrelated changes to their working tree files), and I suspect
your change would clutter their commit log buffer with unrelated
files they did not ask to see.

At least this would make things somewhat unpleasant for me to
use, since I do "commit -a" often and I have my random notes
files under ./+trash subdirectory of the main project (yes, I
know I could add /+trash to .gitignore).

We have something different but perhaps related by Matthias
Lederhofer to add "git status --untracked" since you did this
patch.

        commit 443f8338b9e248353a7095a1096684f1ed106c66
        Author: Matthias Lederhofer <matled@gmx.net>
        Date:   Mon May 22 23:02:06 2006 +0200

Does it solve your problem?

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

* Re: [PATCH] git status: print files under untracked dir if -a is given
  2006-05-30  9:34 ` Junio C Hamano
@ 2006-05-30 12:55   ` Yasushi SHOJI
  0 siblings, 0 replies; 3+ messages in thread
From: Yasushi SHOJI @ 2006-05-30 12:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi Junio,

At Tue, 30 May 2006 02:34:55 -0700,
Junio C Hamano wrote:
> 
> Yasushi SHOJI <yashi@atmark-techno.com> writes:
> 
> > git status: print files under untracked dir if -a is given
> >
> > git status (git-commit.sh) currently doesn't show files under
> > untracked directory.  this is inconvenient when adding many files
> > under new directory.
> >
> > this patch change its behavior to show files under untracked directory
> > if option --all is given.
> >
> > Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
> 
> I do not quite understand your rationale behind linking -a and
> "show untracked" behaviour.  In many cases, after modifying
> multiple files "commit -a" is the preferred way to make commits
> for people who keep their tree clean (meaning, they do not leave
> unrelated changes to their working tree files), and I suspect
> your change would clutter their commit log buffer with unrelated
> files they did not ask to see.

I assumed "--all" to mean "every single file under a working dir
except ignored". so I thought users of "commit -a" wouldn't mind to
see files under untracked dir. 

but I was wrong. man page clearly states that "... new files you have
not told git about are not affected."

# I admit I haven't used -a with commit because of my
# misunderstanding. it's nice to know the option is much safer than I
# expected.

> At least this would make things somewhat unpleasant for me to
> use, since I do "commit -a" often and I have my random notes
> files under ./+trash subdirectory of the main project (yes, I
> know I could add /+trash to .gitignore).

I wasn't expecting that usage.

> We have something different but perhaps related by Matthias
> Lederhofer to add "git status --untracked" since you did this
> patch.
> 
>         commit 443f8338b9e248353a7095a1096684f1ed106c66
>         Author: Matthias Lederhofer <matled@gmx.net>
>         Date:   Mon May 22 23:02:06 2006 +0200
> 
> Does it solve your problem?

yes, it perfectly does.

thanks,
--
       yashi

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

end of thread, other threads:[~2006-05-30 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30  8:46 [PATCH] git status: print files under untracked dir if -a is given Yasushi SHOJI
2006-05-30  9:34 ` Junio C Hamano
2006-05-30 12:55   ` Yasushi SHOJI

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