Re: [PATCH] git-status: Show empty directories

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

Re: [PATCH] git-status: Show empty directories

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:02

Leila [off-list ref] writes:
quoted
Having said all that, I personally doubt this is a useful change.  I
may have thought of adding a README file to a relatively new project that
does not yet have one while in shower but I haven't even created the
file in the working tree.  And I forget about it once I get to the
office.  Should the system remind me to create README and then add?
Your patch would not give me such a reminder once the top-level
directory is populated (because it is no longer empty).  Even if I
were planning to add Documentation/README instead, I would get such
a reminder only if the Documentation directory is empty. Once the
directory is populated, I wouldn't get "create README and then add".
Why should an empty directory so special?
So there are two separate discussions here:
1) Should empty dirs be tracked

2) Should empty dirs appear under 'untracked' in git status
You are not answering my question by asking either these two
questions.

Please read what you quoted again.  I may have forgotten to create
and add README

 - at the toplevel directory; or

 - in the Documentation directory that already has other tracked
   files; or

 - in the Documentation directory that does not have any file yet.

Why do I get a reminder for only the last case?  Also please realize
that at no point in the scenario I am interested in adding an empty
directory.  "How does one add empty directories" is irrelevant to my
question.

A more reasonable answer would have been "the reminder is not about
a yet-to-be-created README file, but is about an empty directory you
might have wanted to place something---there is no way for Git to
guess that you wanted the new file to be README, but at least having
a totally empty directory laying around may be an indication that
you wanted to do something intereseting in it but haven't yet".  If
the proposed commit log message justified the behaviour to treat
only the third one specially that way, I suspect it may make some
sense.

Re: [PATCH] git-status: Show empty directories

From: Leila <hidden>
Date: 2016-06-15 22:54:02

On Mon, Jun 11, 2012 at 12:57 PM, Junio C Hamano [off-list ref] wrote:
Leila [off-list ref] writes:
quoted
quoted
Having said all that, I personally doubt this is a useful change.  I
may have thought of adding a README file to a relatively new project that
does not yet have one while in shower but I haven't even created the
file in the working tree.  And I forget about it once I get to the
office.  Should the system remind me to create README and then add?
Your patch would not give me such a reminder once the top-level
directory is populated (because it is no longer empty).  Even if I
were planning to add Documentation/README instead, I would get such
a reminder only if the Documentation directory is empty. Once the
directory is populated, I wouldn't get "create README and then add".
Why should an empty directory so special?
Please read what you quoted again.  I may have forgotten to create
and add README

 - at the toplevel directory; or

 - in the Documentation directory that already has other tracked
  files; or

 - in the Documentation directory that does not have any file yet.

Why do I get a reminder for only the last case?  Also please realize
that at no point in the scenario I am interested in adding an empty
directory.  "How does one add empty directories" is irrelevant to my
question.

A more reasonable answer would have been "the reminder is not about
a yet-to-be-created README file, but is about an empty directory you
might have wanted to place something---there is no way for Git to
guess that you wanted the new file to be README, but at least having
a totally empty directory laying around may be an indication that
you wanted to do something intereseting in it but haven't yet".  If
the proposed commit log message justified the behaviour to treat
only the third one specially that way, I suspect it may make some
sense.
I apologize, I misread the scenario and thought you were asking a
different question.

The patch/new implementation I put forth reminds you that you have an
empty dir. The reminder that you have an empty dir  isn't about a
yet-to-be-created README file, but about an empty directory that you
may have wanted to do something interesting in but haven't yet (like
create a README/some other file or delete it even). It servers as
helpful reminder to do something with that empty dir. Is that better?

Re: [PATCH] git-status: Show empty directories

From: Leila <hidden>
Date: 2016-06-15 22:54:02

On Mon, Jun 11, 2012 at 2:51 PM, Leila [off-list ref] wrote:
On Mon, Jun 11, 2012 at 12:57 PM, Junio C Hamano [off-list ref] wrote:
quoted
Leila [off-list ref] writes:
quoted
quoted
Having said all that, I personally doubt this is a useful change.  I
may have thought of adding a README file to a relatively new project that
does not yet have one while in shower but I haven't even created the
file in the working tree.  And I forget about it once I get to the
office.  Should the system remind me to create README and then add?
Your patch would not give me such a reminder once the top-level
directory is populated (because it is no longer empty).  Even if I
were planning to add Documentation/README instead, I would get such
a reminder only if the Documentation directory is empty. Once the
directory is populated, I wouldn't get "create README and then add".
Why should an empty directory so special?
Please read what you quoted again.  I may have forgotten to create
and add README

 - at the toplevel directory; or

 - in the Documentation directory that already has other tracked
  files; or

 - in the Documentation directory that does not have any file yet.

Why do I get a reminder for only the last case?  Also please realize
that at no point in the scenario I am interested in adding an empty
directory.  "How does one add empty directories" is irrelevant to my
question.

A more reasonable answer would have been "the reminder is not about
a yet-to-be-created README file, but is about an empty directory you
might have wanted to place something---there is no way for Git to
guess that you wanted the new file to be README, but at least having
a totally empty directory laying around may be an indication that
you wanted to do something intereseting in it but haven't yet".  If
the proposed commit log message justified the behaviour to treat
only the third one specially that way, I suspect it may make some
sense.
I apologize, I misread the scenario and thought you were asking a
different question.

The patch/new implementation I put forth reminds you that you have an
empty dir. The reminder that you have an empty dir  isn't about a
yet-to-be-created README file, but about an empty directory that you
may have wanted to do something interesting in but haven't yet (like
create a README/some other file or delete it even). It servers as
helpful reminder to do something with that empty dir. Is that better?
Oh and since it's not about the reminder to add a README file, it
doesn't do anything for the first 2 cases that you mention. Adding a
README is just an example of a use case for this patch.

That being said, I like the idea that you put forth about changing the
wording of the message next to the empty dir to something more
constructive or alert like, so the user can take action regarding the
empty dir.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help