summaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
AgeCommit message (Collapse)Author
2013-11-04Merge branch 'ak/cvsserver-stabilize-use-of-hash-keys'Junio C Hamano
* ak/cvsserver-stabilize-use-of-hash-keys: cvsserver: Determinize output to combat Perl 5.18 hash randomization
2013-10-30cvsserver: Determinize output to combat Perl 5.18 hash randomizationAnders Kaseorg
Perl 5.18 randomizes the seed used by its hash function, so iterating through hashes results in different orders from run to run: http://perldoc.perl.org/perl5180delta.html#Hash-overhaul This usually broke t9400 (gitcvs.dbname, gitcvs.ext.dbname, when running cmp on two .sqlite files) and t9402 (check [cvswork3] diff, when running test_cmp on two diffs). To fix this, hide the internal order of hashes with sort when sending output or running database queries. (An alternative workaround is PERL_HASH_SEED=0, but this seems nicer.) Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18Merge branch 'jc/cvsserver-perm-bit-fix'Junio C Hamano
"git cvsserver" computed the permission mode bits incorrectly for executable files. * jc/cvsserver-perm-bit-fix: cvsserver: pick up the right mode bits
2013-09-11cvsserver: pick up the right mode bitsJunio C Hamano
When determining the file mode from either ls-tree or diff-tree output, we used to grab these octal mode string (typically 100644 or 100755) and then did $git_perms .= "r" if ( $mode & 4 ); $git_perms .= "w" if ( $mode & 2 ); $git_perms .= "x" if ( $mode & 1 ); which was already wrong, as (100644 & 4) is very different from oct("100644") & 4. An earlier refactoring 2c3af7e7 (cvsserver: factor out git-log parsing logic, 2012-10-13) further changed it to pick the third octal digit (10*0*644 or 10*0*755) from the left and then do the above conversion, which does not make sense, either. Let's use the third digit from the last of the octal mode string to make sure we get the executable and read bits right. Signed-off-by: Junio C Hamano <gitster@pobox.com> Tested-by: Michael Cronenworth <mike@cchtml.com>
2013-09-04use 'tree-ish' instead of 'treeish'Richard Hansen
Replace 'treeish' in documentation and comments with 'tree-ish' to match gitglossary(7). The only remaining instances of 'treeish' are: * variable, function, and macro names * "(also treeish)" in the definition of tree-ish in gitglossary(7) Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12Correct common spelling mistakes in comments and testsStefano Lattarini
Most of these were found using Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24git-cvsimport: use a lowercase "usage:" stringDavid Aguilar
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: support -r and sticky tags for most operationsMatthew Ogilvie
- Split off prepDirForOutput for "update" and "commit". Some low level protocol details were changed to more closely resemble CVS even in non-tagged cases. Hopefully it still works with finicky clients like Eclipse. - Substantial changes to "diff". The output is now closer to standard CVS (including exit status), and can be used as a patch, but there are still a number of differences compared to CVS. - Tweaks to "add", "remove", "status", and "commit". - FUTURE: CVS revision numbers for branches simply encode git commit IDs in a way that resembles CVS revision numbers, dropping all normal CVS structural relations between different revision numbers. - FUTURE: "log" doesn't try to work properly at all with branches and tags. - FUTURE: "annotate" probably doesn't work with branches or tags either (untested)? Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: Add version awareness to argsfromdirMatthew Ogilvie
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: generalize getmeta() to recognize commit refsMatthew Ogilvie
This allows getmeta() to recognize any commitish (sha1, tag/branch name, etc). Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: implement req_Sticky and related utilitiesMatthew Ogilvie
Nothing sets sticky yet, or uses the values set by this, but soon... Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: add misc commit lookup, file meta data, and file listing functionsMatthew Ogilvie
These will be used soon, but not yet. PERFORMANCE NOTE: getMetaFromCommithash() does not scale well as currently implemented. See comment for possible optimization strategies. Fortunately, it will only be used in cases that would not have worked at all before this change. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: define a tag name character escape mechanismMatthew Ogilvie
CVS tags are officially only allowed to use [-_0-9A-Za-f]. Git refs commonly uses other characters, especially [./]. Such characters need to be escaped from CVS in order to be referenced. This just defines functions to escape/unescape names. The functions are not used yet. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: cleanup extra slashes in filename argumentsMatthew Ogilvie
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: factor out git-log parsing logicMatthew Ogilvie
Some field conversion was already duplicated, and more calls will be added soon. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver status: provide real sticky infoMatthew Ogilvie
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: cvs add: do not expand directory argumentsMatthew Ogilvie
Standard "cvs add" never does any recursion. With standard cvs, "cvs add dir" will either add just the "dir" to the repository, or error out. Prior to this change, git-cvsserver would try to recurse (perhaps re-adding sandbox-removed files?) into the existing directory instead. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: use whole CVS rev number in-process; don't strip "1." prefixMatthew Ogilvie
Keep track of the whole CVS revision number in-process. This will clarify code when we start handling non-linear revision numbers later. There is one externally visible change: conflict markers after an update will now include the full CVS revision number, including the "1." prefix. It used to leave off the prefix. Other than the conflict marker, this change doesn't effect external functionality. No new features, and the DB schema is unchanged such that it continues to store just the stripped rev numbers (without prefix). Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: split up long lines in req_{status,diff,log}Matthew Ogilvie
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: clean up client request handler map commentsMatthew Ogilvie
- Comment that it should not be considered a complete list. - #'annotate' comment - Uncommented annotate line is 2 lines earlier. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: remove unused functions _headrev and gethistoryMatthew Ogilvie
Remove: - _headrev() - It uses similar functionality from getmeta() and gethead(). - gethistory() - It uses similar functions gethistorydense() and getlog(). Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver update: comment about how we shouldn't remove a user-modified fileMatthew Ogilvie
Instead of a comment, we should really add test cases and actually fix it. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: add comments about database schema/usageMatthew Ogilvie
No functionality changes, but these comments should make it easier to understand how it works. Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-16cvsserver: removed unused sha1Or-k mode from kopts_from_pathMatthew Ogilvie
sha1Or-k was a vestige from an early, never-released attempt to handle some oddball cases of CRLF conversion (-k option). Ultimately it wasn't needed, and I should have gotten rid of it before submitting the CRLF patch in the first place. See also 90948a42892779 (add ability to guess -kb from contents). Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05use -h for synopsis and --help for manpage consistentlyClemens Buchacher
A few scripted Porcelain implementations pretend as if the routine to show their own help messages are triggered upon "git cmd --help", but a command line parser of "git" will hijack such a request and shows the manpage for the cmd subcommand. Leaving the code to handle such input is simply misleading. Signed-off-by: Clemens Buchacher <drizzd@aon.at> 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-06Martin Langhoff has a new e-mail addressJunio C Hamano
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-06-21Merge branch 'eb/core-eol'Junio C Hamano
* eb/core-eol: Add "core.eol" config variable Rename the "crlf" attribute "text" Add per-repository eol normalization Add tests for per-repository eol normalization Conflicts: Documentation/config.txt Makefile
2010-06-21git-cvsserver: fix error for invalid password formatsÆvar Arnfjörð Bjarmason
Change the error message to report the erroneous password character. $1 was never set in the previos version, it was a leftover from older code that used a regex for the test. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-21git-cvsserver: typo in a comment: bas -> hasÆvar Arnfjörð Bjarmason
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20git-cvsserver: Improved error handling for pserverÆvar Arnfjörð Bjarmason
- Produce an error if the user tries to supply a password for anonymous - Clarify the error message produced when there's no [gitcvs.authdb] - Produce an E error if the authdb doesn't exist instead of spewing $! to the user - do crypt($user, descramble($pass)) eq $hash; crypt($user, $hash) eq $hash would accept any password Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20git-cvsserver: indent & clean up authdb codeÆvar Arnfjörð Bjarmason
- Indent the last commit to fit with the rest of the code. - Use lexical filehandles instead of global globs - Close the filehandle after the password database has been read. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20git-cvsserver: use a password file cvsserver pserverSam Vilain
If a git repository is shared via HTTP, the config file is typically visible. Use an external file instead. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20git-cvsserver: authentication support for pserverÆvar Arnfjörð Bjarmason
Allow git-cvsserver to use authentication over pserver mode. The pserver user/password database is stored in the config file for each repository. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Worriedly-Acked-by: Martin Langhoff <martin.langhoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-05-20Rename the "crlf" attribute "text"Eyvind Bernhardsen
As discussed on the list, "crlf" is not an optimal name. Linus suggested "text", which is much better. Signed-off-by: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-28Merge branch 'gp/maint-cvsserver'Junio C Hamano
* gp/maint-cvsserver: git-cvsserver: allow regex metacharacters in CVSROOT
2010-01-26git-cvsserver: allow regex metacharacters in CVSROOTGerrit Pape
When run in a repository with a path name containing regex metacharacters (e.g. +), git-cvsserver failed to split the client request into CVSROOT and module. Now metacharacters are disabled for the value of CVSROOT in the perl regex so that directory names containing metacharacters are handled properly. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-10Merge branch 'pm/cvs-environ'Junio C Hamano
* pm/cvs-environ: CVS Server: Support reading base and roots from environment
2009-12-31cvsserver: make the output of 'update' more compatible with cvs.Sergei Organov
Native cvs update outputs the string "cvs update: Updating <DIR>" for every directory it processes (to stderr) unless -q or -Q is given on comman-line. This is used, e.g., by emacs pcl-cvs to split files by directory. This commit implements this feature in cvsserver. Signed-off-by: Sergei Organov <osv@javad.com> Acked-by: Martin Langhoff <martin.langhoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-30CVS Server: Support reading base and roots from environmentPhil Miller
The Gitosis single-account Git/ssh hosting system runs git commands through git-shell after confirming that the connecting user is authorized to access the requested repository. This works well for upload-pack and receive-pack, which take a repository argument through git-shell. This doesn't work so well for `cvs server', which is passed through literally, with no arguments. Allowing arguments risks sneaking in `--export-all', so that restriction should be maintained. Despite that, passing a repository root is necessary for per-user access control by the hosting software, and passing a base path improves usability without weakening security. Thus, git-cvsserver needs to come up with these values at runtime by some other means. Since git-shell preserves the environment for other purposes, the environment can carry these arguments as well. Thus, modify git-cvsserver to read $GIT_CVSSERVER_{BASE_PATH,ROOT} in the absence of equivalent command line arguments. Signed-off-by: Phil Miller <mille121@illinois.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-03git-cvsserver: no longer use deprecated 'git-subcommand' commandsGerrit Pape
git-cvsserver still references git commands like 'git-config', which is depcrecated. This commit changes git-cvsserver to use the 'git subcommand' form. Sylvain Beucler reported the problem through http://bugs.debian.org/536067 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31git-cvsserver: run post-update hook *after* update.Stefan Karpinski
CVS server was running the hook before the update action was actually done. This performs the update before the hook is called. The original commit that introduced the current incorrect behavior was 394d66d "git-cvsserver runs hooks/post-update". The error in ordering of the hook call appears to have gone unnoticed, but since git-cvsserver is supposed to emulate receive-pack, it stands to reason that the hook should be run *after* the update. Since this behavior is inconsistent with recieve-pack, users are either: 1) not using post-update hooks with git-cvsserver; 2) using post-update hooks that don't care whether they are called before or after the actual update occurs; 3) using post-update hooks *only* with git-cvsserver, and relying on the hook being called just before the update. This patch would affect only users in case 3. These users are depending on fairly obviously wrong behavior, and moreover they can simply change their current post-update into post-recieve hooks, and their systems will work correctly again. Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31git-cvsserver: handle CVS 'noop' command.Stefan Karpinski
The CVS protocol documentation, found at http://www.wandisco.com/techpubs/cvs-protocol.pdf states the following about the 'noop' command: Response expected: yes. This request is a null command in the sense that it doesn't do anything, but merely (as with any other requests expecting a response) sends back any responses pertaining to pending errors, pending Notified responses, etc. In accordance with this, the correct way to handle the 'noop' command, when issued by a client, is to call req_EMPTY. The 'noop' command is called by some CVS clients, notably TortoiseCVS, thus making it desirable for git-cvsserver to respond to the command rather than choking on it as unknown. Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05cvsserver: change generation of CVS author namesFabian Emmes
CVS username is generated from local part email address. We take the whole local part but restrict the character set to the Portable Filename Character Set, which is used for Unix login names according to Single Unix Specification v3. This will obviously report different usernames from existing repositories for commits with the local part of the author e-mail address that contains characters outside the PFCS. Hopefully this won't break an old CVS checkout from an earlier version of git-cvsserver, because the names are always shown afresh to the CVS clients and not kept on the client side. Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de> Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-03cvsserver: add option to configure commit messageFabian Emmes
cvsserver annotates each commit message by "via git-CVS emulator". This is made configurable via gitcvs.commitmsgannotation. Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de> Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19cvsserver: Add cvs co -c supportLars Noschinski
Implement cvs checkout's -c option by returning a list of all "modules". This is more useful than displaying a perl warning if -c is given. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19cvsserver: Add support for packed refsLars Noschinski
req_update still parses /refs/heads manually. Replace this by a call to show-ref. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-17Merge branch 'sb/dashless'Junio C Hamano
* 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-16git-cvsserver: fix call to nonexistant cleanupWorkDir()Lars Noschinski
git-cvsserver.perl contained a single call to a nonexistant function cleanupWorkDir(). This was obviously a typo for cleanupWorkTree(). Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>