git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ray Chen <rchen@cs.umd.edu>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git@vger.kernel.org, Eric Wong <normalperson@yhbt.net>
Subject: Re: [PATCH/RFC] git-svn: New flag to add a file in empty directories
Date: Wed, 18 May 2011 06:46:25 -0400	[thread overview]
Message-ID: <BANLkTi=of41DdZAqxAZkgjuuqo3bVpjexA@mail.gmail.com> (raw)
In-Reply-To: <4DD373CD.6010607@alum.mit.edu>

On Wed, May 18, 2011 at 3:22 AM, Michael Haggerty <mhagger@alum.mit.edu> 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

  parent reply	other threads:[~2011-05-18 10:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 22:00 [PATCH/RFC] git-svn: New flag to add a file in empty directories Ray Chen
2011-05-18  7:22 ` Michael Haggerty
2011-05-18  8:33   ` Eric Wong
2011-05-18  9:14     ` Michael J Gruber
2011-05-18 11:10       ` Ray Chen
2011-05-18 10:59     ` Ray Chen
2011-05-18 20:01       ` Eric Wong
2011-05-19  3:11     ` Michael Haggerty
2011-05-18 10:46   ` Ray Chen [this message]
2011-05-18  8:22 ` Eric Wong
2014-07-23  0:06 ` Gaffney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=of41DdZAqxAZkgjuuqo3bVpjexA@mail.gmail.com' \
    --to=rchen@cs.umd.edu \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).