summaryrefslogtreecommitdiff
path: root/git-svn.perl
AgeCommit message (Collapse)AuthorFilesLines
2008-12-14Get rid of the last remnants of GIT_CONFIG_LOCALLibravatar Johannes Schindelin1-2/+1
In dc871831(Only use GIT_CONFIG in "git config", not other programs), GIT_CONFIG_LOCAL was rested in peace, in favor of not reading /etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-09Merge branch 'maint'Libravatar Junio C Hamano1-4/+12
* maint: work around Python warnings from AsciiDoc git-svn: Make following parents atomic
2008-12-08git-svn: Make following parents atomicLibravatar Deskin Miller1-4/+12
find_parent_branch generates branch@rev type branches when one has to look back through SVN history to properly get the history for a branch copied from somewhere not already being tracked by git-svn. If in the process of fetching this history, git-svn is interrupted, then when one fetches again, it will use whatever was last fetched as the parent commit and fail to fetch any more history which it didn't get to before being terminated. This is especially troubling in that different git-svn copies of the same SVN repository can end up with different commit sha1s, incorrectly showing the history as divergent and precluding easy collaboration using git push and fetch. To fix this, when we initialise the Git::SVN object $gs to search for and perhaps fetch history, we check if there are any commits in SVN in the range between the current revision $gs is at, and the top revision for which we were asked to fill history. If there are commits we're missing in that range, we continue the fetch from the current revision to the top, properly getting all history before using it as the parent for the branch we're trying to create. Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-03git-svn: Make branch use correct svn-remoteLibravatar Deskin Miller1-1/+1
The 'branch' subcommand incorrectly had the svn-remote to use hardcoded as 'svn', the default remote name. This meant that branches derived from other svn-remotes would try to use the branch and tag configuration for the 'svn' remote, potentially copying would-be branches to the wrong place in SVN, into the branch namespace for another project. Fix this by using the remote name extracted from the svn info for the specified git ref. Add a testcase for this behaviour. [jc: squashed in a fix to test from Michael J Gruber for older svn (1.4)] Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-13git-svn: Update git-svn to use the ability to place temporary files within ↵Libravatar Marten Svanfeldt (dev)1-4/+5
repository directory This fixes git-svn within msys where Perl will provide temporary files with path such as /tmp while the git suit expects native Windows paths. Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-11-13git-svn: proper detection of bare repositoriesLibravatar Deskin Miller1-5/+7
When in a bare repository (or .git, for that matter), git-svn would fail to initialise properly, since git rev-parse --show-cdup would not output anything. However, git rev-parse --show-cdup actually returns an error code if it's really not in a git directory. Fix the issue by checking for an explicit error from git rev-parse, and setting $git_dir appropriately if instead it just does not output. Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-11-13git-svn: respect i18n.commitencoding configLibravatar Eric Wong1-3/+21
SVN itself always stores log messages in the repository as UTF-8. git always stores/retrieves everything as raw binary data with no transformations whatsoever. To interact with SVN, we need to encode log messages as UTF-8 before sending them to SVN, as SVN cannot do it for us. When retrieving log messages from SVN, we also need to (attempt to) reencode the UTF-8 log message back to the user-specified commit encoding. Note, handling i18n.logoutputencoding for "git svn log" also needs to be done in a future change. Also, this change only deals with the encoding of commit messages and nothing else (path names, blob content, ...). In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com> James North <tocapicha@gmail.com> wrote: > Hi, > > I'm using git-svn on a system with ISO-8859-1 encoding. The problem is > when I try to use "git svn dcommit" to send changes to a remote svn > (also ISO-8859-1). > > Seems like git-svn is sending commit messages with utf-8 (just a > guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a > de cami?\243n" > > I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the > warning when doing "git svn dcommit" but messages still are sent with > wrong encoding. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-11-13git-svn: don't escape tilde ('~') for http(s) URLsLibravatar Eric Wong1-3/+3
Thanks to Jose Carlos Garcia Sogo and Björn Steinbrink for the bug report. On 2008.10.18 23:39:19 +0200, Björn Steinbrink wrote: > Hi, > > Jose Carlos Garcia Sogo reported on #git that a git-svn clone of this > svn repo fails for him: > https://sucs.org/~welshbyte/svn/backuptool/trunk > > I can reproduce that here with: > git-svn version 1.6.0.2.541.g46dc1.dirty (svn 1.5.1) > > The error message I get is: > Apache got a malformed URI: Unusable URI: it does not refer to this > repository at /usr/local/libexec/git-core/git-svn line 4057 > > strace revealed that git-svn url-encodes ~ while svn does not do that. > > For svn we have: > write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\"> > <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>... > > While git-svn shows: > write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\"> > <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>... Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-10-31Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: git-svn: change dashed git-commit-tree to git commit-tree Documentation: clarify information about 'ident' attribute bash completion: add doubledash to "git show" Use test-chmtime -v instead of perl in t5000 to get mtime of a file Add --verbose|-v to test-chmtime asciidoc: add minor workaround to add an empty line after code blocks Plug a memleak in builtin-revert Add file delete/create info when we overflow rename_limit Install git-cvsserver in $(bindir) Install git-shell in bindir, too
2008-10-31git-svn: change dashed git-commit-tree to git commit-treeLibravatar Deskin Miller1-1/+1
Signed-off-by: Deskin Miller <deskinm@umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: add -p: warn if only binary changes present git-archive: work in bare repos git-svn: change dashed git-config to git config
2008-10-24git-svn: change dashed git-config to git configLibravatar Deskin Miller1-1/+1
Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-06Add git-svn branch to allow branch creation in SVN repositoriesLibravatar Florian Ragwitz1-1/+46
[ew: fixed a warning to stderr causing t9108 to fail] Signed-off-by: Florian Ragwitz <rafl@debian.org> Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30Merge branch 'maint'Libravatar Shawn O. Pearce1-1/+1
* maint: git-svn: call 'fatal' correctly in set-tree Replace svn.foo.org with svn.example.com in git-svn docs (RFC 2606) t0024: add executable permission
2008-09-30git-svn: call 'fatal' correctly in set-treeLibravatar Luc Heinrich1-1/+1
When doing a set-tree and there is no revision to commit to, the following unrelated error message is displayed: "Undefined subroutine &Git::SVN::fatal called at /opt/local/libexec/git-core/git-svn line 2575." The following patch fixes the problem and allows the real error message to be shown. Signed-off-by: Luc Heinrich <luc@honk-honk.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-21git-svn: do a partial rebuild if rev_map is out-of-dateLibravatar Deskin Miller1-5/+19
Suppose you're using git-svn to work with a certain SVN repository. Since you don't like 'git-svn fetch' to take forever, and you don't want to accidentally interrupt it and end up corrupting your repository, you set up a remote Git repository to mirror the SVN repository, which does its own 'git-svn fetch' on a cronjob; now you can 'git-fetch' from the Git mirror into your local repository, and still dcommit to SVN when you have changes to push. After you do this, though, git-svn will get very confused if you ever try to do 'git-svn fetch' in your local repository again, since its rev_map will differ from the branch's head, and it will be unable to fetch new commits from SVN because of the metadata conflict. But all the necessary metadata are there in the Git commit message; git-svn already knows how to rebuild rev_map files that get blown away, by using the metadata. This patch teaches git-svn do a partial rebuild of the rev_map to match the true state of the branch, if it ever is used to fetch again. This will only work for projects not using either noMetadata or useSvmProps configuration options; if you are using these options, git-svn will fall back to the previous behaviour. Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18Merge branch 'maint'Libravatar Junio C Hamano1-13/+12
* maint: sha1_file: link() returns -1 on failure, not errno Make git archive respect core.autocrlf when creating zip format archives Add new test to demonstrate git archive core.autocrlf inconsistency gitweb: avoid warnings for commits without body Clarified gitattributes documentation regarding custom hunk header. git-svn: fix handling of even funkier branch names git-svn: Always create a new RA when calling do_switch for svn:// git-svn: factor out svnserve test code for later use diff/diff-files: do not use --cc too aggressively
2008-09-18git-svn: fix handling of even funkier branch namesLibravatar Eric Wong1-0/+1
Apparently do_switch() tolerates the lack of escaping in less funky branch names. For the really strange and scary ones, we need to escape them properly. It strangely maintains compatible with the existing handling of branch names with spaces and exclamation marks. Reported-by: m.skoric@web.de ($gmane/94677) Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-18git-svn: Always create a new RA when calling do_switch for svn://Libravatar Alec Berryman1-13/+12
Not doing so caused the "Malformed network data" error when a directoy was deleted and replaced with a copy from an older version. Signed-off-by: Alec Berryman <alec@thened.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Merge branch 'maint'Libravatar Junio C Hamano1-3/+3
* maint: Update draft release notes for 1.6.0.2 Use compatibility regex library for OSX/Darwin git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl Git.pm: Use File::Temp->tempfile instead of ->new t7501: always use test_cmp instead of diff Conflicts: Makefile
2008-09-10git-svn: Fixes my() parameter list syntax error in pre-5.8 PerlLibravatar Marcus Griep1-1/+1
Signed-off-by: Marcus Griep <marcus@griep.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10Git.pm: Use File::Temp->tempfile instead of ->newLibravatar Marcus Griep1-2/+2
Perl 5.8.0 ships with File::Temp 0.13, which does not have the new() interface introduced in 0.14, as pointed out by Tom G. Christensen. This modifies Git.pm to use the more established tempfile() interface and updates 'git svn' to match. Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net> Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-06git-svn: fix handling of even funkier branch namesLibravatar Eric Wong1-0/+1
Apparently do_switch() tolerates the lack of escaping in less funky branch names. For the really strange and scary ones, we need to escape them properly. It strangely maintains compatible with the existing handling of branch names with spaces and exclamation marks. Reported-by: m.skoric@web.de ($gmane/94677) Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-06git-svn: set auto_props when renaming filesLibravatar Paul Talacko1-0/+1
Patch-by: Paul Talacko <gnuruandstuff@yahoo.co.uk>: <http://article.gmane.org/gmane.comp.version-control.git/95006> > Hello, > > There's an issue in git-svn as autoprops are not applied to > renamed files, only to added files. > > This patch fixes the bug. [ew: added test case] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: match SVN 1.5 behaviour of info' on unknown itemLibravatar Thomas Rast1-2/+2
Previously 'git svn info unknown-file' only announced its failure (in the SVN 1.4 style, "not a versioned resource"), and exited successfully. It is desirable to actually exit with failure, so change the code to exit(1) under this condition. Since that is already halfway SVN 1.5 compatibility, also change the error output to match 1.5. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: always quote URLs in 'info' outputLibravatar Thomas Rast1-3/+22
Changes 'git svn info' to always URL-escape the 'URL' and 'Repository' fields and --url output, like SVN (at least 1.5) does. Note that reusing the escape_url() further down in Git::SVN::Ra is not possible because it only triggers for http(s) URLs. I did not know whether extending it to all schemes would break SVN access anywhere, so I made a new one that quotes in all schemes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn info: make info relative to the current directoryLibravatar Thomas Rast1-2/+3
Previously 'git svn info <path>' would always treat the <path> as relative to the working directory root, with a default of ".". This does not match the behaviour of 'svn info'. Prepend $(git rev-parse --show-prefix) to the path used inside cmd_info to make it relative to the current working directory. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git svn: catch lack of upstream info for dcommit earlierLibravatar Thomas Rast1-4/+4
Since 711521e 'git svn dcommit' attempts to use the upstream information to determine the SVN URL, before it verifies that it even found an upstream. Move up the corresponding check. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: check error code of send_txstreamLibravatar Eric Wong1-1/+5
Not checking the error code of a function used to transform and send data makes me nervous. It currently returns "undef" on success; so die if we get any result other than "undef" because it's likely something went wrong somewhere. I really wish this function returned an MD5 like send_stream (or better yet, SHA1) for verification. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: Send deltas during commitsLibravatar Florian Weimer1-5/+13
Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: Introduce SVN::Git::Editor::_chg_file_get_blobLibravatar Florian Weimer1-12/+19
Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-09-05git-svn: extract base blob in generate_diffLibravatar Florian Weimer1-3/+4
We need the base blob to compute a delta to be sent to the server. Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-08-20git-svn: fix dcommit to urls with embedded usernamesLibravatar Eric Wong1-3/+5
Don't rely on the extracted URL from working_head_info since that has the username removed. Instead use the $gs->full_url method (as before with ba24e74 (git-svn: add ability to specify --commit-url for dcommit, 2008-08-07)) to give us the URL to commit to if --commit-url is not specified. Aditionally, since we clean usernames from URLs, checking the URL after rebase can fail because it doesn't match the URL we used to commit; so unconditionally provide a username-free URL for checking the result of the refetch. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-12git-svn: Reduce temp file usage when dealing with non-linksLibravatar Marcus Griep1-24/+22
Currently, in sub 'close_file', git-svn creates a temporary file and copies the contents of the blob to be written into it. This is useful for symlinks because svn stores symlinks in the form: link $FILE_PATH Git creates a blob only out of '$FILE_PATH' and uses file mode to indicate that the blob should be interpreted as a symlink. As git-hash-object is invoked with --stdin-paths, a duplicate of the link from svn must be created that leaves off the first five bytes, i.e. 'link '. However, this is wholly unnecessary for normal blobs, though, as we already have a temp file with their contents. Copying the entire file gains nothing, and effectively requires a file to be written twice before making it into the object db. This patch corrects that issue, holding onto the substr-like duplication for symlinks, but skipping it altogether for normal blobs by reusing the existing temp file. Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-08-12git-svn: Make it incrementally faster by minimizing temp filesLibravatar Marcus Griep1-17/+18
Currently, git-svn would create a temp file on four occasions: 1. Reading a blob out of the object db 2. Creating a delta from svn 3. Hashing and writing a blob into the object db 4. Reading a blob out of the object db (in another place in code) Any time git-svn did the above, it would dutifully create and then delete said temp file. Unfortunately, this means that between 2-4 temporary files are created/deleted per file 'add/modify'-ed in svn (O(n)). This causes significant overhead and helps the inode counter to spin beautifully. By its nature, git-svn is a serial beast. Thus, reusing a temp file does not pose significant problems. "truncate and seek" takes much less time than "unlink and create". This patch centralizes the tempfile creation and holds onto the tempfile until they are deleted on exit. This significantly reduces file overhead, now requiring at most three (3) temp files per run (O(1)). Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net>
2008-08-08git-svn: wrap long lines in a few placesLibravatar Eric Wong1-2/+5
Oops, I let a few patches slip by with long lines in them. Extracted from an unrelated patch by: Marcus Griep <marcus@griep.us> Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-08git-svn: Allow deep branch names by supporting multi-globsLibravatar Marcus Griep1-16/+44
Some repositories use a deep branching strategy, such as: branches/1.0/1.0.rc1 branches/1.0/1.0.rc2 branches/1.0/1.0.rtm branches/1.0/1.0.gold Only allowing a single glob stiffles this. This change allows for a single glob 'set' to accept this deep branching strategy. The ref glob depth must match the branch glob depth. When using the -b or -t options for init or clone, this is automatically done. For example, using the above branches: svn-remote.svn.branches = branches/*/*:refs/remote/*/* gives the following branch names: 1.0/1.0.rc1 1.0/1.0.rc2 1.0/1.0.rtm 1.0/1.0.gold [ew: * removed unrelated line-wrapping changes * fixed line-wrapping in a few more places * removed trailing whitespace * fixed bashism in test * removed unnecessary httpd startup in test * changed copyright on tests to 2008 Marcus Griep * added executable permissions to new tests ] Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-08Fix multi-glob assertion in git-svnLibravatar Marcus Griep1-2/+3
Fixes bad regex match check for multiple globs (would always return one glob regardless of actual number). [ew: fixed a bashism in the test and some minor line-wrapping] Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-08git-svn: add ability to specify --commit-url for dcommitLibravatar Eric Wong1-3/+6
This allows one to use public svn:// URLs for fetch and svn+ssh:// URLs for committing (without using the complicated rewriteRoot option, reimporting or git-filter-branch). Using this can also help avoid unnecessary server authentication/encryption overhead on busy SVN servers. Along with the new --revision option, this can also be allowed to override the branch detection in dcommit, too. This is potentially dangerous and not recommended! (And also purposely undocumented, but the loaded gun is there in case somebody wants to make it safe). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-05git-svn: properly set path for "info" commandLibravatar Eric Wong1-2/+6
canonicalize_path() was previously changed to better fit SVN 1.5, but it makes the "info" command not match svn(1) in two places: 1) URL ended up with a trailing slash when run without an argument. 2) "Path: " was displayed instead of "Path: ." when run without an argument. We will also handle odd cases where a user wants to get information on a file or directory named "0", too. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-03git-svn: Abort with an error if 'fetch' parameter is invalid.Libravatar Avery Pennarun1-2/+6
Previously, if a config entry looked like this: svn-remote.svn.fetch=:refs/heads/whatever git-svn would silently do nothing if you asked it to "git svn fetch", and give a strange error if asked to "git svn dcommit". What it really wants is a line that looks like this: svn-remote.svn.fetch=:refs/remotes/whatever So we should simply abort if we get the wrong thing. On the other hand, there's actually no good reason for git-svn to enforce using the refs/remotes namespace, but the code seems to have hardcoded this in several places and I'm not brave enough to try to fix it all right now. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25git-svn: teach dcommit about svn auto-propsLibravatar Brad King1-0/+53
Subversion repositories often require files to have properties such as svn:mime-type and svn:eol-style set when they are added. Users typically set these properties automatically using the SVN auto-props feature with 'svn add'. This commit teaches dcommit to look at the user SVN configuration and apply matching auto-props entries for files added by a diff as it is applied to the SVN remote. Signed-off-by: Brad King <brad.king@kitware.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-20git-svn: fix git svn info to work without argumentsLibravatar Dmitry Potapov1-1/+1
commit 2fe403e7452bd6e1e8232445cf5434ce8f1af973 broke "git-svn info ." due to replacing '.' with '' in canonicalize_path for the top directory, while find_file_type_and_diff_status was not corrected. Bug reports: http://thread.gmane.org/gmane.comp.version-control.git/87822/ http://bugs.debian.org/490400 Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-16Merge branch 'sb/dashless'Libravatar Junio C Hamano1-1/+1
* sb/dashless: Make usage strings dash-less t/: Use "test_must_fail git" instead of "! git" t/test-lib.sh: exit with small negagive int is ok with test_must_fail Conflicts: builtin-blame.c builtin-mailinfo.c builtin-mailsplit.c builtin-shortlog.c git-am.sh t/t4150-am.sh t/t4200-rerere.sh
2008-07-14git-svn: typofixLibravatar Frederik Schwarzer1-1/+1
Signed-off-by: Frederik Schwarzer <schwarzerf@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-14git-svn: find-rev and rebase for SVN::Mirror repositoriesLibravatar João Abecasis1-4/+35
find-rev and rebase error out on svm because git-svn doesn't trace the original svn revision numbers back to git commits. The updated test case, included in the patch, shows the issue and passes with the rest of the patch applied. This fixes Git::SVN::find_by_url to find branches based on the svm:source URL, where useSvmProps is set. Also makes sure cmd_find_rev and working_head_info use the information they have to correctly track the source repository. This is enough to get find-rev and rebase working. Signed-off-by: João Abecasis <joao@abecasis.name> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13Make usage strings dash-lessLibravatar Stephan Beyer1-1/+1
When you misuse a git command, you are shown the usage string. But this is currently shown in the dashed form. So if you just copy what you see, it will not work, when the dashed form is no longer supported. This patch makes git commands show the dash-less version. For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh generates a dash-less usage string now. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-07git-svn.perl: workaround assertions in svn library 1.5.0Libravatar Gerrit Pape1-0/+2
With subversion 1.5.0 (C and perl libraries) the git-svn selftest t9101-git-svn-props.sh fails at test 25 and 26. The following commands cause assertions in the svn library $ cd deeply $ git-svn propget svn:ignore . perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_ra/ra_loader.c:674: svn_ra_get_dir: Assertion `*path != '/'' failed. Aborted $ git-svn propget svn:ignore .. perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_subr/path.c:120: svn_path_join: Assertion `is_canonical(component, clen)' failed. With this commit, git-svn makes sure the path doesn't start with a slash, and is not a dot, working around these assertions. The breakage was reported by Lucas Nussbaum through http://bugs.debian.org/489108 Signed-off-by: Gerrit Pape <pape@smarden.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28git-svn: don't sanitize remote names in configLibravatar Eric Wong1-12/+3
The original sanitization code was just taken from the remotes2config.sh shell script in contrib. Credit to Avery Pennarun for noticing this mistake, and Junio for clarifying the rules for config section names: Junio C Hamano wrote in <7vfxr23s6m.fsf@gitster.siamese.dyndns.org>: > In > > [foo "bar"] baz = value > > foo and baz must be config.c::iskeychar() (and baz must be isalpha()), but > "bar" can be almost anything. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28git-svn: avoid filling up the disk with temp files.Libravatar Avery Pennarun1-1/+4
Commit ffe256f9bac8a40ff751a9341a5869d98f72c285 ("git-svn: Speed up fetch") introduced changes that create a temporary file for each object fetched by svn. These files should be deleted automatically, but perl apparently doesn't do this until the process exits (or perhaps when its garbage collector runs). This means that on a large fetch, especially with lots of branches, we sometimes fill up /tmp completely, which prevents the next temp file from being written completely. This is aggravated by the fact that a new temp file is created for each updated file, even if that update produces a file identical to one already in git. Thus, it can happen even if there's lots of disk space to store the finished repository. We weren't adequately checking for write errors, so this would result in an invalid file getting committed, which caused git-svn to fail later with an invalid checksum. This patch adds a check to syswrite() so similar problems don't lead to corruption in the future. It also unlink()'s each temp file explicitly when we're done with it, so the disk doesn't need to fill up. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Tested-by: Björn Steinbrink <B.Steinbrink@gmx.de> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>