summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2006-06-16git-svn: rebuild convenience and bugfixesLibravatar Eric Wong1-2/+19
We will now automatically fetch the refs/remotes/git-svn ref from origin and store a Pull: line for it. --remote=<origin> may be passed if your remote is named something other than 'origin' Also, remember to make GIT_SVN_DIR whenever we need to create .rev_db Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: svn (command-line) 1.0.x compatibilityLibravatar Eric Wong2-43/+51
Tested on a plain Ubuntu Warty installation using subversion 1.0.6-1.2ubuntu3 svn add --force was never needed, as it only affected directories, which git (thankfully) doesn't track The 1.0.x also didn't support symlinks(!), so allow NO_SYMLINK to be defined for running tests Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: tests no longer fail if LC_ALL is not a UTF-8 localeLibravatar Eric Wong2-4/+9
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: bugfix and optimize the 'log' commandLibravatar Eric Wong1-8/+52
Revisions with long commit messages were being skipped, since the 'git-svn-id' metadata line was at the end and git-log uses a 32k buffer to print the commits. Also the last 'git-svn-id' metadata line in a commit is always the valid one, so make sure we use that, as well. Made the verbose flag work by passing the correct option switch ('--summary') to git-log. Finally, optimize -r/--revision argument handling by passing the appropriate limits to revision Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: Eliminate temp file usage in libsvn_get_file()Libravatar Eric Wong1-33/+23
This means we'll have a loose object when we encounter a symlink but that's not the common case. We also don't have to worry about svn:eol-style when using the SVN libraries, either. So remove the code to deal with that. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: fix several small bugs, enable branch optimizationLibravatar Eric Wong1-65/+81
Share the repack counter between branches when doing multi-fetch. Pass the -d flag to git repack by default. That's the main reason we will want automatic pack generation, to save space and improve disk cache performance. I won't add -a by default since it can generate extremely large packs that make RAM-starved systems unhappy. We no longer generate the .git/svn/$GIT_SVN_ID/info/uuid file, either. It was never read in the first place. Check for and create .rev_db if we need to during fetch (in case somebody manually blew away their .rev_db and wanted to start over. Mainly makes debugging easier). Croak with $? instead of $! if there's an error closing pipes Quiet down some of the chatter, too. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: avoid creating some small filesLibravatar Eric Wong1-18/+8
repo_path_split() is already pretty fast, and is already optimized via caching. We also don't need to create an exclude file if we're relying on the SVN libraries. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: make the $GIT_DIR/svn/*/revs directory obsoleteLibravatar Eric Wong4-132/+224
This is a very intrusive change, so I've beefed up the tests significantly. Added 'full-test' a target to the Makefile, to test different possible configurations. This is intended for maintainers only. Users should only be concerned with 'test' succeeding. We now have a very simple custom database format for handling mapping of svn revisions => git commits. Of course, we're not really using it yet, either. Also disabled automatic branch-finding on new trees for now. It's too easily broken. revisions_eq() function should be helpful for branch detection. Also removed an extra assertion in fetch_cmd() that wasn't correctly done. This bug was found by full-test. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add support for Perl SVN::* librariesLibravatar Eric Wong3-111/+974
This means we no longer have to deal with having bloated SVN working copies around and we get a nice performance increase as well because we don't have to exec the SVN binary and start a new server connection each time. Of course we have to manually manage memory with SVN::Pool whenever we can, and hack around cases where SVN just eats memory despite pools (I blame Perl, too). I would like to keep memory usage as stable as possible during long fetch/commit processes since I still use computers with only 256-512M RAM. commit should always be faster with the SVN library code. The SVN::Delta interface is leaky (or I'm not using it with pools correctly), so I'm forking on every commit, but that doesn't seem to hurt performance too much (at least on normal Unix/Linux systems where fork() is pretty cheap). fetch should be faster in most common cases, but probably not all. fetches will be faster where client/server delta generation is the bottleneck and not bandwidth. Of course, full-files are generated server-side via deltas, too. Full files are always transferred when they're updated, just like git-svnimport and unlike command-line svn. I'm also hacking around memory leaks (see comments) here by using some more forks. I've tested fetch with http://, https://, file://, and svn:// repositories, so we should be reasonably covered in terms of error handling for fetching. Of course, we'll keep plain command-line svn compatibility as a fallback for people running SVN 1.1 (I'm looking into library support for 1.1.x SVN, too). If you want to force command-line SVN usage, set GIT_SVN_NO_LIB=1 in your environment. We also require two simultaneous connections (just like git-svnimport), but this shouldn't be a problem for most servers. Less important commands: show-ignore is slower because it requires repository access, but -r/--revision <num> can be specified. graft-branches may use more memory, but it's a short-term process and is funky-filename-safe. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add 'log' command, a facsimile of basic `svn log'Libravatar Eric Wong1-17/+243
This quick feature should make it easy to look up svn log messages when svn users refer to -r/--revision numbers. The following features from `svn log' are supported: --revision=<n>[:<n>] - is supported, non-numeric args are not: HEAD, NEXT, BASE, PREV, etc ... -v/--verbose - just maps to --raw (in git log), so it's completely incompatible with the --verbose output in svn log --limit=<n> - is NOT the same as --max-count, doesn't count merged/excluded commits --incremental - supported (trivial :P) New features: --show-commit - shows the git commit sha1, as well --oneline - our version of --pretty=oneline Any other arguments are passed directly to `git log' Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add UTF-8 message testLibravatar Eric Wong1-0/+13
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add some functionality to better support branches in svnLibravatar Eric Wong1-5/+424
New commands: graft-branches - The most interesting command of the bunch. It detects branches in SVN via various techniques (currently regexes and file copies). It can be later extended to handle svk and other properties people may use to track merges in svk. Basically, merge tracking is not standardized at all in the SVN world, and git grafts are perfect for dealing with this situation. Existing branch support (via tree matches) is only handled at fetch time. The following tow were originally implemented as shell scripts several months ago, but I just decided to streamline things a bit and added them to the main script. multi-init - supports git-svnimport-like command-line syntax for importing repositories that are layed out as recommended by the SVN folks. This is a bit more tolerant than the git-svnimport command-line syntax and doesn't require the user to figure out where the repository URL ends and where the repository path begins. multi-fetch - runs fetch on all known SVN branches we're tracking. This will NOT discover new branches (unlike git-svnimport), so multi-init will need to be re-run (it's idempotent). Consider these three to be auxilliary commands (like show-ignore, and rebuild) so their behavior won't receive as much testing or scrutiny as the core commands (fetch and commit). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add --shared and --template= options to pass to init-dbLibravatar Eric Wong1-2/+8
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: add --repack and --repack-flags= optionsLibravatar Eric Wong1-1/+17
This should help keep disk usage sane for large imports. --repack takes an optional argument for the interval, it defaults to 1000 if no argument is specified. Arguments to --repack-flags are passed directly to git-repack. No arguments are passed by default. Idea stolen from git-cvsimport :) Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: minor cleanups, extra error-checkingLibravatar Eric Wong1-36/+46
While we're at it, read_repo_config has been added and expanded to handle case where command-line arguments are optional to Getopt::Long Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: Move all git-svn-related paths into $GIT_DIR/svnLibravatar Eric Wong2-16/+85
Since GIT_SVN_ID usage is probably going to become more widespread <evil grin>, we won't run the chance of somebody having a GIT_SVN_ID name that conflicts with one of the default directories that already exist in $GIT_DIR (branches/tags). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: support manually placed initial trees from fetchLibravatar Eric Wong1-1/+8
Sometimes I don't feel like downloading an entire tree again when I actually decide a branch is worth tracking, so some users can get around it more easily with this. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: optimize --branch and --branch-all-refLibravatar Eric Wong1-2/+9
By breaking the pipe read once we've seen a commit twice. This should make -B/--branch-all-ref faster and usable on a frequent basis. We use topological order now for calling git-rev-list, and any commit we've seen before should imply that all parents have been seen (at least I hope that's the case for --topo-order). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: --branch-all-refs / -B supportLibravatar Eric Wong1-1/+14
This should make life easier for all those who type: `git-rev-parse --symbolic --all | xargs -n1 echo -b` every time they run git-svn fetch. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: support -C<num> passing to git-diff-treeLibravatar Eric Wong1-2/+9
The repo-config key is 'svn.copysimilarity' Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: don't allow commit if svn tree is not currentLibravatar Eric Wong1-2/+9
If new revisions are fetched, that implies we haven't merged, acked, or nacked them yet, and attempting to write the tree we're committing means we'd silently clobber the newly fetched changes. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: restore original LC_ALL setting (or unset) for commitLibravatar Eric Wong1-11/+23
svn forces UTF-8 for commit messages, and with LC_ALL set to 'C' it is unable to determine encoding of the git commit message. Now we'll just assume the user has set LC_* correctly for the commit message they're using. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: eol_cp corner-case fixesLibravatar Eric Wong1-4/+11
If we read the maximum size of our buffer into $buf, and the last character is '\015', there's a chance that the character is '\012', which means our regex won't work correctly. At the worst case, this could introduce an extra newline into the code. We'll now read an extra character if we see '\015' is the last character in $buf. We also forgot to recalculate the length of $buf after doing the newline substitution, causing some files to appeare truncated. We'll do that now and force byte semantics in length() for good measure. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: fix handling of filenames with embedded '@'Libravatar Eric Wong1-4/+13
svn has trouble parsing files with embedded '@' characters. For example, svn propget svn:keywords foo@bar.c svn: Syntax error parsing revision 'bar.c' I asked about this on #svn and the workaround suggested was to append an explicit revision specifier: svn propget svn:keywords foo@bar.c@BASE This patch appends '@BASE' to the filename in all calls to 'svn propget'. Patch originally by Seth Falcon <sethfalcon@gmail.com> Seth: signoff? [ew: Made to work with older svn that don't support peg revisions] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16git-svn: t0000: add -f flag to checkoutLibravatar Eric Wong1-5/+5
Some changes to the latest git.git made this test croak. So we'll always just force everything when using a new branch. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-04gitview: Add some useful keybindings.Libravatar Aneesh Kumar K.V2-0/+21
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-29git-svn: remove assertion that broke with older versions of svnLibravatar Eric Wong1-1/+0
svn < 1.3.x would display changes to keywords lines as modified if they aren't expanded in the working copy. We already check for changes against the git tree here, so checking against the svn one is probably excessive. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-29git-svn: t0001: workaround a heredoc bug in old versions of dashLibravatar Eric Wong1-1/+2
The dash installed on my Debian Sarge boxes don't seem to like <<'' as a heredoc starter. Recent versions of dash do not need this fix. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28gitview: Move the console error messages to message dialogLibravatar Aneesh Kumar K.V1-2/+7
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28gitview: Add key binding for F5.Libravatar Aneesh Kumar K.V2-6/+17
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23git-svn: ignore expansion of svn:keywordsLibravatar Eric Wong5-60/+254
Unlike my earlier test patch, this also checks svn:eol-style and makes sure it's applied to working copy updates. This is definitely more correct than my original attempt at killing keyword expansions, but I still haven't tested it enough to know. Feedback would be much appreciated. Also changed assert_svn_wc_clean() to only work on the svn working copy. This requires a separate call to assert_tree() to check wc integrity against git in preparation for another change I'm planning. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23git-svn: starting a 1.1.0-pre development versionLibravatar Eric Wong1-1/+1
Some not-very-well-tested changes coming... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19Merge branch 'js/fetchconfig'Libravatar Junio C Hamano1-0/+35
* js/fetchconfig: Add a conversion tool to migrate remote information into the config fetch, pull: ask config for remote information
2006-05-05git-svn 1.0.0Libravatar Eric Wong1-1/+1
Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05git-svn: documentation updatesLibravatar Eric Wong2-13/+38
* Clarify that 'init' requires an argument * Remove instances of 'SVN_URL' in the manpage, it's not an environment variable. * Refer to 'Additional Fetch Arguments' when documenting 'fetch' * document --authors-file / -A option Thanks to Pavel Roskin and Seth Falcon for bringing these issues to my attention. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04Add a conversion tool to migrate remote information into the configLibravatar Johannes Schindelin1-0/+35
Use this tool to rewrite the .git/remotes/* files into the config. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21Add colordiff for git to contrib/colordiff.Libravatar Junio C Hamano2-0/+198
I hacked it up to teach it the git extended diff headers, made it not to read the whole patch in the array. Also, the original program, when arguments are given, ran "diff" with the given arguments and showed the output from it. Of course, I changed it to run "git diff" ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04contrib/git-svn: handle array values correctlyLibravatar Eric Wong1-3/+2
Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04contrib/git-svn: make sure our git-svn is up-to-date for testLibravatar Eric Wong1-1/+1
Bugs like the last one could've been avoided if it weren't for this... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04contrib/git-svn: ensure repo-config returns a value before using itLibravatar Eric Wong1-3/+6
fetching from repos without an authors-file defined was broken. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01contrib/git-svn: documentation updatesLibravatar Eric Wong2-13/+31
contrib/git-svn/git-svn.txt: added git-repo-config key names for options fixed quoting of "git-svn-HEAD" in the manpage use preformatted text for examples contrib/git-svn/Makefile: add target to generate HTML: http://git-svn.yhbt.net/git-svn.html Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01contrib/git-svn: accept configuration via repo-configLibravatar Eric Wong1-0/+17
repo-config keys are any of the long option names minus the '-' characters Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-30contrib/git-svn: force GIT_DIR to an absolute pathLibravatar Eric Wong1-2/+5
We chdir internally, so we need a consistent GIT_DIR variable. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25contrib/git-svn: stabilize memory usage for big fetchesLibravatar Eric Wong1-46/+63
We should be safely able to import histories with thousands of revisions without hogging up lots of memory. With this, we lose the ability to autocorrect mistakes when people specify revisions in reverse, but it's probably no longer a problem since we only have one method of log parsing nowadays. I've added an extra check to ensure that revision numbers do increment. Also, increment the version number to 0.11.0. I really should just call it 1.0 soon... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-20contrib/git-svn: allow rebuild to work on non-linear remote headsLibravatar Eric Wong1-1/+13
Because committing back to an SVN repository from different machines can result in different lineages, two different repositories running git-svn can result in different commit SHA1s (but of the same tree). Sometimes trees that are tracked independently are merged together (usually via children), resulting in non-unique git-svn-id: lines in rev-list. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19git.el: Added a function to diff against the other heads in a merge.Libravatar Alexandre Julliard1-0/+11
git-diff-file-merge-head generates a diff against the first merge head, or with a prefix argument against the nth head. Bound to `d h' by default. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19git.el: Get the default user name and email from the repository config.Libravatar Alexandre Julliard1-2/+9
If user name or email are not set explicitly, get them from the user.name and user.email configuration values before falling back to the Emacs defaults. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19git.el: More robust handling of subprocess errors when returning strings.Libravatar Alexandre Julliard1-16/+13
Make sure that functions that call a git process and return a string always return nil when the subprocess failed. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09contrib/git-svn: fix a harmless warning on rebuild (with old repos)Libravatar Eric Wong1-1/+1
It's only for repositories that were imported with very early versions of git-svn. Unfortunately, some of those repos are out in the wild already, so fix this warning. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09contrib/git-svn: remove the --no-stop-on-copy flagLibravatar Eric Wong2-13/+11
Output a big warning if somebody actually has a pre-1.0 version of svn that doesn't support it. Thanks to Yann Dirson for reminding me it still existed and attempting to re-enable it :) I think I subconciously removed support for it earlier... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>