summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* git-svn: stop using path names as refnames with --follow-parentEric Wong2007-02-232-4/+8
| | | | | | | | | | | | | | | | Using path names as refnames breaks horribly if a user is tracking one large, toplevel directory, and a lower-level directory is followed from another project is a parent of another ref, as it will cause refnames such as: 'refs/remotes/trunk/path/to/stuff', which will conflict with a refname of 'refs/remotes/trunk'. Now we just append @$revno to the end of it the current refname. And if we have followed back to a grandparent, then we'll strip any existing '@$parent_revno' strings before appending our own '@$revno' string to it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: correctly handle do_{switch,update} in deep directoriesEric Wong2007-02-232-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The do_update or do_switch functions in SVN only allow for a single path component; so 'path/to/deep/dir' would be interpreted as 'path'. SVN 1.4.x has a reparent function that can let us change the session to use a higher-level root of the repository, so we can use that for do_switch (which still doesn't seem to work in SVN 1.4.3 (a fix was attempted, but they missed the rest of the typemap changes needed in trunk...)). On the do_update side, we can use set_path on higher level directories and set them to a newer revision so they don't get updated. We can't do this with do_switch, either, because the relative path we're tracking can change (directory moving into a child of itself). Because of these changes, we need to double check that our Fetch editor is correctly performing stripping on any prefixed paths from update, otherwise we'll just die() because that would be a bug. Added a test case which helped me notice and fix problems with do_switch, too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: correctly track diff-less copies with do_switchEric Wong2007-02-231-1/+3
| | | | | | | Also, this should allow for the tracking of new, but empty directories where we would want to see the log message. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: allow multi-fetch to fetch things chronologicallyEric Wong2007-02-231-91/+120
| | | | | | | | | Since single fetching is a special case of multi-fetch, share code with it and the fetch loop into Git::SVN::Ra since it uses a single Ra connection and multiple Git::SVN objects. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: cleanup remove unused functionEric Wong2007-02-231-25/+8
| | | | | | | Also move tz_to_s_offset into Git::SVN::Log since that's the only place it's used now. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: simplify usage of the SVN::Git::Editor interfaceEric Wong2007-02-231-142/+139
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: avoid an extra svn_ra connection during commitsEric Wong2007-02-231-82/+123
| | | | | | | | | Before, we needed a separate svn_ra instance to run our check_path calls once the editor was active; but we can avoid that by running all the check_path calls before our editor is active. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix committing to subdirectories, add testsEric Wong2007-02-233-4/+48
| | | | | | | | | I broke this part with the URL minimization; since git-svn will now try to connect to the root of the repository and will end up writing files there if it can... Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix segfaults from accessing svn_log_changed_path_tEric Wong2007-02-232-37/+68
| | | | | | | | | | | | | | svn_log_changed_path_t structs were being used out of scope outside of svn_ra_get_log (because I wanted to eventually be able to use git-svn with only a single connection to the repository). So now we dup them into a hash. This was fixed while making --follow-parent fetches more efficient. I've moved parsing of the command-line --revision argument outside of the Git::SVN module so Git::SVN::fetch() can be used in more places (such as find_parent_branch). Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: correctly track revisions made to deleted branchesEric Wong2007-02-232-23/+34
| | | | | | | | | | | | | | | | | | | | | git-svn has never been able to handle deleted branches very well because svn_ra_get_log() is all-or-nothing, meaning that if the max revision passed to it does not contain the path we're tracking, we miss all the revisions in the repository. Branches fetched using --follow-parent still do this sub-optimally (will be fixed soon). --follow-parent will soon become the default, so we will assume that when using get_log(); We will also avoid tracking revprops for revisions with no path-related changes since otherwise we just end up pulling logs to paths we don't care about. Also added a test for this to t9104-git-svn-follow-parent.sh and correctly commit the log message in the preceeding test (which conflicted with a filename). Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: avoid tracking change-less revisionsEric Wong2007-02-233-35/+42
| | | | | | | | | | They simply aren't interesting to track, and this will allow us to avoid get_log(). Since r0 is covered by this, we need to update the tests to not rely on r0 (which is always empty). Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add an odd test case that seems to cause segfaults over HTTPEric Wong2007-02-231-0/+15
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: track writes writes to the index in fetchEric Wong2007-02-231-9/+41
| | | | | | | | | | | | | | Introducing Git::IndexInfo. This module will probably be useful outside of git-svn, so I'm not putting it in the Git::SVN namespace. This will allow me to more easily avoid the use of get_log() in the future and simply run do_update in incrementing ranges. get_log() should be avoided because there are cases where moved/deleted directories do not track correctly (until --follow-parent is run on a new branch). Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: --follow-parent now works on sub-directories of larger branchesEric Wong2007-02-232-8/+40
| | | | | | | | | | | | | | | | | | | | | | This means that tracking the path of: /another-larger/trunk/thunk/bump/thud inside a repository would follow: /larger-parent/trunk/thunk/bump/thud even if the svn log output looks like this: -------------------------------------------- Changed paths: A /another-larger (from /larger-parent:5) -------------------------------------------- Note: the usage of get_log() in git-svn still makes a an assumption that shouldn't be made with regard to revisions existing for a particular path. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: 'init' attempts to connect to the repository root if possibleEric Wong2007-02-232-21/+89
| | | | | | | This allows connections to be used more efficiently and not require users to run 'git-svn migrate --minimize' for new repositories. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: better error reporting if --follow-parent failsEric Wong2007-02-231-3/+14
| | | | | | | This will be useful to me when I try more special-cases of parent-tracking. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: allow 'init' to work outside of testsEric Wong2007-02-231-0/+1
| | | | | | | | | Tests always ran 'git init' before we ran so that repo-config would always have something to read. However that does not work in real-world situations where the user expects 'git svn init' to work without running 'git init' first. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: get rid of additional fetch-argumentsEric Wong2007-02-232-25/+6
| | | | | | | | It's not really useful anymore now that we have a better --follow-parent for the valid cases. Any other use of it is not valid. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: allow --follow-parent on deleted directoriesEric Wong2007-02-232-1/+13
| | | | | | | Any operations on the index in Git::SVN that is not wrapped by tmp_index_do() is wrong. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: disallow ambigious local refspecsEric Wong2007-02-232-7/+44
| | | | | | | | Having multiple fetch refspecs pointing to the same local ref would be a very bad thing. Start avoiding the use of fatal() or exit() inside the modules so we can libify more easily. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: --follow-parent works with svn-remotes multiple branchesEric Wong2007-02-232-17/+45
| | | | | | | | | | | | | | | Bugs fixed: * We didn't allow manually (not using git-svn) init-ed remotes/fetch refspecs to be used before. It works now because that's what I did in this test. git-svn init should offer more control in the future. * correctly strip paths in the delta editor when using do_switch(). * Make the -i / GIT_SVN_ID option work correctly when doing fetch on a multi-ref svn-remote Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: fix --follow-parent to work with Git::SVNEric Wong2007-02-232-92/+110
| | | | | | | While we're at it, beef up the test because I was getting false-passes during development. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: enable --minimize to simplify the config and connectionsEric Wong2007-02-232-6/+129
| | | | | | | | | --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-232-279/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-232-593/+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: add a test for show-ignoreEric Wong2007-02-231-0/+26
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: make multi-init capable of reusing the Ra connectionEric Wong2007-02-232-27/+29
| | | | | | | | | | | 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>
*-. Merge branches 'lt/crlf' and 'jc/apply-config'Junio C Hamano2007-02-2211-27/+767
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lt/crlf: Teach core.autocrlf to 'git apply' t0020: add test for auto-crlf Make AutoCRLF ternary variable. Lazy man's auto-CRLF * jc/apply-config: t4119: test autocomputing -p<n> for traditional diff input. git-apply: guess correct -p<n> value for non-git patches. git-apply: notice "diff --git" patch again Fix botched "leak fix" t4119: add test for traditional patch and different p_value apply: fix memory leak in prefix_one() git-apply: require -p<n> when working in a subdirectory. git-apply: do not lose cwd when run from a subdirectory. Teach 'git apply' to look at $HOME/.gitconfig even outside of a repository Teach 'git apply' to look at $GIT_DIR/config
| | * t4119: test autocomputing -p<n> for traditional diff input.Junio C Hamano2007-02-211-74/+43
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * git-apply: guess correct -p<n> value for non-git patches.Junio C Hamano2007-02-212-4/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enhances the third point in the previous commit. When applying a non-git patch that begins like this: --- 2.6.orig/mm/slab.c +++ 2.6/mm/slab.c @@ -N,M +L,K @@@ ... and if you are in 'mm' subdirectory, we notice that -p2 is the right option to use to apply the patch in file slab.c in the current directory (i.e. mm/slab.c) The guess function also knows about this pattern, where you would need to use -p0 if applying from the top-level: --- mm/slab.c +++ mm/slab.c @@ -N,M +L,K @@@ ... Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * git-apply: notice "diff --git" patch againJunio C Hamano2007-02-212-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier one that tried to be too consistent with GNU patch by not stripping the leading path when we _know_ we are in a subdirectory and the patch is relative to the toplevel was a mistake. This fixes it. - No change to behaviour when it is run from the toplevel of the repository. - When run from a subdirectory to apply a git-generated patch, it uses the right -p<n> value automatically, with or without --index nor --cached option. - When run from a subdirectory to apply a randomly generated patch, it wants the right -p<n> value to be given by the user. The second one is a pure improvement to correct inconsistency between --index and non --index case, compared with 1.5.0. The third point could be further improved to guess what the right value for -p<n> should be by looking at the patch, but should be a topic of a separate patch. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * Fix botched "leak fix"Junio C Hamano2007-02-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | When (new_name == old_name), the previous one prefixed old_name alone, leaving new_name untouched, and worse yet, left it dangling pointing at an already freed memory location. Signed-off-by: Junio C Hamano <junkio@cox.net>