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

Re: [PATCH 1/4] git.el: Support for showing unknown/ignored directories.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Feb 22, 2008, 15:53 UTC
Message-ID
<8763whkmxf.fsf@wine.dyndns.org>
In-Reply-To
<20080222153051.GA20984@diana.vm.bytemark.co.uk>
Karl Hasselström <kha@treskal.com> writes:
Show 15 quoted lines
> On 2008-02-07 13:50:19 +0100, Alexandre Julliard wrote:
>
>> Instead of recursing into directories that only contain unknown
>> files, display only the directory itself. Its contents can be
>> expanded with git-find-file (bound to C-m).
>
> I have a bunch of directories in my tree with only ignored files in
> them. They used to not show up at all, but now they do. If I press
> return with the cursor on top of one of them, it vanishes (which is
> equivalent to expanding to all the 0 non-ignored files in that
> directory, I guess).
>
> I presume this wasn't the intended behavior? I like the idea for
> subdirectories that actually contain non-ignored files, but
> directories with only ignored files should really not be shown at all.
It probably needs something like this:
From b32a397a64eec64d433aa0ee00147003723cfeee Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Fri, 22 Feb 2008 16:48:53 +0100
Subject: [PATCH] git.el: Do not display empty directories.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 contrib/emacs/git.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index d91fbb8..7cb86df 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -753,7 +753,7 @@ Return the list of files that haven't been handled."
 (defun git-run-ls-files-with-excludes (status files default-state &rest options)
   "Run git-ls-files on FILES with appropriate --exclude-from options."
   (let ((exclude-files (git-get-exclude-files)))
-    (apply #'git-run-ls-files status files default-state "--directory"
+    (apply #'git-run-ls-files status files default-state "--directory" "--no-empty-directory"
            (concat "--exclude-per-directory=" git-per-dir-ignore-file)
            (append options (mapcar (lambda (f) (concat "--exclude-from=" f)) exclude-files)))))
 
-- 
1.5.4.1.132.gd85f75

-- 
Alexandre Julliard
julliard@winehq.org
Previous: Karl HasselströmNext: Karl Hasselström
Message 3 of 8 in “git.el: Support for showing unknown/ignored directories.”
  1. 1/4 git.el: Support for showing unknown/ignored directories.Alexandre Julliard, Feb 7, 2008
  2. Karl HasselströmFeb 22, 2008
  3. Alexandre JulliardFeb 22, 2008
  4. Karl HasselströmFeb 22, 2008
  5. Karl HasselströmFeb 27, 2008
  6. Junio C HamanoFeb 27, 2008
  7. Karl HasselströmFeb 28, 2008
  8. Junio C HamanoFeb 28, 2008

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.