git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 10, 2012, 07:15 UTC
Message-ID
<7vr4tnab9e.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1339270806-65013-1-git-send-email-muhtasib@gmail.com>
Leila Muhtasib <muhtasib@gmail.com> writes:
Show 7 quoted lines
> git-status now lists empty directories under the untracked header. Before this
> modification, git status did not list empty directories. The header changed
> from 'Untracked files' to instead display 'Untracked files and directories'.
> A helpful reminder is also added after empty directories indicating they cannot
> be added/staged if they are empty. git status -u is unchanged, and will still
> only show untracked files just as before. As a result, no need for
> documentation change.

Please do not write a thick wall of text like this. State the problem you are trying to solve first, by describing the current behaviour you want to highlight, and explain why you think the current behaviour is bad. Then describe how you propose to solve that issue in a separate paragraph.

For example:
> git-status now lists empty directories under the untracked header. Before this
> modification, git status did not list empty directories.
The above is backwards.
	"git status" lists untracked files and directories full of
	untracked files, but does not list empty directories.  This
	is bad for such and such reasons.

Then describe your solution (which should be a short two sentence in this case, because in the problem description you would have justified adding "empty directories" section).

	Show empty directories to the "Untracked" section as well.
	Because an empty directory by definition does not have
	anything that the user could add, suggest the user to create
	a file to be committed and then add it.

Having said all that, I personally doubt this is a useful change. I may 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?

Previous: Junio C HamanoNext: Leila
Message 11 of 17 in “git-status: Show empty directories”
  1. git-status: Show empty directoriesLeila Muhtasib, Jun 9, 2012
  2. konglu@minatec.inpg.frJun 9, 2012
  3. LeilaJun 9, 2012
  4. Thomas RastJun 9, 2012
  5. LeilaJun 9, 2012
  6. konglu@minatec.inpg.frJun 9, 2012
  7. Thomas RastJun 10, 2012
  8. konglu@minatec.inpg.frJun 10, 2012
  9. LeilaJun 10, 2012
  10. Junio C HamanoJun 11, 2012
  11. Junio C HamanoJun 10, 2012
  12. LeilaJun 10, 2012
  13. konglu@minatec.inpg.frJun 10, 2012
  14. LeilaJun 10, 2012
  15. Junio C HamanoJun 11, 2012
  16. LeilaJun 11, 2012
  17. LeilaJun 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.