summaryrefslogtreecommitdiff
path: root/git-svn.perl
Commit message (Collapse)AuthorAgeFilesLines
* git-svn: don't append extra newlines at the end of commit messages.Avery Pennarun2008-06-141-3/+5
| | | | | | | | | | | | | | | | | | | In git, all commits end in exactly one newline character. In svn, commits end in zero or more newlines. Thus, when importing commits from svn into git, git-svn always appends two extra newlines to ensure that the git-svn-id: line is separated from the main commit message by at least one blank line. Combined with the terminating newline that's always present in svn commits produced by git, you usually end up with two blank lines instead of one between the commit message and git-svn-id: line, which is undesirable. Instead, let's remove all trailing whitespace from the git commit on the way through to svn. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn fails in prop_walk if $self->{path} is not emptyChristian Engwer2008-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If url://repo/trunk is the current Git branch, prop_walk strips trunk from the path name. That is useful as, for example "git svn show-ignore" should not return results like trunk/foo but foo if svn:ignore for trunk includes foo. The problem now is that prop_walk strips trunk from the path and then calls itself recursively. But now trunk is missing in the path and get_dir fails, because it is called for a non existing path. The attached patch fixed the problem, by adding the previously stipped $self->{path} in the recursive call. I tested it with my current git-svn repository for the commands show-ignore and show-external. Patch was submitted through http://bugs.debian.org/477393 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a --dry-run option to git-svn rebaseSeth Falcon2008-06-011-0/+6
| | | | | | | | | | When working with multiple branches in an svn repository, it can be useful to verify the svn repository and local tracking branch that will be used for the rebase operation. Signed-off-by: Seth Falcon <seth@userprimary.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix path duplication in git svn commit-diffKarl Hasselström2008-06-011-2/+1
| | | | | | | | | | | | | | | | | | Given an SVN repo file:///tmp/svntest/repo, trying to commit changes to a file proj/trunk/foo.txt in that repo with this command line git svn commit-diff -r2 HEAD^ HEAD file:///tmp/svntest/repo/proj/trunk gave the error message Filesystem has no item: File not found: transaction '2-6', path '/proj/trunk/proj/trunk/foo.txt' This fixes the duplication. Signed-off-by: Karl Hasselström <kha@treskal.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git::cat_blob: allow using an empty blob to fix git-svn breakageJunio C Hamano2008-05-271-2/+2
| | | | | | | | | | | | | Recent "git-svn optimization" series introduced Git::cat_blob() subroutine whose interface was broken in that it returned the size of the blob but signalled an error by returning 0. You can never use an empty blob with such an interface. This fixes the interface to return a negative value to signal an error. Reported by Björn Steinbrink. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ar/batch-cat'Junio C Hamano2008-05-251-22/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ar/batch-cat: change quoting in test t1006-cat-file.sh builtin-cat-file.c: use parse_options() git-svn: Speed up fetch Git.pm: Add hash_and_insert_object and cat_blob Git.pm: Add command_bidi_pipe and command_close_bidi_pipe git-hash-object: Add --stdin-paths option Add more tests for git hash-object Move git-hash-object tests from t5303 to t1007 git-cat-file: Add --batch option git-cat-file: Add --batch-check option git-cat-file: Make option parsing a little more flexible git-cat-file: Small refactor of cmd_cat_file Add tests for git cat-file
| * git-svn: Speed up fetchAdam Roben2008-05-231-22/+20
| | | | | | | | | | | | | | | | | | We were spending a lot of time forking/execing git-cat-file and git-hash-object. We now maintain a global Git repository object in order to use Git.pm's more efficient hash_and_insert_object and cat_blob methods. Signed-off-by: Adam Roben <aroben@apple.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ap/svn'Junio C Hamano2008-05-251-1/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | * ap/svn: git-svn: add test for --add-author-from and --use-log-author git-svn: add documentation for --add-author-from option. git-svn: Add --add-author-from option. git-svn: add documentation for --use-log-author option.
| * | git-svn: Add --add-author-from option.Avery Pennarun2008-05-041-1/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | This option adds a From: line (based on the commit's author information) at the beginning of the body of the commit log message when sending to svn, if a From: or Signed-off-by: header does not exist. This, combined with --use-log-author, can retain the author field of commits through a round trip from git to svn and back. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add svn-compatible "blame" output format to git-svnSteven Grimm2008-05-111-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | git-svn blame produced output in the format of git blame; in environments where there are scripts that read the output of svn blame, it's useful to be able to use them with the output of git-svn. The git-compatible format is still available using the new "--git-format" option. This also fixes a bug in the initial git-svn blame implementation; it was bombing out on uncommitted local changes. Signed-off-by: Steven Grimm <koreth@midwinter.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: fix cloning of HTTP URLs with '+' in their pathEric Wong2008-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | With this, git svn clone -s http://svn.gnome.org/svn/gtk+ is successful. Also modified the funky rename test for this, which _does_ include escaped '+' signs for HTTP URLs. SVN seems to accept either "+" or "%2B" in filenames and directories (just not the main URL), so I'll leave it alone for now. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: Make create-ignore use git add -fGustaf Hendeby2008-05-051-1/+1
|/ | | | | | | | | | When having a svn:ignore that ignores the .gitignore file the -f option to git add must be used to avoid git complaining about adding an ignored file and hence stop the process of creating .gitignores. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: Same default as cvsimport when using --use-log-authorStephen R. van den Berg2008-04-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using git-cvsimport, the author is inferred from the cvs commit, e.g. cvs commit logname is foobaruser, then the author field in git results in: Author: foobaruser <foobaruser> Which is not perfect, but perfectly acceptable given the circumstances. The default git-svn import however, results in: Author: foobaruser <foobaruser@acf43c95-373e-0410-b603-e72c3f656dc1> When using mixes of imports, from CVS and SVN into the same git repository, you'd like to harmonise the imports to the format cvsimport uses. git-svn supports an experimental option --use-log-author which currently results in the same logentry as without that option when no From: or Signed-off-by: is found in the logentry ($email currently ends up empty, and hence is generated again). This patches harmonises the result with cvsimport, and makes git-svn --use-log-author produce: Author: foobaruser <foobaruser> Signed-off-by: Stephen R. van den Berg <srb@cuci.nl> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: detect and fail gracefully when dcommitting to a voidMatthieu Moy2008-04-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | The command git svn clone (URL of an empty SVN repo here) works, creates an empty git repository. I can perform the initial commit there, but then, "git svn dcommit" says : Use of uninitialized value in concatenation (.) or string at .../git-svn line 414. Committing to ... Unable to determine upstream SVN information from HEAD history I guess a correct management of the initial commit in git-svn would be hard to implement, but at least, the error message can be improved. First step is something like the patch below, and better would be for "git svn clone" to warn that it won't be able to do much with the cloned repo. Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint-1.5.4' into maintJunio C Hamano2008-04-221-2/+5
|\ | | | | | | | | | | | | | | | | | | * maint-1.5.4: svn-git: Use binmode for reading/writing binary rev maps diff options documentation: refer to --diff-filter in --name-status git-svn bug with blank commits and author file archive.c: format_subst - fixed bogus argument to memchr copy.c: copy_fd - correctly report write errors gitattributes: Fix subdirectory attributes specified from root directory
| * svn-git: Use binmode for reading/writing binary rev mapsMichael Weber2008-04-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, there is a possible interaction with UTF-8 locales in combination with PERL_UNICODE, resulting in "inconsistent size: 40" or "read:"-type errors. See also: perldoc -f binmode <http://perldoc.perl.org/perl581delta.html#UTF-8-no-longer-default-under-UTF-8-locales> Signed-off-by: Michael Weber <michaelw@foldr.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-svn bug with blank commits and author fileThomas Guyot-Sionnest2008-04-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to import from svn using an author file, git-svn bails out if it encounters a blank author. The attached patch changes this behavior and allow using the author file with blanks authors. I came across this bug while importing from a cvs2svn repo where the initial revision (1) has a blank author. This doesn't break the behavior of bailing out when an unknown author is encountered. Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Force the medium pretty format on calls to git logPedro Melo2008-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user has customized format.pretty in config, git-svn rebase fails with: Unable to determine upstream SVN information from working tree history because the command expects to read the commit log in the default format. This fixes the command to explicitly ask for the format it wants to read from. Signed-off-by: Pedro Melo <melo@simplicidade.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: fix following renamed paths when tracking a single pathEric Wong2008-04-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using git-svn to follow only a single (empty) path per svn-remote (i.e. not using --stdlayout), following the history of a renamed path was broken in c586879cdfa4f8181a14e953a9152a4639eef333. This reverts the regression for the single (emtpy) path per svn-remote case. To avoid breaking the tests in a committed revision, this is an addendum to a patch originally submitted by Santhosh Kumar Mani <santhoshmani@gmail.com>: > git-svn: add test for renamed directory fetch > > This test tries to fetch a directory which had renames in the > history from a SVN repository. [ew: unneccesary dependency on the starting an HTTP server removed from Santhosh's original test.] Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: remove redundant slashes from show-ignoreEric Wong2008-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jonathan Scott Duff wrote: > Recently I tried "git svn showignore" on my parrot repository and it > failed. I tracked it down to the prop_walk() sub. When it recurses, > $path has an extra / on the beginning (i.e., when it recurses, it > tries to get the props for "//apps" instead of "/apps"). I *think* > this is because $path is used in the recursive call rather than $p > (which seems to contain a properly transformed $path). Anyway, I've > attached a patch that works for me and I think is generally the right > thing. Patch-submitted-by: Jonathan Scott Duff Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Don't try and percent-escape existing percent escapes in git-svn URIsKevin Ballard2008-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | git-svn project names are percent-escaped ever since f5530b8 (git-svn: support for funky branch and project names over HTTP(S), 2007-11-11). Unfortunately this breaks the scenario where the user hands git-svn an already-escaped URI. Fix the regexp to skip over what looks like existing percent escapes, and test this scenario. Signed-off-by: Kevin Ballard <kevin@sb.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2008-03-151-1/+2
|\ \ | |/ | | | | | | | | | | | | * maint: Make man page building quiet when DOCBOOK_XSL_172 is defined git-new-workdir: Share SVN meta data between work dirs and the repository rev-parse: fix meaning of rev~ vs rev~0. git-svn: don't blindly append '*' to branch/tags config
| * git-svn: don't blindly append '*' to branch/tags configEric Wong2008-03-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, git-svn would blindly append '*' even if it was specified by the user during initialization (for certain SVN setups, it is necessary). Now, the following command will work correctly: git svn init -T trunk/docutils \ -t 'tags/*/docutils' \ -b 'branches/*/docutils' \ svn://svn.berlios.de/docutils Thanks to martin f krafft for the bug report: > My git-svn target configuration is > > [svn-remote "svn"] > url = svn://svn.berlios.de/docutils > fetch = trunk/docutils:refs/remotes/trunk > branches = branches/*/docutils:refs/remotes/* > tags = tags/*/docutils:refs/remotes/tags/* > > Unfortunately, when I run > > git-svn init -T trunk/docutils -t 'tags/*/docutils' > -b 'branches/*/docutils' > > then I get (note the two asterisks on the left hand side): > > branches = branches/*/docutils/*:refs/remotes/* > tags = tags/*/docutils/*:refs/remotes/tags/* > > I took a brief stab at the code but I can't even figure out where > the /* is appended, so I defer to you. > > It should be trivial to keep git-svn from appending /* if the left > side already contains an asterisk. Signed-off-by: Eric Wong <normalperson@yhbt.net> Tested-by: martin f krafft <madduck@madduck.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2008-03-111-1/+2
|\ \ | |/ | | | | | | | | | | | | * maint: git-svn: fix find-rev error message when missing arg t0021: tr portability fix for Solaris launch_editor(): allow spaces in the filename git rebase --abort: always restore the right commit
| * git-svn: fix find-rev error message when missing argMarc-Andre Lureau2008-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | Just let the user know that a revision argument is missing instead of a perl error. This error message mimic the "init" error message, but could be improved. Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint' to sync with 1.5.4.4Junio C Hamano2008-03-081-1/+6
|\ \ | |/ | | | | | | | | | | | | * maint: GIT 1.5.4.4 ident.c: reword error message when the user name cannot be determined Fix dcommit, rebase when rewriteRoot is in use Really make the LF after reset in fast-import optional
| * Fix dcommit, rebase when rewriteRoot is in useJohn Goerzen2008-03-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the rewriteRoot setting is used with git-svn, it causes the svn IDs added to commit messages to bear a different URL than is actually used to retrieve Subversion data. It is common for Subversion repositories to be available multiple ways: for instance, HTTP to the public, and svn+ssh to people with commit access. The need to switch URLs for access is fairly common as well -- perhaps someone was just given commit access. To switch URLs without having to rewrite history, one can use the old url as a rewriteRoot, and use the new one in the svn-remote url setting. This works well for svn fetching and general git commands. However, git-svn dcommit, rebase, and perhaps other commands do not work in this scenario. They scan the svn ID lines in commit messages and attempt to match them up with url lines in [svn-remote] sections in the git config. This patch allows them to match rewriteRoot options, if such options are present. Signed-off-by: John Goerzen <jgoerzen@complete.org> Acked-by: Eric Wong <normalperson@yhbt.net>
| * git-svn: Don't prompt for client cert password everytime.Sebastian Noack2008-02-271-0/+1
| | | | | | | | | | | | Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: Don't prompt for client cert password everytime.Sebastian Noack2008-02-271-0/+1
| | | | | | | | | | Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add `git svn blame' commandTim Stoakes2008-02-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | This command is identical to `git blame', but it shows SVN revision numbers instead of git commit hashes. [ew: support "^initial commit" and minor formatting fixes] Signed-off-by: Tim Stoakes <tim@stoakes.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: improve repository URL matching when following parentsEric Wong2008-02-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can avoid the spawning of a new SVN::Ra session by reusing the existing one. The most problematic issue is that some svn servers disallow too many connections from a single IP, so this will allow git-svn to fetch from those repositories with a higher success rate by using fewer connections. This sometimes showed up as a new (and redundant) [svn-remote "$parent_refname"] entry in $GIT_DIR/svn/.metadata. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Let "git svn" run "git gc --auto" occasionallyKarl Hasselström2008-02-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let "git svn" run "git gc --auto" every 1000 imported commits to reduce the number of loose objects. To handle the common use case of frequent imports, where each invocation typically fetches much less than 1000 commits, also run gc unconditionally at the end of the import. "1000" is the same number that was used by default when we called git-repack. It isn't necessarily still the best choice. Signed-off-by: Karl Hasselström <kha@treskal.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: Don't call git-repack anymoreKarl Hasselström2008-02-031-11/+3
|/ | | | | | | | | | | | In a moment, we'll start calling git-gc --auto instead, since it is a better fit to what we're trying to accomplish. The command line options are still accepted, but don't have any effect, and we warn the user about that. Signed-off-by: Karl Hasselström <kha@treskal.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: default to repacking every 1000 commitsEric Wong2008-01-221-6/+4
| | | | | | | | | This should reduce disk space usage when doing large imports. We'll be switching to "gc --auto" post-1.5.4 to handle repacking for us. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: handle leading/trailing whitespace from svnsync revpropsEric Wong2008-01-121-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repositories generated by svnsync cannot be relied on to have properly set revprops without newlines in UUIDs and URLs. There may be broken versions of svnsync out there that append extra newlines to UUIDs, or the revprops could've been changed by repository administrators at any time, too. At least one repository we've come across has an embedded newline erroneously set in the svnsync-uuid prop. This is bad because the trailing newline is taken as another record by the Git.pm library, and the wantarray detection causes tmp_config() to return an array with an empty-but-existing second element. We will now strip leading and trailing whitespace both before setting and after reading the uuid and url for svnsync values. We will also force tmp_config to return a single scalar when reading existing values. SVN UUIDs should never have whitespace in them, and SVN repository URLs should be URI-escaped, so neither of those values we ever see in git-svn should actually have whitespace in them. Thanks to Dennis Schridde for the bug report and Junio for helping diagnose this. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Trim leading / off of paths in git-svn prop_walkKevin Ballard2008-01-091-0/+1
| | | | | | | | | | | prop_walk adds a leading / to all subdirectory paths. Unfortunately this causes a problem when the remote repo lives in a subdirectory itself, as the leading / causes subsequent PROPFIND calls to be executed on the wrong path. Trimming the / before calling the PROPFIND fixes this problem. Signed-off-by: Kevin Ballard <kevin@sb.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge in GIT 1.5.3.8Junio C Hamano2008-01-081-0/+4
|\ | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-svn: clarify the "Ignoring error from SVN" pieceEric Wong2008-01-071-0/+4
| | | | | | | | | | | | | | | | | | I've heard of several users puzzled by this, and it sometimes it appears as if git-svn is doing nothing on slower connections and larger repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-svn: support for funky branch and project names over HTTP(S)Eric Wong2008-01-071-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | SVN requires that paths be URI-escaped for HTTP(S) repositories. file:// and svn:// repositories do not need these rules. Additionally, accessing individual paths inside repositories (check_path() and get_log() do NOT require escapes to function and in fact it breaks things). Noticed-by: Michael J. Cohen <mjc@cruiseplanners.com> Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: unlink index files that were globbed, tooEric Wong2008-01-021-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | commit 3157dd9e89a71e80673d0bc21b5c0630f3b1fe68 (git-svn: unlink internal index files after operations) introduced unlinking index files after fetching. However, this missed indices for refs that were created by globbing branches and tags. This will track all refs we ever touch during a fetch and unlink them at exit time. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: allow dcommit --no-rebase to commit multiple, dependent changesEric Wong2008-01-021-2/+2
| | | | | | | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: avoid warning when run without argumentsEric Wong2007-12-191-2/+2
| | | | | | | | | | | | | | While we're in the area, finish writing a halfway-written comment describing what that block does... Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: workaround a for broken symlinks in SVNEric Wong2007-12-191-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible for bad clients to commit symlinks without the 5-character "link " prefix in symlinks. So guard around this bug in SVN and make a best effort to create symlinks if the "link " prefix is missing. More information on this SVN bug is described here: http://subversion.tigris.org/issues/show_bug.cgi?id=2692 To be pedantic, there is still a corner case that neither we nor SVN can handle: If somebody made a link using a broken SVN client where "link " is the first part of its path, e.g. "link sausage", then we'd end up having a symlink which points to "sausage" because we incorrectly stripped the "link ". Hopefully this hasn't happened in practice, but if it has, it's not our fault SVN is broken :) Thanks to Benoit Sigoure and Sverre Johansen for reporting and feedback. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: avoid leaving leftover committer/author info in rebaseEric Wong2007-12-191-11/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We set the 6 environment variables for controlling committer/author email/name/time for every commit. We do this in the parent process to be passed to git-commit-tree, because open3() doesn't afford us the control of doing it only in the child process. This means we leave them hanging around in the main process until the next revision comes around and all 6 environment variables are overwridden again. Unfortunately, for the last commit, leaving them hanging around means the git-rebase invocation will pick it up, rewriting the rebased commit with incorrect author information. This should fix it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | git-svn: handle our top-level path being deleted and later re-addedEric Wong2007-12-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, git-svn would ignore cases where the path we're tracking is removed from the repository. This was to prevent heads with follow-parent from ending up with a tree full of empty revisions (and thus breaking rename detection). The previous behavior is fine until the path we're tracking is re-added later on, leading to the old files being merged in with the new files in the directory (because the old files were never marked as deleted) We will now only remove all the old files locally that were deleted remotely iff we detect the directory we're in is being created from scratch. Thanks for Marcus D. Hanwell for the bug report and Peter Baumann for the analysis. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: unlink internal index files after operationsEric Wong2007-12-131-0/+3
| | | | | | | | | | | | | | | | | | Being git, we can generate these very quickly on the fly as needed, so there's no point in wasting space for these things for large projects. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: expand handling of From: and Signed-off-by:Andy Whitcroft2007-12-131-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current parsing for From: and Signed-off-by: lines handles fully specified names: From: Full Name <email@address> Expand this to include the raw email addresses and straight "names": From: email@address -> email <email@address> From: Full Name -> Full Name <unknown> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ew/svn-rev-db'Junio C Hamano2007-12-121-101/+222
|\ \ | | | | | | | | | | | | | | | * ew/svn-rev-db: git-svn: reinstate old rev_db optimization in new rev_map git-svn: replace .rev_db with a more space-efficient .rev_map format
| * | git-svn: reinstate old rev_db optimization in new rev_mapEric Wong2007-12-101-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reinstates an old optimization in .rev_db which stored the highest revision number we scanned, allowing us to avoid scanning the SVN log for those revisions again in a subsequent invocation. This means the last 24-byte record in a .rev_map file can be a 4-byte SVN revision number with 20-bytes of zeroes representing a non-existent commit. This record can and will be overwritten when a new commit iff the commit is all zeroes. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-svn: replace .rev_db with a more space-efficient .rev_map formatEric Wong2007-12-101-104/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrations are done automatically on an as-needed basis when new revisions are to be fetched. Stale remote branches do not get migrated, yet. However, unless you set noMetadata or useSvkProps it's safe to just do: find $GIT_DIR/svn -name '.rev_db*' -print0 | xargs rm -f to purge all the old .rev_db files. The new format is a one-way migration and is NOT compatible with old versions of git-svn. This is the replacement for the rev_db format, which was too big and inefficient for large repositories with a lot of sparse history (mainly tags). The format is this: - 24 bytes for every record, * 4 bytes for the integer representing an SVN revision number * 20 bytes representing the sha1 of a git commit - No empty padding records like the old format - new records are written append-only since SVN revision numbers increase monotonically - lookups on SVN revision number are done via a binary search - Piping the file to xxd(1) -c24 is a good way of dumping it for viewing or editing, should the need ever arise. As with .rev_db, these files are disposable unless noMetadata or useSvmProps is set. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>