Re: [PATCH/RFC] git-svn: New flag to add a file in empty directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 18, 2011 at 3:22 AM, Michael Haggerty <mhagger@xxxxxxxxxxxx> wrote:
>
> I'm not familiar enough with the code to critique your code, but I have
> some questions/comments about the feature's intended behavior:
>
> 1. What happens if a previously empty directory is deleted from
> Subversion?  It seems to me that consistency would demand that the
> placeholder file be deleted so that git also forgets about the
> directory.  On the other hand, if the user has edited the placeholder
> file since it was created, it might be advisable to emit a warning or error.
>
When directories are deleted from a Subversion repository (empty or
not), the corresponding Git directory and all its constituent files
are removed one by one.  This takes care of any placeholder files that
may have been added.

This happens inside SVN::Git::Fetcher::delete_entry around line 4210.

> 2. What happens if, in Subversion, content is added to a previously
> empty directory?  Is the placeholder left around?
>
True, the placeholder sticks around in this case.  It wouldn't be hard
to track when a placeholder file is generated and remove it when it's
no longer needed.

Tracking the placeholder files would also be useful for namespace
collisions.  For example, if a Subversion repository adds a .gitignore
file to a previously committed empty directory.  The Subversion add
would need to be translated into a Git modification.  I'm not sure how
to store this information in the long-term tracking case, though.

> 3. I believe that this feature would be useful to people who are
> tracking a Subversion repository over time (not just for full
> migrations).  What happens if the user sometimes uses the new options
> and sometimes not?  Are the missing directories that have "accumulated"
> since the last invocation with --preserve-empty-dirs all added in the
> first commit resulting from a later use of --preserve-empty-directories,
> or are they skipped forever?  I'm talking about this scenario:
>
> Subversion                   git
> ----------                   ---
> Add empty directory "a"
>                             git svn fetch --preserve-empty-dirs
> Add empty directory "b"
>                             git svn fetch
> Add empty directory "c"
>                             git svn fetch --preserve-empty-dirs
>
> After the third "git svn fetch", does the git repository contain
> directory "b"?
>
In this case, the git repository would not contain the "b" directory,
but it would exist in the user's working copy without a placeholder
file.  I can only think of two situations when this is inappropriate.
First, if the user checks out earlier revisions, the empty directories
would persist.  Second, if anybody clones the Git repository, they'd
be missing the empty directories.

How problematic are these two cases?  I think re-fetching everything
from the Subversion repository is the only way to fix this.

If support for long-term tracking is deemed desirable, then maybe this
feature should be on by default.  Otherwise, you increase the chance
that repository data will be irrevocably damaged.

- Ray
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]