Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

6 messages, 4 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:30

Väinö Järvelä [off-list ref] writes:
The way I see the flag used is: A user runs "git status", sees that
there is too much untracked files and not enough scrollback, so he
runs "git status --only-tracked" to filter the results.
Why?

Just set up .gitignore once then (1) you do not have to worry
about them ever again, and (2) you _will_ still be able to
notice if you accidentally added more cruft, or more
importantly, if you forgot to tell an important file to git.

I think the latter is more important point.  If you train a
naive user to use --only-tracked to ignore "Untracked" list, you
are doing him or her a great disservice.  Mistake to forget "git
add" a new file before commiting will bound to happen.

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Väinö Järvelä <hidden>
Date: 2016-06-15 22:43:30

On Aug 24, 2007, at 10:46, Junio C Hamano wrote:
Väinö Järvelä [off-list ref] writes:
quoted
The way I see the flag used is: A user runs "git status", sees that
there is too much untracked files and not enough scrollback, so he
runs "git status --only-tracked" to filter the results.
Why?

Just set up .gitignore once then (1) you do not have to worry
about them ever again, and (2) you _will_ still be able to
notice if you accidentally added more cruft, or more
importantly, if you forgot to tell an important file to git.

I think the latter is more important point.  If you train a
naive user to use --only-tracked to ignore "Untracked" list, you
are doing him or her a great disservice.  Mistake to forget "git
add" a new file before commiting will bound to happen.
I also think that maintaining a proper .gitignore is imporant, and  
more productive than using --only-tracked instead. But when I have  
cruft that can't be put in .gitignore, or it would ignore files that  
are supposed to be shown and tracked, I use --only-tracked.

It's true though, that the user might forget to add a file if he  
always uses --only-tracked, that's why I added the note in the status  
that the untracked files were filtered out. The flag is supposed to  
be a helper for situations where .gitignore wouldn't work, not a way  
to work always. Maybe if this flag is accepted, the manual should say  
that in most cases it's better to use .gitignore.

--
Väinö

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:30

Hi,

On Fri, 24 Aug 2007, V?in? J?rvel wrote:
On Aug 24, 2007, at 10:46, Junio C Hamano wrote:
quoted
V?in? J?rvel? [off-list ref] writes:
quoted
The way I see the flag used is: A user runs "git status", sees that
there is too much untracked files and not enough scrollback, so he
runs "git status --only-tracked" to filter the results.
Why?

Just set up .gitignore once then (1) you do not have to worry
about them ever again, and (2) you _will_ still be able to
notice if you accidentally added more cruft, or more
importantly, if you forgot to tell an important file to git.

I think the latter is more important point.  If you train a
naive user to use --only-tracked to ignore "Untracked" list, you
are doing him or her a great disservice.  Mistake to forget "git
add" a new file before commiting will bound to happen.
I also think that maintaining a proper .gitignore is imporant, and more
productive than using --only-tracked instead. But when I have cruft that can't
be put in .gitignore, or it would ignore files that are supposed to be shown
and tracked, I use --only-tracked.
Would it not be better to imitate the "-x" and "-X" options of ls-files, 
then?  You could achieve the effect you desire by "git status -x \*" then.

Ciao,
Dscho

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Väinö Järvelä <hidden>
Date: 2016-06-15 22:43:30

On Aug 24, 2007, at 12:55, Johannes Schindelin wrote:
On Fri, 24 Aug 2007, V?in? J?rvel wrote:
quoted
I also think that maintaining a proper .gitignore is imporant, and  
more
productive than using --only-tracked instead. But when I have  
cruft that can't
be put in .gitignore, or it would ignore files that are supposed  
to be shown
and tracked, I use --only-tracked.
Would it not be better to imitate the "-x" and "-X" options of ls- 
files,
then?  You could achieve the effect you desire by "git status -x  
\*" then.

Ciao,
Dscho
I haven't used that option, do I understand correctly, that with that  
option, you should provide another exclusion file? That would remove  
the dynamic ability of --only-tracked.

--
Väinö

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:43:30

Junio C Hamano wrote:
I think the latter is more important point.  If you train a
naive user to use --only-tracked to ignore "Untracked" list, you
are doing him or her a great disservice.  Mistake to forget "git
add" a new file before commiting will bound to happen.
If it won't acquire short version, nor tab completion, mosts users when
confronted with such a mothful of option-name wouldn't use it unless
necessary, I think...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

Re: [PATCH 1/2] Add "--only-untracked" flag to status commands.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:30

Hi,

On Fri, 24 Aug 2007, V?in? J?rvel wrote:
On Aug 24, 2007, at 12:55, Johannes Schindelin wrote:
quoted
On Fri, 24 Aug 2007, V?in? J?rvel wrote:
quoted
I also think that maintaining a proper .gitignore is imporant, and 
more productive than using --only-tracked instead. But when I have 
cruft that can't be put in .gitignore, or it would ignore files that 
are supposed to be shown and tracked, I use --only-tracked.
Would it not be better to imitate the "-x" and "-X" options of 
ls-files, then?  You could achieve the effect you desire by "git 
status -x \*" then.
I haven't used that option, do I understand correctly, that with that 
option, you should provide another exclusion file? That would remove the 
dynamic ability of --only-tracked.
-X takes a filename, -x a pattern.

Hth,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help