summaryrefslogtreecommitdiff
path: root/git-svn.perl
Commit message (Collapse)AuthorAgeFilesLines
* git-svn: enable --minimize to simplify the config and connectionsEric Wong2007-02-231-6/+104
| | | | | | | | | --minimize will update the git-svn configuration to attempt to connect to the repository root (instead of directly to the path(s) we are tracking) in order to allow more efficient reuse of connections (for multi-fetch and follow-parent). Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: reuse open SVN::Ra connections by URLEric Wong2007-02-231-4/+6
| | | | | | | | Note: this can cause problems with Perl's reference counting GC, so I'm disabling Git::SVN::Ra::DESTROY. If we notice more problems down the line, we can disable this enhancement. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix a regression in dcommit that caused empty log messagesEric Wong2007-02-231-1/+2
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add support for metadata in .git/configEric Wong2007-02-231-279/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Of course, we handle metadata migrations from previous versions and we have added unit tests. The new .git/config remotes resemble non-SVN remotes. Below is an example with comments: [svn-remote "git-svn"] ; like non-svn remotes, we have one URL per-remote url = http://foo.bar.org/svn ; 'fetch' keys are done in the same way as non-svn ; remotes, too. With the left-hand-side of the ':' ; being the remote (SVN) repository path relative to the ; above 'url' key; and the right-hand-side being a ; remote ref in git (refs/remotes/*). ; An empty left-hand-side means that it will fetch ; the entire contents of the 'url' key. ; old-style (migrated from previous versions of git-svn) ; are like this: fetch = :refs/remotes/git-svn ; this is created by a current version of git-svn ; using the multi-init command with an explicit ; url (specified above). This allows multi-init ; to reuse SVN::Ra connections. fetch = trunk:refs/remotes/trunk fetch = branches/a:refs/remotes/a fetch = branches/b:refs/remotes/b fetch = tags/0.1:refs/remotes/tags/0.1 fetch = tags/0.2:refs/remotes/tags/0.2 fetch = tags/0.3:refs/remotes/tags/0.3 [svn-remote "alt"] ; this is another old-style remote migrated over ; to the new config format url = http://foo.bar.org/alt fetch = :refs/remotes/alt Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: remove graft-branches commandEric Wong2007-02-231-526/+3
| | | | | | | | It's becoming a maintenance burden. I've never found it particularly useful myself, nor have I heard much feedback about it; so I'm assuming it's just as useless to everyone else. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: convert 'set-tree' command to use Git::SVNEric Wong2007-02-231-495/+17
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: switch dcommit to using Git::SVN codeEric Wong2007-02-231-84/+38
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fetch/multi-fetch converted over to Git::SVN moduleEric Wong2007-02-231-38/+51
| | | | | | | --follow-parent and commit-diff are currently broken with this commit... Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: get rid of Memoize for now...Eric Wong2007-02-231-4/+0
| | | | I may refactor more of this stuff into separate modules
* git-svn: convert the 'commit-diff' command to Git::SVNEric Wong2007-02-231-133/+233
| | | | | | | | | | Also, convert all usage of 'log_msg' to 'log_entry' for consistency's sake SVN::Git::Editor::apply_diff now drives the rest of the editor. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: do not let Git.pm warn if we prematurely close pipesEric Wong2007-02-231-1/+1
| | | | | | This mainly quiets down warnings when running git svn log. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: port the 'rebuild' command to use Git::SVN objectsEric Wong2007-02-231-43/+28
| | | | | | Also correctly shared some variables needed for Git::SVN::Log Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: moved the 'log' command into its own namespaceEric Wong2007-02-231-327/+325
| | | | | | | | | | | | More cleanup to separate out functionality and make things nicer to hack on. While we're at it, centralize loading of the authors into one place and correctly handle '(no author)' cases in when showing logs after-the-fact; and not just at commit time. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: convert show-ignore over to Git::SVNEric Wong2007-02-231-7/+5
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: make multi-init capable of reusing the Ra connectionEric Wong2007-02-231-27/+23
| | | | | | | | | | | If a user specified a seperate URL and --tags/--branches as a sepearte URL, allow the Ra object (and therefore the connection) to be reused. We'll get rid of libsvn_ls_fullurl() since it was only used in one place. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: convert multi-init over to using Git::SVNEric Wong2007-02-231-41/+31
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: convert 'init' to use Git::SVNEric Wong2007-02-231-20/+18
| | | | | | While we're at it, fix up some bugs in Git::SVN. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add Git::SVN module (to avoid global variables)Eric Wong2007-02-231-0/+485
| | | | | | | This should make it easier to improve multi-fetch and --follow-parent by avoiding global variables. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: cleanup: avoid re-use()ing Git.pm in sub-packagesEric Wong2007-02-231-13/+15
| | | | | | | | | | | I will be using functions from Git.pm in more modules, so I want to avoid re-importing the long argument list everywhere it's used. Also removed an unused command-line switch (--no-ignore-externals) and some variables. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: cleanup: put SVN workarounds into their own namespaceEric Wong2007-02-231-149/+173
| | | | | | | | | | | | | | Force some svn_ra functions to use a temporary pool via wrapper This cleans up the code a bit by removing explicit instances of pool allocation and deallocation and providing wrapper functions that make use of temporary pools. I've also added an explicit pool usage when creating the commit editor for commit-diff where get_commit_editor can be called multiple times with the same pool previously. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: cleanup: move process_rm aroundEric Wong2007-02-231-25/+19
| | | | | | (it's only used in one function now) Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: move authentication prompts into their own namespaceEric Wong2007-02-231-16/+24
| | | | | | I'm going to be reorganizing some more code. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: correctly handle boolean options via git-configEric Wong2007-02-101-1/+1
| | | | | | | | | | We don't append a space after '--bool', so we can't expect a regular expression to match the space. Semi-noticed by Junio C Hamano :) Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: do not let Git.pm warn if we prematurely close pipesEric Wong2007-02-011-5/+5
| | | | | | | This mainly quiets down warnings when running git svn log. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Rename git-repo-config to git-config.Tom Prince2007-01-281-10/+10
| | | | | Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: remove leading slash when printing removed directoriesEric Wong2007-01-221-1/+1
| | | | | | | | | | Not sure why it was there in the first place, we always do our work relative to the URL we're connected to; even if that URL is the root of the repository, so the leading slash is pointless... Lets be consistent when printing things for the user to see. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: print and flush authentication prompts to STDERREric Wong2007-01-151-15/+22
| | | | | | | | | | | | | | People that redirect STDOUT output should always see STDERR prompts interactively. STDERR should always be flushed without buffering, so they should always show up. If that is unset, we still explicitly flush by calling STDERR->flush. The svn command-line client prompts to STDERR, too. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* use 'init' instead of 'init-db' for shipped docs and toolsNicolas Pitre2007-01-121-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>
* git-svn: pass an unambiguous ref to rev-list when grafting-branchesEric Wong2007-01-071-1/+1
| | | | | | | | Some users apparently create local heads with the same basename as the remote branch they're tracking. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: add --prefix= option to multi-initEric Wong2007-01-071-3/+5
| | | | | | | | Also, document --{trunk,branches,tags} options while we're documenting multi-init options. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: fix show-ignoreEric Wong2007-01-061-1/+1
| | | | | | | | Looks like I broke it in 747fa12cef73b6ca04fffaddaad7326cf546cdea but never noticed. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: make --repack work consistently between fetch and multi-fetchEric Wong2007-01-041-4/+6
| | | | | | | | | | | | | | | Since fetch reforks itself at most every 1000 revisions, we need to update the counter in the parent process to have a working count if we set our repack interval to be > ~1000 revisions. multi-fetch has always done this correctly because of an extra process; now fetch uses the extra process; as well. While we're at it, only compile the $sha1 regex that checks for repacking once. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: make multi-init less confusingEric Wong2007-01-041-38/+40
| | | | | | | | | | | | It now requires at least one of the (trunk|branch|tags) arguments (either from the command-line or in .git/config). Also we make sure that anything that is passed as a URL ('help') in David's case is actually a URL. Thanks to David Kågedal for reporting this issue. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: sort multi-init outputEric Wong2006-12-281-1/+1
| | | | | | | This looks a bit more pleasant for users. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: verify_ref() should actually --verifyEric Wong2006-12-281-1/+2
| | | | | | | Not sure how I missed this the first time around... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: print out the SVN library version in --version, tooEric Wong2006-12-281-1/+1
| | | | | | | | This could be useful in finding new problems and helping users debug. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: remove non-delta fetch code pathsEric Wong2006-12-281-174/+20
| | | | | | | | | | | | | | | | | | | | We have less code to worry about now. As a bonus, --revision can be used to reliably skip parts of history whenever fetch is run, not just the first time. I'm not sure why anybody would want to skip history in the middle, however... For people (nearly everyone at the moment) without the do_switch() function in their Perl SVN library, the entire tree must be refetched if --follow-parent is used and a parent is found. Future versions of SVN will have a working do_switch() function accessible via Perl. Accessing repositories on the local machine (especially file:// ones) is also slightly slower as a result; but I suspect most git-svn users will be using it to access remote repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: dcommit should diff against the current HEAD after committingEric Wong2006-12-261-3/+3
| | | | | | | | | | This is a followup to dd31da2fdc199132c9fd42023aea5b33672d73cc. Regardless of whether we commit an alternate head, we always diff-tree based on the current HEAD, and rebase against our remote reference as necessary. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: enable common fetch/commit options for dcommitEric Wong2006-12-221-1/+1
| | | | | | | | | | dcommit does commits and fetches, so all options used for those should work, too, including --authors-file. Reported missing by Nicolas Vilz. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: rename 'commit' command to 'set-tree'Eric Wong2006-12-161-6/+6
| | | | | | | | | | | 'set-tree' probably accurately describes what the command formerly known as 'commit' does. I'm not entirely sure that 'dcommit' should be renamed to 'commit' just yet... Perhaps 'push' or 'push-changes'? Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: remove support for the svn command-line clientEric Wong2006-12-161-844/+39
| | | | | | | | | | | | | | Using the command-line client was great for prototyping and getting something working quickly. Eventually I found time to study the library documentation and add support for using the libraries which are much faster and more flexible when it comes to supporting new features. Note that we require version 1.1 of the SVN libraries, whereas we supported the command-line svn client down to version 1.0. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: convert to using Git.pmEric Wong2006-12-151-193/+135
| | | | | | | | | | | | | | Thanks to Git.pm, I've been able to greatly reduce the amount of extra work that needs to be done to manage input/output pipes in Perl. chomp usage has also been greatly reduced, too. All tests (including full-svn-test) still pass, but this has not been tested extensively in the real-world. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: allow both diff.color and color.diffJunio C Hamano2006-12-131-6/+25
| | | | | | | | | | | The list concensus is to group color related configuration under "color.*" so let's be consistent. Inspired by Andy Parkins's patch to do the same for diff/log family. With fixes from Eric Wong. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: correctly handle "(no author)" when using an authors fileEric Wong2006-12-131-1/+2
| | | | | | | | | The low-level parts of the SVN library return NULL/undef for author-less revisions, whereas "(no author)" is a (svn) client convention. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: correctly handle packed-refs in refs/remotes/Eric Wong2006-12-121-1/+9
| | | | | | | | We now use git-rev-parse universally to read refs, instead of our own file_to_s function (which I plan on removing). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: correctly display fatal() error messagesEric Wong2006-12-121-1/+1
| | | | | | | | If I wanted to print $@, I'd pass $@ to fatal(). This looks like a stupid typo on my part. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: allow dcommit to take an alternate headEric Wong2006-12-121-5/+6
| | | | | | | | | | Previously dcommit would unconditionally commit all patches up-to and including the current HEAD. Now if an optional command-line argument is specified, it will only commit up to the specified revision. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: enable logging of information not supported by gitEric Wong2006-12-121-18/+184
| | | | | | | | | | | | | | | | | | | | | | | | | The changes are now tracked in $GIT_DIR/svn/$GIT_SVN_ID/untracked.log Information in the untracked.log include: * the addition and removal of empty directories (changes of these will also warn the user) * file and directory property changes, including (but not limited to) svk:merge and svn:externals * revision properties (revprops) are also tracked * users will be warned of 'absent' file and directories (if users are forbidden access) Fields in entries are separated by spaces; "unsafe" characters are URI-encoded so that each entry takes exactly one line. There is currently no automated parser for dealing with the data in untracked.log, but it should be possible to write one to create empty directories on checkout and manage externals/subprojects. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: use do_switch for --follow-parent if the SVN library supports itEric Wong2006-12-081-7/+39
| | | | | | | | | | do_switch works with the SVN Perl bindings after r22312 in the Subversion trunk. Since no released version of SVN currently supports it; we'll just autodetect it and enable its usage when a user has a recent-enough version of SVN. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: extra error check to ensure we open a file correctlyEric Wong2006-12-081-0/+3
| | | | | | | | | This may be an issue with repositories imported with commit 27a1a8014b842c0d70fdc91c68dd361ca2dfb34c or later, but before commit dad73c0bb9f33323ec1aacf560a6263f1d85f81a. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>