Re: why still no empty directory support in git

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Git Mailing List <git@...>
Date: Tuesday, December 30, 2008 - 4:58 am

On Tue, 30 Dec 2008, demerphq wrote:



Delivering mail into a Maildir is a three-step process.  Let's say 
we are delivering to a Maildir spool stored in ~/Maildir.

(1)

The message is written out to ~/Maildir/tmp/some_filename.

(2)

When the message is complete, it is rename()d to 
~/Maildir/new/some_name.

(3)

When a mail user agent reads the Maildir spool, it checks new/ for new 
mail. If there is a message there, it renames it to 
~/Maildir/cur/some_other_filename and announces to the user, "You've got 
mail!"

So, let's say I take your suggestion.

$ touch ~/Maildir/new/.exists
$ git add ~/Maildir/new/.exists && git commit -m "La di da"

Now a spec-compliant Maildir user agent will attempt to deliver this new 
"email message" of zero bytes into the mail spool and assign it a message 
UID.  Doing so will remove it from Maildir/new.

Then I do "git pull" to get the new messages from my mail server's Maildir 
repository for my email.  This causes git read-tree to eventually be run. 
If the new tree has no unprocessed email, git runs rmdir() on 
~/Maildir/new/.

Now if I want to write a new email to ~/Maildir/ (such as due to copying 
an email from another folder), the Maildir user agent suddenly finds 
itself in a strange place: new/ does not exist, violating the definition 
of a Maildir. This breaks mail processing for that ~/Maildir/ folder.

This is because git is removing these directories. There is a strict 
incompatibility between git rmdir()ing empty directories behind my back 
and Maildir systems.

I hope that explains the issue I face, both to Junio and to Yves.

Note that for me, there is no issue with how to handle merging of empty 
directories, or what happens if these empty directories become files, or 
which empty directories to keep around; if git just never rmdir()s any 
directories for me, and otherwise acts identically to now, that would 
solve my problem. I can look into preparing an RFC patch that creates a 
mode like that.

-- Asheesh.

-- 
You will be the last person to buy a Chrysler.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
why still no empty directory support in git, Ping Yin, (Mon Dec 29, 11:42 pm)
Re: why still no empty directory support in git, Johannes Schindelin, (Tue Dec 30, 8:09 am)
Re: why still no empty directory support in git, Michael Gaber, (Tue Dec 30, 10:21 am)
Re: why still no empty directory support in git, Liu Yubao, (Tue Dec 30, 2:09 am)
Re: why still no empty directory support in git, Anatol Pomozov, (Wed Dec 31, 10:50 pm)
Re: why still no empty directory support in git, Asheesh Laroia, (Tue Dec 30, 1:10 am)
Re: why still no empty directory support in git, Asheesh Laroia, (Tue Dec 30, 2:25 am)
Re: why still no empty directory support in git, demerphq, (Tue Dec 30, 4:43 am)
Re: why still no empty directory support in git, Asheesh Laroia, (Tue Dec 30, 4:58 am)
Re: why still no empty directory support in git, Jeff King, (Thu Jan 1, 4:06 pm)
Re: why still no empty directory support in git, Asheesh Laroia, (Thu Jan 8, 3:12 am)
Re: why still no empty directory support in git, Johannes Schindelin, (Fri Jan 2, 2:55 pm)
Re: why still no empty directory support in git, Asheesh Laroia, (Fri Jan 2, 5:31 pm)
Re: why still no empty directory support in git, David Brown, (Tue Dec 30, 9:06 pm)
Re: why still no empty directory support in git, Jeff Whiteside, (Tue Dec 30, 1:28 am)
Re: why still no empty directory support in git, Robin Rosenberg, (Tue Dec 30, 2:58 am)
Re: why still no empty directory support in git, Ping Yin, (Tue Dec 30, 11:36 am)
Re: why still no empty directory support in git, Junio C Hamano, (Tue Dec 30, 3:45 am)