* [PATCH] git status -q (similar to subversion)
@ 2009-06-27 20:57 Unknown
2009-06-28 18:52 ` Jeff King
2009-06-28 22:44 ` David Aguilar
0 siblings, 2 replies; 11+ messages in thread
From: Unknown @ 2009-06-27 20:57 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: TEXT/PLAIN, Size: 259 bytes --]
Here is a tiny patch adding -q option to git status.
It means -uno (Show no untracked files).
Not sure where to add that in documentation.
Maybe in git-commit man just below -u:
-q (for git-status only, equals to -uno).
Or something like this?
Regards,
Borg
[-- Attachment #2: Type: TEXT/PLAIN, Size: 471 bytes --]
diff --git a/builtin-commit.c b/builtin-commit.c
index 41e222d..e4e0074 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -826,6 +826,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
diff_use_color_default = git_use_color_default;
argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
+ if(quiet)
+ show_untracked_files = SHOW_NO_UNTRACKED_FILES;
index_file = prepare_index(argc, argv, prefix);
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-27 20:57 [PATCH] git status -q (similar to subversion) Unknown
@ 2009-06-28 18:52 ` Jeff King
2009-06-28 21:01 ` Martin Renold
2009-06-28 22:44 ` David Aguilar
1 sibling, 1 reply; 11+ messages in thread
From: Jeff King @ 2009-06-28 18:52 UTC (permalink / raw)
To: Unknown; +Cc: git
On Sat, Jun 27, 2009 at 10:57:13PM +0200, Unknown wrote:
> Here is a tiny patch adding -q option to git status.
> It means -uno (Show no untracked files).
>
> Not sure where to add that in documentation.
> Maybe in git-commit man just below -u:
> -q (for git-status only, equals to -uno).
> Or something like this?
I'm not sure if this is a good idea. As you mention, there is already
"-uno" to accomplish the same thing. So we are making the interface
redundant.
It seems from the subject like you are trying to emulate a similar
option in "svn status". But my understanding (and I was never a big
subversion user, so I am going off of things said on the git list) is
that there are quite a few differences between "svn status" and "git
status". Enough that we do not want users to really equate them (a
subject which has come up over and over on the list).
In other words, it seems like we are at best simply adding a redundant
option, and at worst, confusing people even more about the equivalence
between the "status" commands of the two systems.
-Peff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-28 18:52 ` Jeff King
@ 2009-06-28 21:01 ` Martin Renold
2009-06-30 5:33 ` Jeff King
0 siblings, 1 reply; 11+ messages in thread
From: Martin Renold @ 2009-06-28 21:01 UTC (permalink / raw)
To: git
On Sun, Jun 28, 2009 at 02:52:18PM -0400, Jeff King wrote:
> On Sat, Jun 27, 2009 at 10:57:13PM +0200, Unknown wrote:
> > Here is a tiny patch adding -q option to git status.
> > It means -uno (Show no untracked files).
>
> It seems from the subject like you are trying to emulate a similar
> option in "svn status".
As a former svn user I also miss -q. I like to keep untracked non-ignored
files lying around as a short-term TODO list.
I think the point is not SVN compatibility. The point is that SVN just got
the commandline interface right here ;-) because -q easier to discover and
remember (many programs have --quiet/-q). And when you use it you will use
it several times in a row. For this -uno is already too much to bother
typing (assuming you have an alias 'git st').
bye,
Martin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-27 20:57 [PATCH] git status -q (similar to subversion) Unknown
2009-06-28 18:52 ` Jeff King
@ 2009-06-28 22:44 ` David Aguilar
2009-06-29 19:39 ` Unknown
1 sibling, 1 reply; 11+ messages in thread
From: David Aguilar @ 2009-06-28 22:44 UTC (permalink / raw)
To: Unknown; +Cc: git
On Sat, Jun 27, 2009 at 10:57:13PM +0200, Unknown wrote:
> Here is a tiny patch adding -q option to git status.
> It means -uno (Show no untracked files).
>
> Not sure where to add that in documentation.
> Maybe in git-commit man just below -u:
> -q (for git-status only, equals to -uno).
> Or something like this?
>
> Regards,
> Borg
Hello
Please take a look at Documentation/SubmittingPatches
(all of the documentation lives in Documentation/).
It doesn't seem like this patch was generated with
git format-patch. You'll also want to submit your patch using
git send-email, as we require inline patches instead of
attachments.
You'll need to include a signed-off-by line (which you can do
by using `git commit -s`) and it seems like you need to
introduce yourself to git:
http://book.git-scm.com/2_setup_and_initialization.html
Sorry, we cannot accept patches from "Unknown" for a number
of reasons.
Thanks for your help and we look forward to hearing your
response to the rest of the feedback received in this thread.
> diff --git a/builtin-commit.c b/builtin-commit.c
> index 41e222d..e4e0074 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -826,6 +826,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
> diff_use_color_default = git_use_color_default;
>
> argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
> + if(quiet)
> + show_untracked_files = SHOW_NO_UNTRACKED_FILES;
>
> index_file = prepare_index(argc, argv, prefix);
>
--
David
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-28 22:44 ` David Aguilar
@ 2009-06-29 19:39 ` Unknown
2009-06-30 5:33 ` Jeff King
0 siblings, 1 reply; 11+ messages in thread
From: Unknown @ 2009-06-29 19:39 UTC (permalink / raw)
To: David Aguilar; +Cc: git
On Sun, 28 Jun 2009, David Aguilar wrote:
> Hello
Hi and thanks for reply.
> Please take a look at Documentation/SubmittingPatches
> (all of the documentation lives in Documentation/).
>
> It doesn't seem like this patch was generated with
> git format-patch. You'll also want to submit your patch using
> git send-email, as we require inline patches instead of
> attachments.
Right. I though such a small patch can be provided as is.
Anyway, I will take necessary steps to peform better next time.
The question is, would that patch will be applied anyway?
I already received some criticism about not applying it.
I can only answer that where svn status and git status differ in many
cases, there are also similar in some.
For now, I would rather want to see a discus about it (Pro vs Cons).
Other solution I see is add extra config variable like:
status.showUntrackedDefault = (no|normal|all)
So when you peform 'git status -u' it will be used.
Looks better to me if we really want to have difference between
git status vs svn status.
Regards,
Borg
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-28 21:01 ` Martin Renold
@ 2009-06-30 5:33 ` Jeff King
2009-06-30 15:14 ` Martin Renold
0 siblings, 1 reply; 11+ messages in thread
From: Jeff King @ 2009-06-30 5:33 UTC (permalink / raw)
To: Martin Renold; +Cc: git
On Sun, Jun 28, 2009 at 11:01:17PM +0200, Martin Renold wrote:
> As a former svn user I also miss -q. I like to keep untracked non-ignored
> files lying around as a short-term TODO list.
>
> I think the point is not SVN compatibility. The point is that SVN just got
> the commandline interface right here ;-) because -q easier to discover and
> remember (many programs have --quiet/-q). And when you use it you will use
> it several times in a row. For this -uno is already too much to bother
> typing (assuming you have an alias 'git st').
If it is convenience you want, perhaps you would be even happier with:
git config status.showUntrackedFiles no
As far as "SVN got it right": that may well be the case, but we have to
deal with the fact that "git status" is really a dry-run version of "git
commit", which already has a "-q" option, which does something totally
different. So I am a little hesitant to endorse its use in "git status"
for something unrelated (and I am hesitant to have redundant command
line options, as well).
-Peff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-29 19:39 ` Unknown
@ 2009-06-30 5:33 ` Jeff King
2009-06-30 16:56 ` Unknown
0 siblings, 1 reply; 11+ messages in thread
From: Jeff King @ 2009-06-30 5:33 UTC (permalink / raw)
To: Unknown; +Cc: David Aguilar, git
On Mon, Jun 29, 2009 at 09:39:18PM +0200, Unknown wrote:
> Other solution I see is add extra config variable like:
> status.showUntrackedDefault = (no|normal|all)
> So when you peform 'git status -u' it will be used.
It exists, but is called showUntrackedFiles. See "git help config" for
details.
-Peff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-30 5:33 ` Jeff King
@ 2009-06-30 15:14 ` Martin Renold
2009-06-30 15:33 ` Jeff King
0 siblings, 1 reply; 11+ messages in thread
From: Martin Renold @ 2009-06-30 15:14 UTC (permalink / raw)
To: Jeff King; +Cc: git
On Tue, Jun 30, 2009 at 01:33:05AM -0400, Jeff King wrote:
> If it is convenience you want, perhaps you would be even happier with:
> git config status.showUntrackedFiles no
No, that doesn't help in my usecase. I want to be reminded about the
untracked files by default because I intend to clean them up later.
> [...] but we have to deal with the fact that "git status" is really a
> dry-run version of "git commit", which already has a "-q" option
Good point. However I think those commands are similar only from an
implementation point of view. As an user I think of them as being quite
different. I would not be surprised about different meaning of options -
certainly less than about "git commit -a" vs "git add -u".
> So I am a little hesitant to endorse its use in "git status" for something
> unrelated (and I am hesitant to have redundant command line options, as
> well).
Yes I understand that. I'm using a wrapper script for now, but if it was any
other one-letter shortcut, I would prefer to learn that instead.
bye,
Martin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-30 15:14 ` Martin Renold
@ 2009-06-30 15:33 ` Jeff King
2009-07-01 8:37 ` Paolo Bonzini
0 siblings, 1 reply; 11+ messages in thread
From: Jeff King @ 2009-06-30 15:33 UTC (permalink / raw)
To: Martin Renold; +Cc: git
On Tue, Jun 30, 2009 at 05:14:42PM +0200, Martin Renold wrote:
> > [...] but we have to deal with the fact that "git status" is really a
> > dry-run version of "git commit", which already has a "-q" option
>
> Good point. However I think those commands are similar only from an
> implementation point of view. As an user I think of them as being quite
> different. I would not be surprised about different meaning of options -
> certainly less than about "git commit -a" vs "git add -u".
The main difference that trips people, I think, is that they expect "git
status <file>" to restrict status to a subset of the tree. But it is
about "what would happen if I did 'git commit <file>'", which is quite
different.
There has been much discussion about an alternate command that would be
more like "svn status", and even some partial implementations. But it
needs somebody who really cares about the feature to step up and
complete it.
-Peff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-30 5:33 ` Jeff King
@ 2009-06-30 16:56 ` Unknown
0 siblings, 0 replies; 11+ messages in thread
From: Unknown @ 2009-06-30 16:56 UTC (permalink / raw)
To: Jeff King; +Cc: David Aguilar, git
On Tue, 30 Jun 2009, Jeff King wrote:
> It exists, but is called showUntrackedFiles. See "git help config" for
> details.
Its not what I meant. showUntrackedFiles is used when you do not specify
'-u' option. showUnrackedDefault (not so good name, someone have better
idea?) would be used if you specify '-u' option without argument.
Currently argument 'all' is used.
--
Borg
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git status -q (similar to subversion)
2009-06-30 15:33 ` Jeff King
@ 2009-07-01 8:37 ` Paolo Bonzini
0 siblings, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2009-07-01 8:37 UTC (permalink / raw)
To: Jeff King; +Cc: Martin Renold, git
> There has been much discussion about an alternate command that would be
> more like "svn status", and even some partial implementations. But it
> needs somebody who really cares about the feature to step up and
> complete it.
An alias
changes=diff --name-status -r
already does almost the same function as "svn status -q". If you wanted
full svn status with untracked files you could use this:
changes = "!sh -c 'git status | sed -n
\"/Untracked/N;//N;1,//d;s/^#/?/p\"; git diff --name-status -r \"$@\"' -"
Paolo
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-07-01 8:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-27 20:57 [PATCH] git status -q (similar to subversion) Unknown
2009-06-28 18:52 ` Jeff King
2009-06-28 21:01 ` Martin Renold
2009-06-30 5:33 ` Jeff King
2009-06-30 15:14 ` Martin Renold
2009-06-30 15:33 ` Jeff King
2009-07-01 8:37 ` Paolo Bonzini
2009-06-28 22:44 ` David Aguilar
2009-06-29 19:39 ` Unknown
2009-06-30 5:33 ` Jeff King
2009-06-30 16:56 ` Unknown
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).