aboutsummaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAge
* git-svn: avoid creating some small filesEric Wong2006-06-16
| | | | | | | | | | 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>
* git-svn: make the $GIT_DIR/svn/*/revs directory obsoleteEric Wong2006-06-16
| | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: add support for Perl SVN::* librariesEric Wong2006-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: add 'log' command, a facsimile of basic `svn log'Eric Wong2006-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: add UTF-8 message testEric Wong2006-06-16
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add some functionality to better support branches in svnEric Wong2006-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: add --shared and --template= options to pass to init-dbEric Wong2006-06-16
| | | | Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: add --repack and --repack-flags= optionsEric Wong2006-06-16
| | | | | | | | | | | | | | 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>
* git-svn: minor cleanups, extra error-checkingEric Wong2006-06-16
| | | | | | | | 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>
* git-svn: Move all git-svn-related paths into $GIT_DIR/svnEric Wong2006-06-16
| | | | | | | | | 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>
* git-svn: support manually placed initial trees from fetchEric Wong2006-06-16
| | | | | | | | 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>
* git-svn: optimize --branch and --branch-all-refEric Wong2006-06-16
| | | | | | | | | | | | | 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>
* git-svn: --branch-all-refs / -B supportEric Wong2006-06-16
| | | | | | | | | | 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>
* git-svn: support -C<num> passing to git-diff-treeEric Wong2006-06-16
| | | | | | The repo-config key is 'svn.copysimilarity' Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git-svn: don't allow commit if svn tree is not currentEric Wong2006-06-16
| | | | | | | | | 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>
* git-svn: restore original LC_ALL setting (or unset) for commitEric Wong2006-06-16
| | | | | | | | | | 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>
* git-svn: eol_cp corner-case fixesEric Wong2006-06-16
| | | | | | | | | | | | | | | | 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>
* git-svn: fix handling of filenames with embedded '@'Eric Wong2006-06-16
| | | | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: t0000: add -f flag to checkoutEric Wong2006-06-16
| | | | | | | 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>
* gitview: Add some useful keybindings.Aneesh Kumar K.V2006-06-04
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: remove assertion that broke with older versions of svnEric Wong2006-05-29
| | | | | | | | | | 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>
* git-svn: t0001: workaround a heredoc bug in old versions of dashEric Wong2006-05-29
| | | | | | | | | 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>
* gitview: Move the console error messages to message dialogAneesh Kumar K.V2006-05-28
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitview: Add key binding for F5.Aneesh Kumar K.V2006-05-28
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-svn: ignore expansion of svn:keywordsEric Wong2006-05-23
| | | | | | | | | | | | | | | | 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>
* git-svn: starting a 1.1.0-pre development versionEric Wong2006-05-23
| | | | | | | Some not-very-well-tested changes coming... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'js/fetchconfig'Junio C Hamano2006-05-19
|\ | | | | | | | | | | * js/fetchconfig: Add a conversion tool to migrate remote information into the config fetch, pull: ask config for remote information
| * Add a conversion tool to migrate remote information into the configJohannes Schindelin2006-05-04
| | | | | | | | | | | | | | 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>
* | git-svn 1.0.0Eric Wong2006-05-05
| | | | | | | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-svn: documentation updatesEric Wong2006-05-05
|/ | | | | | | | | | | | | | * 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>
* Add colordiff for git to contrib/colordiff.Junio C Hamano2006-04-21
| | | | | | | | | | | 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>
* contrib/git-svn: handle array values correctlyEric Wong2006-04-04
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* contrib/git-svn: make sure our git-svn is up-to-date for testEric Wong2006-04-04
| | | | | | | | 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>
* contrib/git-svn: ensure repo-config returns a value before using itEric Wong2006-04-04
| | | | | | | 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>
* contrib/git-svn: documentation updatesEric Wong2006-04-01
| | | | | | | | | | | | | | 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>
* contrib/git-svn: accept configuration via repo-configEric Wong2006-04-01
| | | | | | | | 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>
* contrib/git-svn: force GIT_DIR to an absolute pathEric Wong2006-03-30
| | | | | | | 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>
* contrib/git-svn: stabilize memory usage for big fetchesEric Wong2006-03-25
| | | | | | | | | | | | | | | | | | 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>
* contrib/git-svn: allow rebuild to work on non-linear remote headsEric Wong2006-03-20
| | | | | | | | | | | | 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>
* git.el: Added a function to diff against the other heads in a merge.Alexandre Julliard2006-03-19
| | | | | | | | | 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>
* git.el: Get the default user name and email from the repository config.Alexandre Julliard2006-03-19
| | | | | | | | | 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>
* git.el: More robust handling of subprocess errors when returning strings.Alexandre Julliard2006-03-19
| | | | | | | | 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>
* contrib/git-svn: fix a harmless warning on rebuild (with old repos)Eric Wong2006-03-09
| | | | | | | | | 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>
* contrib/git-svn: remove the --no-stop-on-copy flagEric Wong2006-03-09
| | | | | | | | | | | | | 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>
* contrib/git-svn: fix svn compat and fetch argsEric Wong2006-03-09
| | | | | | | | | | | | | | | | | | | | | | | 'svn info' doesn't work with URLs in svn <= 1.1. Now we only run svn info in local directories. As a side effect, this should also work better for 'init' off directories that are no longer in the latest revision of the repository. svn checkout -r<revision> arguments are fixed. Newer versions of svn (1.2.x) seem to need URL@REV as well as -rREV to checkout a particular revision... Add an example in the manpage of how to track directory that has been moved since its initial revision. A huge thanks to Yann Dirson for the bug reporting and testing my original patch. Thanks also to Junio C Hamano for suggesting a safer way to use git-rev-parse. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* contrib/emacs/Makefile: Provide tool for byte-compiling files.Mark Wooding2006-03-05
| | | | | Signed-off-by: Mark Wooding <mdw@distorted.org.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git.el: Added customize support for all parameters.Alexandre Julliard2006-03-04
| | | | | | | Also fixed quoting of git-log-msg-separator. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git.el: Added support for Signed-off-by.Alexandre Julliard2006-03-04
| | | | | | | | If `git-append-signed-off-by' is non-nil, automatically append a sign-off line to the log message when editing it. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git.el: Automatically update .gitignore status.Alexandre Julliard2006-03-04
| | | | | | | | Update .gitignore files in the status list as they are created or modified. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git.el: Set default directory before running the status mode setup hooks.Alexandre Julliard2006-03-04
| | | | | | | | Also set the list-buffers-directory variable for nicer buffer list display. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>