git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
EWEric Wong <normalperson@yhbt.net>
Date
May 18, 2011, 08:22 UTC
Message-ID
<20110518082215.GA21899@dcvr.yhbt.net>
In-Reply-To
<1305669635-10861-1-git-send-email-rchen@cs.umd.edu>
Ray Chen <rchen@cs.umd.edu> wrote:
> I needed this functionality when I was migrating a repository from SVN to
> Git.

This feature sounds reasonable for folks making one-shot or read-only mirrors with git svn.

> My knowledge of SVN is limited, so I'm not sure how correct this patch is.
> I created a little test SVN repo, and `git svn clone --preserve-empty-dirs`
> did the right thing, but that's hardly a complete test.

Please provide an automated test case so it's easier to review (I almost never see SVN repos anymore) and to ensure it stays working when other changes are made.

> Specifically, I experimentally noticed that my patch worked with lines 4532
> and 4533 commented out.  I'm not sure what problems might occur when adding
> a file Git without associated SVN properties.
These two lines?
Show 5 quoted lines
> +	# The following two lines don't seem to be necessary, but I'm not
> +	# familiar enough with SVN properties to know if correctness is
> +	# compromised without them.
> +#	$self->{file_prop}->{$path} = $self->{dir_prop}->{$dir};
> +#	$self->add_file($path, { 'path' => $dir }, undef, '-1');

It's been years since I dealt with the SVN library, so I'm not sure I still remember. I think add_file is only for files that exist in the SVN side, not sure about the file_prop/dir_prop assignment, either.

(more in my reply to Michael's email)
-- 
Eric Wong
Previous: Ray ChenNext: Gaffney
Message 10 of 11 in “git-svn: New flag to add a file in empty directories”
  1. git-svn: New flag to add a file in empty directoriesRay Chen, May 17, 2011
  2. Michael HaggertyMay 18, 2011
  3. Eric WongMay 18, 2011
  4. Michael J GruberMay 18, 2011
  5. Ray ChenMay 18, 2011
  6. Ray ChenMay 18, 2011
  7. Eric WongMay 18, 2011
  8. Michael HaggertyMay 19, 2011
  9. Ray ChenMay 18, 2011
  10. Eric WongMay 18, 2011
  11. GaffneyJul 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.