summaryrefslogtreecommitdiff
path: root/perl
Commit message (Collapse)AuthorAgeFilesLines
* perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIRBrandon Casey2009-09-251-0/+8
| | | | | | | | | | It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* pay attention to DESTDIR when building with NO_PERL_MAKEMAKERJunio C Hamano2009-09-221-4/+4
| | | | | | | | | | | | | | | | Building with prefix=/some/where and temporarily installing it to elsewhere for tar'ing up is done with: make prefix=/some/where make prefix=/some/where DESTDIR=/else/where install Make handcrafted perl/perl.mak without NO_PERL_MAKEMAKER honour DESTDIR. Ancient ExtUtils::MakeMaker (pre 6.11?) has the same issue, but recent versions of Perl ships with at leat 6.17; this patch does not address that issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Always set Repository to absolute path if autodetectingFrank Lichtenheld2009-05-091-1/+1
| | | | | | | | | So far we only set it to absolute paths in some cases which lead to problems like wc_chdir not working. Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld2009-05-091-0/+2
| | | | | | | | | | Otherwise git will use the current directory as work tree which will lead to unexpected results if we operate in sub directory of the work tree. Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add --html-path to get the location of installed HTML docsMarkus Heidelberg2009-04-041-1/+11
| | | | | | | | This can be used in GUIs to open installed HTML documentation in the browser. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2009-01-131-2/+2
|\ | | | | | | | | | | * maint: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
| * Merge branch 'maint-1.6.0' into maintJunio C Hamano2009-01-131-2/+2
| |\ | | | | | | | | | | | | | | | * maint-1.6.0: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
| | * Git.pm: call Error::Simple() properlyJay Soffian2009-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | The error message to Error::Simple() must be passed as a single argument. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Git.pm: correctly handle directory name that evaluates to "false"Philippe Bruhat (BooK)2009-01-011-3/+4
|/ / | | | | | | | | | | | | The repository constructor mistakenly rewrote a Directory parameter that Perl happens to evaluate to false (e.g. "0") to ".". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Always show which directory is not a git repositoryRichard Hartmann2008-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | Unify all fatal: Not a git repository error messages so they include path information. Signed-off-by: Richard Hartmann <richih@net.in.tum.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Git.pm: Make _temp_cache use the repository directoryMarten Svanfeldt (dev)2008-11-131-5/+10
|/ | | | | | | | | | | | | | | | Update the usage of File::Temp->tempfile to place the temporary files within the repository directory instead of just letting Perl decide what directory to use, given there is a repository specified when requesting the temporary file. This is needed to be able to fix git-svn on msys as msysperl generates paths with UNIX-style paths (/tmp/xxx) while the git tools expect natvie path format (c:/..). The repository dir is stored in native format so by using it as the base directory for temporary files we always get a usable native full path. Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* Git.pm: do not break inheritanceChristian Jaeger2008-10-191-2/+1
| | | | | | | Make it possible to write subclasses of Git.pm Signed-off-by: Christian Jaeger <christian@jaeger.mine.nu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Use File::Temp->tempfile instead of ->newMarcus Griep2008-09-101-12/+30
| | | | | | | | | | | | | 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>
* Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep2008-08-161-2/+7
| | | | | | | | | This will ensure that the API at large is accessible to nearly all Perl versions, while only the temp file caching API is tied to the File::Temp and File::Spec modules being available. Signed-off-by: Marcus Griep <marcus@griep.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Add faculties to allow temp files to be cachedMarcus Griep2008-08-121-2/+123
| | | | | | | | | | | | | | | | This patch offers a generic interface to allow temp files to be cached while using an instance of the 'Git' package. If many temp files are created and destroyed during the execution of a program, this caching mechanism can help reduce the amount of files created and destroyed by the filesystem. The temp_acquire method provides a weak guarantee that a temp file will not be stolen by subsequent requests. If a file is locked when another acquire request is made, a simple error is thrown. Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Eric Wong <normalperson@yhbt.net>
* perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER sectionBrandon Casey2008-08-061-4/+4
| | | | | | | Use double quotes to protect against paths which may contain spaces. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix typo in perl/Git.pmAbhijit Menon-Sen2008-08-041-1/+1
| | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix hash slice syntax errorAbhijit Menon-Sen2008-08-041-4/+4
| | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: localise $? in command_close_bidi_pipe()Abhijit Menon-Sen2008-08-041-0/+1
| | | | | | | | | | | | | | Git::DESTROY calls _close_cat_blob and _close_hash_and_insert_object, which in turn call command_close_bidi_pipe, which calls waitpid, which alters $?. If this happens during global destruction, it may alter the program's exit status unexpectedly. Making $? local to the function solves the problem. (The problem was discovered due to a failure of test #8 in t9106-git-svn-commit-diff-clobber.sh.) Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Replace uses of "git-var" with "git var"Todd Zullinger2008-07-301-1/+1
| | | | | Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* perl/Makefile: update NO_PERL_MAKEMAKER sectionBrandon Casey2008-07-251-4/+9
| | | | | | | | The perl modules must be copied to blib/lib so they are available for testing. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Add remote_refs() git-ls-remote frontendPetr Baudis2008-07-081-1/+55
| | | | | | | | | | | | | | | | | | | | This patch also converts the good ole' git-remote.perl to use it. It is otherwise used in the repo.or.cz machinery and I guess other scripts might find it useful too. Unfortunately, git-ls-remote --heads . is subtly different from git-ls-remote . refs/heads/ (since the second matches anywhere in the string, not just at the beginning) so we have to provide interface for both. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: fix return value of config methodLea Wiemann2008-06-011-1/+1
| | | | | | | | | | | If config is called in array context, it is supposed to return all values set for the given option key. This works for all cases except if there is no value set at all. In that case, it wrongly returns (undef) instead of (). This fixes the return statement so that it returns undef in scalar context but an empty array in array context. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: fix documentation of hash_objectLea Wiemann2008-06-011-3/+2
| | | | | | | | | The documentation of hash_object incorrectly states that it accepts a file handle -- in fact it doesn't, and there is even a TODO comment for this. This fixes the documentation. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git::cat_blob: allow using an empty blob to fix git-svn breakageJunio C Hamano2008-05-271-2/+2
| | | | | | | | | | | | | Recent "git-svn optimization" series introduced Git::cat_blob() subroutine whose interface was broken in that it returned the size of the blob but signalled an error by returning 0. You can never use an empty blob with such an interface. This fixes the interface to return a negative value to signal an error. Reported by Björn Steinbrink. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Add hash_and_insert_object and cat_blobAdam Roben2008-05-231-2/+150
| | | | | | | | These functions are more efficient ways of executing `git hash-object -w` and `git cat-file blob` when you are dealing with many files/objects. Signed-off-by: Adam Roben <aroben@apple.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Add command_bidi_pipe and command_close_bidi_pipeAdam Roben2008-05-231-0/+56
| | | | | | | | | command_bidi_pipe hands back the stdin and stdout file handles from the executed command. command_close_bidi_pipe closes these handles and terminates the process. Signed-off-by: Adam Roben <aroben@apple.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Don't require repository instance for identFrank Lichtenheld2008-03-151-6/+6
| | | | | | | | git var doesn't require to be called in a repository anymore, so don't require it either. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: Don't require a repository instance for configFrank Lichtenheld2008-03-151-20/+13
| | | | | | | | git config itself doesn't require to be called in a repository, so don't add arbitrary restrictions. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Don't cache DESTDIR in perl/perl.mak.Gerrit Pape2007-12-111-5/+1
| | | | | | | | | DESTDIR is supposed to be overridden on 'make install' after doing 'make'. Have the automatically generated perl/perl.mak not cache the value of DESTDIR to support that for the perl/ subdirectory also. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Color support for "git-add -i"Junio C Hamano2007-12-051-0/+35
| | | | | | | | | | | | | | | | | | | This is mostly lifted from earlier series by Dan Zwell, but updated to use "git config --get-color" and "git config --get-colorbool" to make it simpler and more consistent with commands written in C. A new configuration color.interactive variable is like color.diff and color.status, and controls if "git-add -i" uses color. A set of configuration variables, color.interactive.<slot>, are used to define what color is used for the prompt, header, and help text. For perl scripts, Git.pm provides $repo->get_color() method, which takes the slot name and the default color, and returns the terminal escape sequence to color the output text. $repo->get_colorbool() method can be used to check if color is set to be used for a given operation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add config_int() method to the Git perl moduleJakub Narebski2007-11-301-0/+31
| | | | | | | | | Integer variables can have optional 'k', 'm' or 'g' suffix. config_int() method will return simple decimal number, taking care of those suffixes. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* When exec() fails include the failing command in the error messageAsk Bjørn Hansen2007-11-071-1/+1
| | | | | | | git-svn occasionally fails with no details as to what went wrong - this should help debug those situations. Signed-off-by: Ask Bjørn Hansen <ask@develooper.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Install man3 manpages to $PREFIX/share/man/man3 even for site installsmartin f. krafft2007-08-231-0/+1
| | | | | | | | | | | MakeMaker supports three installation modes: perl, site, and vendor. The first and third install manpages to $PREFIX/share/man, only site installs to $PREFIX/man. For consistency with the rest of git, which does not make the distinction and writes all manpages to $PREFIX/share/man, this change makes sure that perl does too, even when it's installed in site mode. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix git-remote for ActiveState PerlAlex Riesen2007-08-221-1/+7
| | | | | | | | | | For reason unknown a package in ActiveState Perl 5.8.7 must implement READLINE method differently for scalar and array context. The code tested to work for more sane and recent version of perl (5.8.8 shipped with Ubuntu), so maybe it was always a requirement. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* War on whitespaceJunio C Hamano2007-06-071-1/+0
| | | | | | | | | 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>
* Git.pm: config_boolean() -> config_bool()Petr Baudis2007-05-101-4/+8
| | | | | | | | | This patch renames config_boolean() to config_bool() for consistency with the commandline interface and because it is shorter but still obvious. ;-) It also changes the return value from some obscure string to real Perl boolean, allowing for clean user code. Signed-off-by: Petr Baudis <pasky@suse.cz>
* Allow PERL_PATH="/usr/bin/env perl"Bryan Larsen2007-05-031-1/+1
| | | | | | | | | | | | | There is a mechanism PERL_PATH in the Makefile to specify path to Perl binary, but sometimes it is convenient to let 'env' figure out where Perl comes from, with PERL_PATH="/usr/bin/env perl". Allowing this would make things easier to MacPorts, where we wish to work with the MacPorts perl if it is installed, but fall back to the system perl if it isn't. Signed-off-by: Bryan Larsen <bryan@larsen.st> Signed-off-by: Junio C Hamano <junkio@cox.net>
* perl: install private Error.pm if the site version is older than our ownEric Wong2007-04-211-1/+1
| | | | | | | | | bdash (on IRC) had a problem with Git.pm (via git-svn) when his site installation of Error.pm was older than the version we package. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not output "GEN " when generating perl.makJohannes Schindelin2007-03-141-1/+1
| | | | | | | | | | | This fixes the same issue as 8bef6204, which became an issue again after 31d0399c. Besides, it is not really helpful to print just "GEN " (_without_ "perl.mak"). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* More build output cleaning upAlex Riesen2007-03-061-1/+1
| | | | | | | | | - print output file name for .c files - suppress output of the names of subdirectories when make changes into them - use GEN prefix for makefile generation in perl/ Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make 'make' quiet by defaultShawn O. Pearce2007-03-061-1/+1
| | | | | | | | | Per Junio's suggestion we are setting 'make' to be quiet by default, with `make V=1` available to force GNU make back to its default behavior of showing each command it is running. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make 'make' quieter while building gitShawn O. Pearce2007-03-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | I find it difficult to see compiler warnings amongst the massive spewing produced by GNU make as it works through our productions. This is especially true if CFLAGS winds up being rather long, due to a large number of -W options being enabled and due to a number of -D options being configured/required by my platform. By defining QUIET_MAKE (e.g. make QUIET_MAKE=YesPlease) during compilation users will get a less verbose output, such as: ... CC builtin-grep.c builtin-grep.c:187: warning: 'external_grep' defined but not used CC builtin-init-db.c CC builtin-log.c CC builtin-ls-files.c CC builtin-ls-tree.c ... The verbose (normal make) output is still the default. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add config_boolean() method to the Git perl moduleTheodore Ts'o2007-02-201-0/+30
| | | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Assorted typo fixesPavel Roskin2007-02-032-2/+2
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Rename git-repo-config to git-config.Tom Prince2007-01-281-4/+4
| | | | | Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Cleanup uninitialized value in chompAlex Riesen2007-01-221-1/+1
| | | | | | | | which happens if you use ActiveState Perl and a pipe workaround specially for it. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Force Activestate Perl to tie git command pipe handle to a handle classAlex Riesen2007-01-221-1/+7
| | | | | | | | | Otherwise it tries to tie it to a scalar and complains about missing method. Dunno why, may be ActiveState brokenness again. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Insert ACTIVESTATE_STRING in Git.pmAlex Riesen2007-01-221-3/+4
| | | | | | | | Also add "git" to the pipe parameters, otherwise it does not work at all, as no git commands are usable out of git context. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix spurious compile errorJohannes Schindelin2007-01-161-0/+4
| | | | | | | | | | | | | | | | | | | From time to time, I would get this error: [...] sed: -e expression #8, char 41: Unterminated `s' command make: *** [git-add--interactive] Error 1 Turns out that the function WriteMakefile() called in Makefile.PL outputs the message "Writing perl.mak for Git" to stdout! Thus, the output of "make -C perl -s --no-print-directory instlibdir" would be prefixed by that message whenever Makefile.PL was newer than perl.mak. This is fixed by redirecting stdout to stderr in Makefile.PL. Signed-off-by: Johannes E. Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>