summaryrefslogtreecommitdiff
path: root/git-cvsimport.perl
AgeCommit message (Collapse)Author
2011-05-06Merge branch 'gr/cvsimport-alternative-cvspass-location'Junio C Hamano
* gr/cvsimport-alternative-cvspass-location: Look for password in both CVS and CVSNT password files.
2011-05-01Look for password in both CVS and CVSNT password files.Guy Rouillier
In conn, if password is not passed on command line, look for a password entry in both the CVS password file and the CVSNT password file. If only one file is found and the requested repository is in that file, or if both files are found but the requested repository is found in only one file, use the password from the single file containing the repository entry. If both files are found and the requested repository is found in both files, then produce an error message. The CVS password file separates tokens with a space character, while the CVSNT password file separates tokens with an equal (=) character. Add a sub find_password_entry that accepts the password file name and a delimiter to eliminate code duplication. Signed-off-by: Guy Rouillier <guyr@burntmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-27git-cvsimport.perl: Bail out right away when reading from the server failsFabian Keil
If the CVS server is down, this reduced the git-cvsimport output from: ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused Use of uninitialized value $rep in scalar chomp at /usr/local/libexec/git-core/git-cvsimport line 369. Use of uninitialized value $rep in substitution (s///) at /usr/local/libexec/git-core/git-cvsimport line 370. Expected Valid-requests from server, but got: <unknown> to the less noisy: ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused Failed to read from server at /usr/local/libexec/git-core/git-cvsimport line 370. In this case a silent exit() instead of the die() would probably do, but I assume that there could be cases where the connection attempt succeeds, but reading from the server fails for other reasons. Signed-off-by: Fabian Keil <fk@fabiankeil.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Merge branch 'mg/cvsimport'Junio C Hamano
* mg/cvsimport: cvsimport: handle the parsing of uppercase config options cvsimport: partial whitespace cleanup
2011-01-04cvsimport: handle the parsing of uppercase config optionsMichael J Gruber
The current code leads to fatal: bad config value for 'cvsimport.r' in .git/config for a standard use case with cvsimport.r set. cvsimport sets internal variables by checking the config for each possible command line option. The problem is that config items are case insensitive, so config.r and config.R are the same. The ugly error is due to that fact that cvsimport expects a bool for -R (and thus config.R) but a remote name for -r (and thus config.r). Fix this by making cvsimport expect long names for uppercase options. config options for cvsimport have been undocumented so far, though present in the code and advertised in several tutorials. So one may read "enhance" for "fix". Similarly, the names for the options are "documented" in the code, waitiing for their lowercase equivalents to be transformed into long config options, as well. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-30cvsimport: partial whitespace cleanupMichael J Gruber
in preparation of the config parse patch Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-27Merge branch 'ab/require-perl-5.8'Junio C Hamano
* ab/require-perl-5.8: perl: use "use warnings" instead of -w perl: bump the required Perl version to 5.8 from 5.6.[21]
2010-10-19{cvs,svn}import: use the new 'git read-tree --empty'Thomas Rast
Since fb1bb96 (read-tree: deprecate syntax without tree-ish args, 2010-09-10) not passing --empty caused a spurious warning that was shown to the user. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27perl: use "use warnings" instead of -wÆvar Arnfjörð Bjarmason
Change the Perl scripts to turn on lexical warnings instead of setting the global $^W variable via the -w switch. The -w sets warnings for all code that interpreter runs, while "use warnings" is lexically scoped. The former is probably not what the authors wanted. As an auxiliary benefit it's now possible to build Git with: PERL_PATH='/usr/bin/env perl' Which would previously result in failures, since "#!/usr/bin/env perl -w" doesn't work as a shebang. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27perl: bump the required Perl version to 5.8 from 5.6.[21]Ævar Arnfjörð Bjarmason
Formalize our dependency on perl 5.8, bumped from 5.6.[12]. We already used the three-arg form of open() which was introduced in 5.6.1, but t/t9700/test.pl explicitly depended on 5.6.2. However git-add--interactive.pl has been failing on the 5.6 line since it was introduced in v1.5.0-rc0~12^2~2 back in 2006 due to this open syntax: sub run_cmd_pipe { my $fh = undef; open($fh, '-|', @_) or die; return <$fh>; } Which when executed dies on "Can't use an undefined value as filehandle reference". Several of our tests also fail on 5.6 (even more when compiled with NO_PERL_MAKEMAKER=1): t2016-checkout-patch.sh t3904-stash-patch.sh t3701-add-interactive.sh t7105-reset-patch.sh t7501-commit.sh t9700-perl-git.sh Our code is bitrotting on 5.6 with no-one interested in fixing it, and pinning us to such an ancient release of Perl is keeping us from using useful features introduced in the 5.8 release. The 5.6 series is now over 10 years old, and the 5.6.2 maintenance release almost 7. 5.8 on the other hand is more than 8 years old. All the modern Unix-like operating systems have now upgraded to it or a later version, and 5.8 packages are available for old IRIX, AIX Solaris and Tru64 systems. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Tor Arntsen <tor@spacetec.no> Acked-by: Randal L. Schwartz <merlyn@stonehenge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-06cvsimport: new -R option: generate .git/cvs-revisions mappingAaron Crane
This option causes the creation or updating of a file mapping CVS (filename, revision number) pairs to Git commit IDs. This is expected to be useful if you have CVS revision numbers stored in commit messages, bug-tracking systems, email archives, and the like. Signed-off-by: Aaron Crane <git@aaroncrane.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19cvsimport: standarize system() calls to external git toolsBen Walton
This patch standardizes calls to system() where external git tools are called. Instead of system("git foo ... "), use system(qw(git foo ...)). All calls are made without the use of an 'sh -c' process to split the arguments. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19cvsimport: standarize open() calls to external git toolsBen Walton
Standardize calls to open() where external git tools are used as part of a pipeline. Instead of open(X, "git foo ... |)", use open(X, "-|", qw(git foo ...)). All calls are made without the use of an 'sh -c' process to split the arguments. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19cvsimport: modernize callouts to git subcommandsBen Walton
This patch updates all calling conventions for external git tools. to use the modern calling convention (eg: git foo instead of git-foo). This is almost entierly a s/git-/git / operation, with deviations only as required to keep tests passing. Reported-by: Alexander Maier <amaier@opencsw.org> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-19cvsimport: fix relative argument filenamesJeff King
One of the first things that cvsimport does is chdir to the newly created git repo. This means that any filenames given to us on the command line will be looked up relative to the git repo directory. This is probably not what the user expects, so let's remember and prepend the original directory for relative filenames. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-17cvs: initialize empty passwordClemens Buchacher
If we do not read a password from the command line, and there are no passwords stored in .cvspass, we have to initialize the password with just "A". This fixes a regression introduced by 3fb9d582 (Do not scramble password read from .cvspass). Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-06Do not scramble password read from .cvspassPascal Obry
Passwords stored in .cvspass are already scrambled, we do not want to scramble them twice. Only passwords read from the command line are scrambled. This fixes a regression introduced by b2139db (git-cvsimport: add support for cvs pserver password scrambling., 2009-08-14). Signed-off-by: Pascal Obry <pascal@obry.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-15git-cvsimport: add support for cvs pserver password scrambling.Dirk Hoerner
Instead of a cleartext password, the CVS pserver expects a scrambled one in the authentication request. With this patch it is possible to import CVS repositories only accessible via pserver and user/password. Signed-off-by: Dirk Hoerner <dirker@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-06Merge branch 'maint'Junio C Hamano
* maint: RelNotes 1.5.6.5 updates diff.renamelimit is a basic diff configuration git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout. Documentation: typos / spelling fixes in older RelNotes
2008-08-05git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.Jim Meyering
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13Make usage strings dash-lessStephan Beyer
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-06-11git-cvsimport: do not fail when CVSROOT is /Philippe Bruhat (BooK)
For CVS repositories with unusual CVSROOT, git-cvsimport would fail: $ git-cvsimport -v -C foo -d :pserver:anon:@cvs.example.com:/ foo AuthReply: error 0 : no such repository This patch ensures that the path is never empty, but at least '/'. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25Make git-cvsimport remove ['s from tags, as bad_ref_char doesn't allow them.Paul Oliver
Signed-off-by: Paul Oliver <puzza007@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-30Merge branch 'maint-1.5.4' into maintJunio C Hamano
* maint-1.5.4: cvsimport: always pass user data to "system" as a list fix reflog approxidate parsing bug
2008-04-30cvsimport: always pass user data to "system" as a listJeff King
This avoids invoking the shell. Not only is it faster, but it prevents the possibility of interpreting our arguments in the shell. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13Merge branch 'maint'Junio C Hamano
* maint: git-cvsimport: fix merging with remote parent branch gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
2008-03-13git-cvsimport: fix merging with remote parent branchMarc-Andre Lureau
commit-tree fails when specifying a remote name (via -r option) and one of the parent branch has a name. Prefixing with "$remote/" fix it. Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-01cvsimport: allow for multiple -M optionsPhilippe Bruhat (BooK
Use Getopt::Long instead of Getopt::Std to handle multiple -M options, for all the cases when having a single custom regex is not enough. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-01cvsimport: have default merge regex allow for dashes in the branch namePhilippe Bruhat (BooK
The default value of @mergerx uses \w, which matches word character; a branch name like policy-20050608-br will not be matched. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13cvsimport: have default merge regex also match beginning of commit messageGerrit Pape
The default value of @mergerx uses \W, which matches a non-word character; this means that commit messages like "Merging FOO" are not matched by default; using \b, which matches a word boundary, instead of \W fixes that. This change was suggested by Frédéric Brière through http://bugs.debian.org/463468 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-14cvsimport: remove last use of repo-config from git standard toolsDan McGee
git cvsimport was the last tool to use repo-config instead of config. Update it to use plain git config. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-24cvsimport: die on cvsps errorsJeff King
We were not previously checking the exit status of cvsps at all. If it exited before producing any useful output, we ended up with an empty import, which caused a spew of confusing error messages from other parts of git: $ git-cvsimport foo Initialized empty Git repository in ... some error from cvsps fatal: refs/heads/origin: not a valid SHA1 fatal: master: not a valid SHA1 warning: You appear to be on a branch yet to be born. warning: Forcing checkout of HEAD. fatal: just how do you expect me to merge 0 trees? checkout failed: 256 Now we get: $ git-cvsimport foo Initialized empty Git repository in ... some error from cvsps git-cvsimport: fatal: cvsps reported error Signed-off-by: Jeff King <peff@peff.net> Acked-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-22Small comment fix for git-cvsimport.Stefan Sperling
Signed-off-by: Stefan Sperling <stsp@stsp.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-01Merge branch 'maint'Junio C Hamano
* maint: Replace the word 'update-cache' by 'update-index' everywhere cvsimport: fix usage of cvsimport.module t7003-filter-branch: Fix test of a failing --msg-filter. cvsimport: miscellaneous packed-ref fixes cvsimport: use rev-parse to support packed refs Add basic cvsimport tests
2007-11-30cvsimport: fix usage of cvsimport.moduleJeff King
There were two problems: 1. We only look at the config variable if there is no module given on the command line. We checked this by comparing @ARGV == 0. However, at the time of the comparison, we have not yet parsed the dashed options, meaning that "git cvsimport" would read the variable but "git cvsimport -a" would not. This is fixed by simply moving the check after the call to getopt. 2. If the config variable did not exist, we were adding an empty string to @ARGV. The rest of the script, rather than barfing for insufficient input, would then try to import the module '', leading to rather confusing error messages. Based on patch from Emanuele Giaquinta. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28cvsimport: miscellaneous packed-ref fixesJeff King
These were found with a grep for '$git_dir'; they all replace a direct access of "$git_dir/refs/..." with a call to git-rev-parse or git-update-ref. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28cvsimport: use rev-parse to support packed refsJeff King
Previously, if refs were packed, git-cvsimport would assume that particular refs did not exist. This could lead to, for example, overwriting previous 'origin' commits that were packed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-09git-cvsimport: fix handling of user name when it is not set in CVSROOTGordon Hopper
The cvs programs do not default to "anonymous" as the user name, but use the currently logged in user. This patch more closely matches the cvs behavior. Signed-off-by: Gordon Hopper <g.hopper@computer.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-04git-cvsimport: really convert underscores in branch names to dots with -uGerrit Pape
The documentation states for the -u option that underscores in tag and branch names are converted to dots, but this was actually implemented for the tag names only. Kurt Roeckx reported this through http://bugs.debian.org/446495 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-08(cvs|svn)import: Ask git-tag to overwrite old tags.Michael Smith
If the tag was moved in CVS or SVN history, it will be moved in the imported history as well. Tag history is not tracked. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-29git-cvsimport: force checkout of working tree after initial importGerrit Pape
When creating a brand new git repository through git-cvsimport (not incremental import), force a checkout of HEAD of master as working tree after successful import using the -f switch to git checkout. Otherwise the working tree is empty, and all files are reported as 'deleted' by git status. This was noticed and reported by Cameron Dale through http://bugs.debian.org/430903 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-23Generate tags with correct timestamp (git-svnimport)Dave O'Neill
Now uses git-tag instead of manually constructing the tag. This gives us a correct timestamp, removes some crufty code, and makes it work the same as git-cvsimport. The generated tags are now lightweight tags instead of tag objects, which may or may not be the behaviour we want. Also, remove two unused variables from git-cvsimport. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13Merge branch 'aw/cvs'Junio C Hamano
* aw/cvs: cvsimport: add <remote>/HEAD reference in separate remotes more cvsimport: update documentation to include separate remotes option cvsimport: add support for new style remote layout
2007-06-13Merge branch 'ep/cvstag'Junio C Hamano
* ep/cvstag: Use git-tag in git-cvsimport
2007-06-07War on whitespaceJunio C Hamano
This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06Use git-tag in git-cvsimportElvis Pranskevichus
Currently git-cvsimport tries to create tag objects directly via git-mktag in a very broken way, e.g the stuff it writes into the tagger field of the tag object doesn't really resemble the GIT_COMMITTER_IDENT. This makes gitweb and possibly other tools that try to interpret tag objects to be confused about tag date and authorship. Fix this by calling git-tag instead. This also has a nice side effect of not creating the tag object but only the lightweight tag as that's the only thing CVS has anyways. Signed-off-by: Elvis Pranskevichus <el@prans.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06git-cvsimport: Make sure to use $git_dir always instead of .git sometimesMichael Milligan
CVS import was failing on a couple repos I was trying to import. I was setting GIT_DIR=newproj.git and using the -i flag, but this bug was thwarting the effort... evil CVS. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06cvsimport: add <remote>/HEAD reference in separate remotes moreAndy Whitcroft
When in separate remote mode (via -r <remote>) we can now use the name HEAD for the CVS HEAD. In keeping with git-clone remotes/<remote>/HEAD is creates as a symbolic ref to the user specified name for the HEAD which defaults to master. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06cvsimport: update documentation to include separate remotes optionAndy Whitcroft
Document the cvsimport -r <remote> option which switches cvsimport to using a separate remote for tracking branches. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06cvsimport: add support for new style remote layoutAndy Whitcroft
cvsimport creates any branches found in the remote CVS repository in the refs/heads namespace. This makes sense for a repository conversion. When using git as a sane interface to a remote CVS repository, that repository may well remain as the 'master' respository. In this model it makes sense to import the CVS repository into the refs/remotes namespace. Add a new option '-r <remote>' to set the remote name for this import. When this option is specified branches are named refs/remotes/<remote>/branch, with HEAD named as master matching git-clone separate remotes layout. Without branches are placed ion refs/heads, with HEAD named origin as before. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>