summaryrefslogtreecommitdiff
path: root/git-svnimport.perl
AgeCommit message (Collapse)AuthorFilesLines
2007-09-24Fix pool handling in git-svnimport to avoid memory leaks.Libravatar Stefan Sperling1-11/+12
- Create an explicit one-and-only root pool. - Closely follow examples in SVN::Core man page. Before calling a subversion function, create a subpool of our root pool and make it the new default pool. - Create a subpool for looping over svn revisions and clear this subpool (i.e. it mark for reuse, don't decallocate it) at the start of the loop instead of allocating new memory with each iteration. See http://marc.info/?l=git&m=118554191513822&w=2 for a detailed explanation of the issue. Signed-off-by: Stefan Sperling <stsp@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18git-svnimport: Use separate arguments in the pipe for git-rev-parseLibravatar Matthias Urlichs1-1/+1
Some people seem to create SVN branch names with spaces or other shell metacharacters. Signed-off-by: Matthias Urlichs <smurf@smurf.noris.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-07(cvs|svn)import: Ask git-tag to overwrite old tags.Libravatar Michael Smith1-1/+1
If the tag was moved in CVS or SVN history, it will be moved in the imported history as well. Tag history is not tracked. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13Allow git-svnimport to take "" as the trunk directory.Libravatar Alberto Bertogli1-1/+1
Some repositories started with the trunk in "/" and then moved it to the standard "trunk/" location. On these repositories, the correct thing would be to call git-svnimport -T "", but because of the way the options are handled, it uses the default "trunk" instead of the given empty string. This patch fixes that behaviour. Reported by Leandro Lucarella <llucax@gmail.com>. Signed-off-by: Alberto Bertogli <albertito@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-22Generate tags with correct timestamp (git-svnimport)Libravatar Dave O'Neill1-23/+3
Now uses git-tag instead of manually constructing the tag. This gives us a correct timestamp, removes some crufty code, and makes it work the same as git-cvsimport. The generated tags are now lightweight tags instead of tag objects, which may or may not be the behaviour we want. Also, remove two unused variables from git-cvsimport. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07War on whitespaceLibravatar Junio C Hamano1-2/+2
This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-01-12use 'init' instead of 'init-db' for shipped docs and toolsLibravatar Nicolas Pitre1-1/+1
While 'init-db' still is and probably will always remain a valid git command for obvious backward compatibility reasons, it would be a good idea to move shipped tools and docs to using 'init' instead. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07git-svnimport: fix edge revisions double importingLibravatar Sasha Khapyorsky1-2/+2
This fixes newly introduced bug when the incremental cycle edge revisions are imported twice. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git-svnimport: clean svn path when accessing SVN repoLibravatar Sasha Khapyorsky1-0/+4
Clean svn path from leading '/' when accessing SVN repo. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git-svnimport: support for incremental importLibravatar Sasha Khapyorsky1-7/+25
This adds ability to do import "in chunks" (default 1000 revisions), after each chunk git repo will be repacked. The option -R is used to change default value of chunk size (or how often repository will repacked). Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-31git-svnimport: support for partial importsLibravatar Sasha Khapyorsky1-4/+25
This adds support for partial svn imports. Let's assume that SVN repository layout looks like: $trunk/path/to/our/project $branches/path/to/our/project $tags/path/to/our/project , and we would like to import only tree under this specific 'path/to/our/project' and not whole tree under $trunk, $branches, etc.. Now we will be be able to do it by using '-P path/to/our/project' option with git-svnimport. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-18Merge branch 'sk/svn'Libravatar Junio C Hamano1-39/+54
* sk/svn: git-svnimport.perl: copying directory from original SVN place
2006-10-15svnimport: Fix broken tags being generatedLibravatar Petr Baudis1-1/+1
Currently git-svnimport generates broken tags missing the timespec in the 'tagger' line. This is a random stab at a minimal fix. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-08git-svnimport.perl: copying directory from original SVN placeLibravatar Sasha Khapyorsky1-39/+54
When copying whole directory, if source directory is not in already imported tree, try to get it from original SVN location. This happens when source directory is not matched by provided 'trunk' and/or 'tags/branches' templates or when it is not part of specified SVN sub-project. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28svnimport: add support for parsing From: lines for authorLibravatar Andy Whitcroft1-4/+8
When commiting a non-signed off contribution you cannot just add a Signed-off-by: from the author as they did not sign it off. But if you then commit it, and necessarily sign it off yourself, the change appears to be yours. In this case it is common to use the following form: Commentry From: originator <email> Signed-of-by: me <my email> Now that we have support for parsing Signed-off-by: for author information it makes sense to handle From: as well. This patch adds a new -F which will handle From: lines in the comments. It may be used in combination with -S. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-22git-svnimport: Parse log message for Signed-off-by: linesLibravatar Sasha Khapyorsky1-11/+20
This add '-S' option. When specified svn-import will try to parse commit message for 'Signed-off-by: ...' line, and if found will use the name and email address extracted at first occurrence as this commit author name and author email address. Committer name and email are extracted in usual way. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02Empty author may be presented by svn as an empty string or a null value.Libravatar Robin Rosenberg1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-31git-svnimport: Improved detection of merges.Libravatar Florian Forster1-2/+9
The regexes detecting merges (while still relying on the commit messages, though) have been improved to catch saner (and hopefully more) messages. The old regex was so generic that it often matched something else and missed the actual merge-message. Also, the regex given with the `-M' commandline-option is checked first: Explicitely given regexes should be considered better than the builtin ones, and should therefore be given a chance to match a message first. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-20Reintroduce svn pools to solve the memory leak.Libravatar Santi_Béjar1-1/+3
Introduced in 4802426. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-18git-svnimport symlink supportLibravatar Herbert Valerio Riedel1-2/+16
added svn:special symlink support for access methods other than direct-http Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org> Acked-by: Matthias Urlichs <smurf@smurf.noris.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-07git-svnimport: Don't assume that copied files haven't changedLibravatar Karl Hasselström1-5/+10
Don't assume that a file that SVN claims was copied from somewhere else is bit-for-bit identical with its parent, since SVN allows changes to copied files before they are committed. Without this fix, such copy-modify-commit operations causes the imported file to lack the "modify" part -- that is, we get subtle data corruption. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-26git-svnimport: if a limit is specified, respect itLibravatar Anand Kumria1-1/+1
git-svnimport will import the same revision over and over again if a limit (-l <rev>) has been specified. Instead if that revision has already been processed, exit with an up-to-date message. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27Save username -> Full Name <email@addr.es> map fileLibravatar Karl Hasselström1-5/+20
When the user specifies a username -> Full Name <email@addr.es> map file with the -A option, save a copy of that file as $git_dir/svn-authors. When running git-svnimport with an existing GIT directory, use $git_dir/svn-authors (if it exists) unless a file was explicitly specified with -A. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27Let git-svnimport's author file use same syntax as git-cvsimport'sLibravatar Karl Hasselström1-1/+1
git-cvsimport uses a username => Full Name <email@addr.es> mapping file with this syntax: kha=Karl Hasselström <kha@treskal.com> Since there is no reason to use another format for git-svnimport, use the same format. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26svnimport: Read author names and emails from a fileLibravatar Karl Hasselström1-3/+20
Read a file with lines on the form username User's Full Name <email@addres.org> and use "User's Full Name <email@addres.org>" as the GIT author and committer for Subversion commits made by "username". If encountering a commit made by a user not in the list, abort. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26svnimport: Convert the svn:ignore propertyLibravatar Karl Hasselström1-3/+57
Put the value of the svn:ignore property in a regular file when converting a Subversion repository to GIT. The Subversion and GIT ignore syntaxes are similar enough that it often just works to set the filename to .gitignore and do nothing else. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26svnimport: Convert executable flagLibravatar Karl Hasselström1-7/+13
Convert the svn:executable property to file mode 755 when converting an SVN repository to GIT. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-20svnimport: avoid open "-|" list form for Perl 5.6Libravatar Junio C Hamano1-4/+16
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-14git-svnimport: -r adds svn revision number to commit messagesLibravatar Karl Hasselström1-3/+4
New -r flag for prepending the corresponding Subversion revision number to each commit message. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-11Use a relative path for SVN importingLibravatar Christian Biesinger1-1/+1
The absolute path (with the leading slash) breaks SVN importing, because it then looks for /trunk/... instead of /svn/trunk/... (in my case, the repository URL was https://servername/svn/) Signed-off-by: Christian Biesinger <cbiesinger@web.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-01git-svnimport.perl: fix for 'arg list too long...'Libravatar Sasha Khapyorsky1-9/+16
This fixes 'arg list too long..' problem with git-ls-files. Note that second arg list separation loop (with 'git-update-index') is needed since git-ls-files arguments can be directories. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05svnimport: support repositories requiring SSL authenticationLibravatar Eric Wong1-2/+4
I looked at svn-mirror to see how it did this, seems about right. "It works for me" when using it against https://svn.musicpd.org tested command-line: git-svnimport -C mpc -i -m -v \ -T mpc/trunk -b mpc/branches -t mpc/tags https://svn.musicpd.org Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14svnimport: exit cleanly when we are up to dateLibravatar Martin Langhoff1-0/+7
Now we detect that the SVN repo does not have new commits for us and exit cleanly, removing the lockfile. With this, svnimport supports being run on a cronjob to maintain a SVN2GIT gateway. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29SVN import: Use one log callLibravatar Matthias Urlichs1-21/+16
One "svn log" (or its equivalent) per revision adds delay and server load. Instead, open two SVN connections -- one for the log, and one for the files. Positive side effect: Only those log entries which actually contain data are committed => no more empty commits. Also, change the "-l" option to set the maximum revision to be pulled, not the number of revisions. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16symref support for import scriptsLibravatar Pavel Roskin1-3/+6
Fix git import script not to assume that .git/HEAD is a symlink. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14Remove trailing slashesLibravatar Matthias Urlichs1-1/+6
SVN dies a messy death when passed a path with trailing slashes.
2005-11-08Fix a couple of obvious and insignificant typo.Libravatar Junio C Hamano1-2/+2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Lift the default limit of number of revs.Libravatar Yaacov Akiba Slama1-6/+6
Now that the leak is gone, there is by default no limit of revisions to import. No more message about leak when the limit (given by the -l parameter) is reached. Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Handle a revision that only creates a new tag correctly.Libravatar Yaacov Akiba Slama1-0/+5
Fix an error when a svn revision consists only of the creation of a new tag directory (/tags/this_is_a_tag). Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Bundle file copies from multiple branches into a merge.Libravatar Yaacov Akiba Slama1-6/+16
When copying files and/or directories from several branches in one single revision, all these branches are used as parents of the commit. Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08copy_dir becomes copy_path and handles both files and directoriesLibravatar Yaacov Akiba Slama1-37/+53
The A (Add) and R (Replace) actions handling are unified. Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Don't output error on changes in the nodes /, /tags or /branchesLibravatar Yaacov Akiba Slama1-1/+6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Add node_kind function to differentiate between file and directoryLibravatar Yaacov Akiba Slama1-3/+18
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08Use svn pools to solve the memory leak problem.Libravatar Yaacov Akiba Slama1-2/+6
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-30Work around an RPM build problem.Libravatar Junio C Hamano1-1/+1
The require statement at the top of git-svnimport seems to confuse rpmbuild dependency generation. It uses the newer notation "v5.8.0", and rpm ends up requiring "perl(v5.8.0)", while we would want it to say something like "perl >= 0:5.008". Ryan suggests old-style "require 5.008" might fix this problem, so here it is. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16Merge branch 'svn' of http://netz.smurf.noris.de/git/gitLibravatar Junio C Hamano1-0/+717
[jc: I have my pre-commit hook enabled to catch trailing whitespaces, and fixed them up while merging.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-16svn commit: re-word the exit-due-to-memory-leak messageLibravatar Matthias Urlichs1-1/+2
Reworded the exit message, as per Kalle Valo's suggestion (but shorter). Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
2005-10-11svn import: copy directoriesLibravatar Matthias Urlichs1-13/+56
Import SVN-copied and -referenced directories correctly. Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
2005-10-11svn import: Add direct HTTP accessLibravatar Matthias Urlichs1-17/+54
Some SVN repositories that are accessible through HTTP don't like when I retrieve files using SVN methods ("internal server error"). Therefore, I added an option to get the contents using (persistent) HTTP directly. This also reduces round-trip time, from two or three requests down to one. Also corrected error handling a bit. Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
2005-10-11svn import: remove some CVS cruftLibravatar Matthias Urlichs1-35/+4
Some remains of CVS still lingered. Removed. Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>