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

Re: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()

From
Junio C Hamano <gitster@pobox.com>
Date
May 1, 2013, 17:09 UTC
Message-ID
<7vhaim8w48.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1409591910.20130501123153@gmail.com>
Ilya Basin <basinilya@gmail.com> writes:
Show 15 quoted lines
> IB> In my repo the placeholders change too often (in 1/4 commits). I'm
> IB> thinking of using:
> IB> 'git config --unset "svn-remote.$repo_id.added-placeholder" path_regex'
> IB> instead of full rewrite.
>
> I need your help. There are still problems:
>
>     $ grep "define MAX_MATCHES" ~/builds/git/git-git/config.c
>     #define MAX_MATCHES 8192
>
>     $ grep added-placeholder .git/config | wc -l
>     4430
>
> 1/4 commits change the list of placeholders, usually 1 folder changes.
> Clearing and re-adding the entries to the config takes ~1 minute.

While I agree both "git config"'s external interface and internal implementation are not suited for bulk update, I have a suspicion that the config mechanism is not the right place to store this information in the first place. The config is a per-Git-repository state that is not versioned, which means it is applicable regardless of individual commits or trees (also it means it is designed not to be shared across repositories). But "You may see a file here that otherwise should not be there only to mark that there should be an empty directory" is an attribute to a particular tree, isn't it?

If you have a branch that git-svn adds a placeholder file (hence you want to annotate that tree with "This directory is there only to hold the placeholder file") and you want to perform a merge on the Git side of that branch with another Git branch that does have real contents in that directory, you would want the result to say "This directory no longer is just for a placeholder", but you cannot say that globally by updating the config file, as the config mechanism is also applied to the original branch that came from git-svn, in which the directory in question is still only to hold the placeholder file.

A Subversion-only history does not have a reason to have .gitignore file tracked in it; wouldn't a cleaner implementation to consider a directory that has .gitignore and nothing else marked with "added placeholder", without (ab)using the config mechanism? If you are worried about a corner case where the Subversion side adds the file, even though it is not used there, probably you can add a single comment line "# added by git-svn only to keep the directory" and consider a directory that has nothing but .gitignore that consists of only that exact comment line an "added placeholder" directory to work it around. Either approach would tie the information to the tree state, which sounds like a much more correct approach to the "keep empty directory" problem to me.

Previous: Ilya BasinNext: Ilya Basin
Message 3 of 18 in “Re: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()”
  1. Ilya BasinMay 1, 2013
  2. Re[2]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 1, 2013
  3. Junio C HamanoMay 1, 2013
  4. Re[2]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 1, 2013
  5. Eric WongMay 1, 2013
  6. Junio C HamanoMay 1, 2013
  7. Eric WongMay 2, 2013
  8. Re[2]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 2, 2013
  9. Eric WongMay 2, 2013
  10. Re[2]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 3, 2013
  11. Re[3]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 3, 2013
  12. Re[4]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 6, 2013
  13. Re[3]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 6, 2013
  14. Eric WongMay 9, 2013
  15. Re[4]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 28, 2013
  16. Ray ChenMay 2, 2013
  17. Re[2]: [PATCH 4/5] git-svn: fix bottleneck in stash_placeholder_list()Ilya Basin, May 2, 2013
  18. Eric WongMay 2, 2013

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.