Re: [1.8.0] Tracking empty directories
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Feb 2, 2011, 23:23 UTC
- Message-ID
- <AANLkTi=bK7mFS3eWVMWXqZSnv73tafL9AGazk4jPLddp@mail.gmail.com>
- In-Reply-To
- <m3zkqe8xc8.fsf_-_@localhost.localdomain>
On Wed, Feb 2, 2011 at 6:56 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
> The problem with backward compatibility is twofold. First and more > important is while git supports empty tree object (it has it hardcoded > for some time, as it is necessary e.g. for initial diff, or merging > unrelated branches without common ancestor), and there is no problem > with entry for empty tree in a tree object > > 040000 tree 22d5826c087c4b9dcc72e2131c2cfb061403f7eb empty > > there is (supposedly) problem when checking out such tree (see email > referenced above) with an old git. > > Second is that tracking empty directories would require extension to the > git index (storing trees in index, like we store submodules)... but that > is purely local matter.
Instead of using an empty tree, construct a tree containing a single sentinel file whose contents are a suitable warning not to delete/edit said file using pre-1.8.0 git. Meanwhile git-1.8.0 never writes the file to the filesystem. Too ugly?
j.