aboutsummaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
Commit message (Collapse)AuthorAge
* typofix: assorted typofixes in comments, documentation and messagesLi Peng2016-05-06
| | | | | | | | | | | | | | | | | | | | | Many instances of duplicate words (e.g. "the the path") and a few typoes are fixed, originally in multiple patches. wildmatch: fix duplicate words of "the" t: fix duplicate words of "output" transport-helper: fix duplicate words of "read" Git.pm: fix duplicate words of "return" path: fix duplicate words of "look" pack-protocol.txt: fix duplicate words of "the" precompose-utf8: fix typo of "sequences" split-index: fix typo worktree.c: fix typo remote-ext: fix typo utf8: fix duplicate words of "the" git-cvsserver: fix duplicate words Signed-off-by: Li Peng <lip@dtdream.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-cvsserver.perl: fix typoGyuYong Jung2016-02-17
| | | | | Signed-off-by: GyuYong Jung <obliviscence@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ak/cvsserver-stabilize-use-of-hash-keys'Junio C Hamano2013-11-04
|\ | | | | | | | | * ak/cvsserver-stabilize-use-of-hash-keys: cvsserver: Determinize output to combat Perl 5.18 hash randomization
| * cvsserver: Determinize output to combat Perl 5.18 hash randomizationAnders Kaseorg2013-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'jc/cvsserver-perm-bit-fix'Junio C Hamano2013-09-18
|\ \ | |/ | | | | | | | | | | | | "git cvsserver" computed the permission mode bits incorrectly for executable files. * jc/cvsserver-perm-bit-fix: cvsserver: pick up the right mode bits
| * cvsserver: pick up the right mode bitsJunio C Hamano2013-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | use 'tree-ish' instead of 'treeish'Richard Hansen2013-09-04
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Correct common spelling mistakes in comments and testsStefano Lattarini2013-04-12
| | | | | | | | | | | | | | | | | | 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>
* | git-cvsimport: use a lowercase "usage:" stringDavid Aguilar2013-02-24
|/ | | | | | | | 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>
* cvsserver: support -r and sticky tags for most operationsMatthew Ogilvie2012-10-16
| | | | | | | | | | | | | | | | | | | | | | | - 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>
* cvsserver: Add version awareness to argsfromdirMatthew Ogilvie2012-10-16
| | | | | Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsserver: generalize getmeta() to recognize commit refsMatthew Ogilvie2012-10-16
| | | | | | | | 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>
* cvsserver: implement req_Sticky and related utilitiesMatthew Ogilvie2012-10-16
| | | | | | | 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>
* cvsserver: add misc commit lookup, file meta data, and file listing functionsMatthew Ogilvie2012-10-16
| | | | | | | | | | | | 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>
* cvsserver: define a tag name character escape mechanismMatthew Ogilvie2012-10-16
| | | | | | | | | | | | 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>
* cvsserver: cleanup extra slashes in filename argumentsMatthew Ogilvie2012-10-16
| | | | | Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsserver: factor out git-log parsing logicMatthew Ogilvie2012-10-16
| | | | | | | | 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>
* cvsserver status: provide real sticky infoMatthew Ogilvie2012-10-16
| | | | | Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsserver: cvs add: do not expand directory argumentsMatthew Ogilvie2012-10-16
| | | | | | | | | | | 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>
* cvsserver: use whole CVS rev number in-process; don't strip "1." prefixMatthew Ogilvie2012-10-16
| | | | | | | | | | | | | | | | | 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>
* cvsserver: split up long lines in req_{status,diff,log}Matthew Ogilvie2012-10-16
| | | | | Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cvsserver: clean up client request handler map commentsMatthew Ogilvie2012-10-16
| | | | | | | | - 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>
* cvsserver: remove unused functions _headrev and gethistoryMatthew Ogilvie2012-10-16
| | | | | | | | | 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>
* cvsserver update: comment about how we shouldn't remove a user-modified fileMatthew Ogilvie2012-10-16
| | | | | | | 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>
* cvsserver: add comments about database schema/usageMatthew Ogilvie2012-10-16
| | | | | | | | 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>
* cvsserver: removed unused sha1Or-k mode from kopts_from_pathMatthew Ogilvie2012-10-16
| | | | | | | | | | | | 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>
* use -h for synopsis and --help for manpage consistentlyClemens Buchacher2011-10-05
| | | | | | | | | | | | 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>
* Merge branch 'ab/require-perl-5.8'Junio C Hamano2010-10-26
|\ | | | | | | | | | | * 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]
| * perl: bump the required Perl version to 5.8 from 5.6.[21]Ævar Arnfjörð Bjarmason2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Martin Langhoff has a new e-mail addressJunio C Hamano2010-10-06
|/ | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'eb/core-eol'Junio C Hamano2010-06-21
|\ | | | | | | | | | | | | | | | | | | | | | | * 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
| * Rename the "crlf" attribute "text"Eyvind Bernhardsen2010-05-19
| | | | | | | | | | | | | | | | 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>
* | git-cvsserver: fix error for invalid password formatsÆvar Arnfjörð Bjarmason2010-06-20
| | | | | | | | | | | | | | | | | | 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>
* | git-cvsserver: typo in a comment: bas -> hasÆvar Arnfjörð Bjarmason2010-06-20
| | | | | | | | | | Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-cvsserver: Improved error handling for pserverÆvar Arnfjörð Bjarmason2010-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | git-cvsserver: indent & clean up authdb codeÆvar Arnfjörð Bjarmason2010-05-19
| | | | | | | | | | | | | | | | | | | | | | - 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>
* | git-cvsserver: use a password file cvsserver pserverSam Vilain2010-05-19
| | | | | | | | | | | | | | | | 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>
* | git-cvsserver: authentication support for pserverÆvar Arnfjörð Bjarmason2010-05-19
|/ | | | | | | | | | 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>
* Merge branch 'gp/maint-cvsserver'Junio C Hamano2010-01-28
|\ | | | | | | | | * gp/maint-cvsserver: git-cvsserver: allow regex metacharacters in CVSROOT
| * git-cvsserver: allow regex metacharacters in CVSROOTGerrit Pape2010-01-26
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'pm/cvs-environ'Junio C Hamano2010-01-10
|\ \ | | | | | | | | | | | | * pm/cvs-environ: CVS Server: Support reading base and roots from environment
| * | CVS Server: Support reading base and roots from environmentPhil Miller2009-12-30
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | cvsserver: make the output of 'update' more compatible with cvs.Sergei Organov2009-12-31
|/ | | | | | | | | | | 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>
* git-cvsserver: no longer use deprecated 'git-subcommand' commandsGerrit Pape2009-09-02
| | | | | | | | | | | | 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>
* git-cvsserver: run post-update hook *after* update.Stefan Karpinski2009-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-cvsserver: handle CVS 'noop' command.Stefan Karpinski2009-01-30
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* cvsserver: change generation of CVS author namesFabian Emmes2009-01-05
| | | | | | | | | | | | | | | | | 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>
* cvsserver: add option to configure commit messageFabian Emmes2009-01-03
| | | | | | | | | 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>
* cvsserver: Add cvs co -c supportLars Noschinski2008-07-19
| | | | | | | | 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>
* cvsserver: Add support for packed refsLars Noschinski2008-07-19
| | | | | | | | 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>