Re: [RFC PATCH] Re: Empty directories...

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tomash Brechko
Date: Thursday, July 19, 2007 - 3:51 am

Dear Git fellows,

A year or so ago I too would strongly advocate the need of tracking
empty directories, permissions et al., it seemed so "natural" and
"plain obvious" to me back then.  But since that time I learned to
appreciate the "contents tracking" approach, and now view directories
(paths in general) only as the means for Git to know where to put the
contents on checkout.  This, BTW, is consistent with how Git figures
container copies/renames.

No doubt mighty Git developers can add support for empty directories,
manage to stay backward compatible, think out consistent user
interface etc.  But there's no end to how much information one may
want to store in Git to make it "_file system_ contents tracking
software".  Starting with empty directories, one may argue then that
certain installation trees also need particular file ownership, so
lets store user/group names like tar does.  It was mentioned already
in this thread that in addition to 'rwx' we also would have to store
ACLs (some OSes have only one of these concepts, some both), SELinux
security contexts, perhaps other arbitrary file attributes that may be
part of file system state.

Wouldn't it be better to preserve Git as a contents tracking system,
and add some tools on top of it that can translate file system state
into textual (or binary) form, so it can be stored in current Git?
And then use this textual representation to restore actual file system
attributes/layout on checkout?  And the only change in Git itself
would be some more hooks, for instance one hook before checking out
over the old work tree, and one after the checkout.  Or one can simply
wrap certain Git commands to implement such hooks.

In any case, no one is going to be against the new feature if it won't
break anything for those of us who find the pure contents tracking the
right thing.  And storing empty directories by default may not be
natural for everyone.  So before going into technical details of how
this can possibly be implemented, could someone answer the following:

1 Is Git going to track directories _always_?  Looks like not, because
  in this thread there seems to be a distinction between 'git add DIR'
  and 'git add DIR/FILE', i.e. not everyone is sure if in the last
  case Git should track DIR or not.

2 If Git will track only explicitly mentioned directories, then what
  about recursive operations?  Will it add only files by default, or
  directories too?  Perhaps there will be some --add-dirs option to
  'git add'.

3 Since in certain recursive operations one will want to affect
  directories too, how .gitignore will look?  Most files have a notion
  of extension, so me may say '*.o', but with directories things a bit
  more complicated.  One would want to say "exclude DIR2 only if under
  DIR1 at any hierarchy depth", i.e. exclude paths matching
  qr%DIR1/(.+/)?DIR1/%, and shell wildcards aren't that expressive,
  '*' doesn't cross hierarchy.  Note that we live without this now,
  but this will be the next "natural" demand once directories become
  first class citizens.


This list is surely incomplete.  The point is that before we go into
technical details, let's consider what exactly we are going to
implement, how this will affect current usage model, how (empty)
directory handling will extend to future similar demands, etc.  My
fear is that once some patch is around, it's very tempting to accept
it.  And once it is in, it's almost impossible to remove the feature
later.


Regards,

-- 
   Tomash Brechko
-
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:
Empty directories..., David Kastrup, (Tue Jul 17, 5:13 pm)
Re: Empty directories..., Johannes Schindelin, (Tue Jul 17, 5:35 pm)
Re: Empty directories..., Matthieu Moy, (Tue Jul 17, 5:39 pm)
Re: Empty directories..., Junio C Hamano, (Tue Jul 17, 7:23 pm)
Re: Empty directories..., David Kastrup, (Tue Jul 17, 10:56 pm)
Re: Empty directories..., David Kastrup, (Tue Jul 17, 11:07 pm)
Re: Empty directories..., Wincent Colaiuta, (Tue Jul 17, 11:34 pm)
Re: Empty directories..., Junio C Hamano, (Tue Jul 17, 11:53 pm)
Re: Empty directories..., Johannes Schindelin, (Wed Jul 18, 3:26 am)
Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 9:23 am)
Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 9:33 am)
Re: Empty directories..., Matthieu Moy, (Wed Jul 18, 9:39 am)
Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 10:06 am)
Re: Empty directories..., David Kastrup, (Wed Jul 18, 10:34 am)
Re: Empty directories..., David Kastrup, (Wed Jul 18, 10:38 am)
Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 11:05 am)
Re: Empty directories..., David Kastrup, (Wed Jul 18, 2:37 pm)
Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 2:45 pm)
Re: Empty directories..., David Kastrup, (Wed Jul 18, 4:13 pm)
[RFC PATCH] Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 4:16 pm)
Re: [RFC PATCH] Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 4:40 pm)
Re: [RFC PATCH] Re: Empty directories..., David Kastrup, (Wed Jul 18, 4:42 pm)
Re: [RFC PATCH] Re: Empty directories..., Linus Torvalds, (Wed Jul 18, 5:22 pm)
Re: [RFC PATCH] Re: Empty directories..., Junio C Hamano, (Wed Jul 18, 10:28 pm)
Re: [RFC PATCH] Re: Empty directories..., Shawn O. Pearce, (Wed Jul 18, 10:38 pm)
Re: [RFC PATCH] Re: Empty directories..., Shawn O. Pearce, (Wed Jul 18, 11:09 pm)
Re: [RFC PATCH] Re: Empty directories..., Matthieu Moy, (Thu Jul 19, 1:13 am)
Re: [RFC PATCH] Re: Empty directories..., Tomash Brechko, (Thu Jul 19, 3:51 am)
Re: [RFC PATCH] Re: Empty directories..., Johannes Schindelin, (Thu Jul 19, 5:16 am)
Re: Empty directories..., Johan Herland, (Fri Jul 20, 1:29 am)
Re: Empty directories..., Robin Rosenberg, (Thu Jul 26, 4:33 pm)
Re: Empty directories..., David Kastrup, (Thu Jul 26, 10:22 pm)