Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/perl
AgeCommit message (Collapse)Author
2012-01-04Merge branch 'maint'Junio C Hamano
* maint: docs: describe behavior of relative submodule URLs fix hang in git fetch if pointed at a 0 length bundle Documentation: read-tree --prefix works with existing subtrees Add MYMETA.json to perl/.gitignore
2012-01-04Merge branch 'maint-1.7.7' into maintJunio C Hamano
* maint-1.7.7: docs: describe behavior of relative submodule URLs Documentation: read-tree --prefix works with existing subtrees Add MYMETA.json to perl/.gitignore
2011-12-30Add MYMETA.json to perl/.gitignoreJack Nagel
ExtUtils::MakeMaker generates MYMETA.json in addition to MYMETA.yml since version 6.57_07. As it suggests, it is just meta information about the build and is cleaned up with 'make clean', so it should be ignored. Signed-off-by: Jack Nagel <jacknagel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-20Merge branch 'ab/enable-i18n'Junio C Hamano
* ab/enable-i18n: i18n: add infrastructure for translating Git with gettext Conflicts: Makefile
2011-12-06i18n: add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason
Change the skeleton implementation of i18n in Git to one that can show localized strings to users for our C, Shell and Perl programs using either GNU libintl or the Solaris gettext implementation. This new internationalization support is enabled by default. If gettext isn't available, or if Git is compiled with NO_GETTEXT=YesPlease, Git falls back on its current behavior of showing interface messages in English. When using the autoconf script we'll auto-detect if the gettext libraries are installed and act appropriately. This change is somewhat large because as well as adding a C, Shell and Perl i18n interface we're adding a lot of tests for them, and for those tests to work we need a skeleton PO file to actually test translations. A minimal Icelandic translation is included for this purpose. Icelandic includes multi-byte characters which makes it easy to test various edge cases, and it's a language I happen to understand. The rest of the commit message goes into detail about various sub-parts of this commit. = Installation Gettext .mo files will be installed and looked for in the standard $(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to override that, but that's only intended to be used to test Git itself. = Perl Perl code that's to be localized should use the new Git::I18n module. It imports a __ function into the caller's package by default. Instead of using the high level Locale::TextDomain interface I've opted to use the low-level (equivalent to the C interface) Locale::Messages module, which Locale::TextDomain itself uses. Locale::TextDomain does a lot of redundant work we don't need, and some of it would potentially introduce bugs. It tries to set the $TEXTDOMAIN based on package of the caller, and has its own hardcoded paths where it'll search for messages. I found it easier just to completely avoid it rather than try to circumvent its behavior. In any case, this is an issue wholly internal Git::I18N. Its guts can be changed later if that's deemed necessary. See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for a further elaboration on this topic. = Shell Shell code that's to be localized should use the git-sh-i18n library. It's basically just a wrapper for the system's gettext.sh. If gettext.sh isn't available we'll fall back on gettext(1) if it's available. The latter is available without the former on Solaris, which has its own non-GNU gettext implementation. We also need to emulate eval_gettext() there. If neither are present we'll use a dumb printf(1) fall-through wrapper. = About libcharset.h and langinfo.h We use libcharset to query the character set of the current locale if it's available. I.e. we'll use it instead of nl_langinfo if HAVE_LIBCHARSET_H is set. The GNU gettext manual recommends using langinfo.h's nl_langinfo(CODESET) to acquire the current character set, but on systems that have libcharset.h's locale_charset() using the latter is either saner, or the only option on those systems. GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either, but MinGW and some others need to use libcharset.h's locale_charset() instead. =Credits This patch is based on work by Jeff Epler <jepler@unpythonic.net> who did the initial Makefile / C work, and a lot of comments from the Git mailing list, including Jonathan Nieder, Jakub Narebski, Johannes Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and others. [jc: squashed a small Makefile fix from Ramsay] Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-06Merge branch 'maint-1.7.7' into maintJunio C Hamano
* maint-1.7.7: stripspace: fix outdated comment Add MYMETA.yml to perl/.gitignore
2011-12-06Add MYMETA.yml to perl/.gitignoreSebastian Morr
This file is auto-generated by newer versions of ExtUtils::MakeMaker (presumably starting with the version shipping with Perl 5.14). It just contains extra information about the environment and arguments to the Makefile-building process, and should be ignored. Signed-off-by: Sebastian Morr <sebastian@morr.cc> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18libperl-git: refactor Git::config_*Junio C Hamano
Move common parts of Git::config(), Git::config_bool(), Git::config_int() and Git::config_path() into _config_common() helper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-09-30Add Git::config_path()Cord Seele
Use --path option when calling 'git config' thus allow for pathname expansion, e.g. a tilde. Signed-off-by: Cord Seele <cowose@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15perl: command_bidi_pipe() method should set-up git environmensMasatake Osanai
When command_input_pipe and command_output_pipe are used as a method of a Git::repository instance, they eventually call into _cmd_exec method that sets up the execution environment such as GIT_DIR, GIT_WORK_TREE environment variables and the current working directory in the child process that interacts with the repository. command_bidi_pipe however didn't expect to be called as such, and lacked all these set-up. Because of this, a program that did this did not work as expected: my $repo = Git->repository(Directory => '/some/where/else'); my ($pid, $in, $out, $ctx) = $repo->command_bidi_pipe(qw(hash-object -w --stdin-paths)); This patch refactors the _cmd_exec into _setup_git_cmd_env that sets up the execution environment, and makes _cmd_exec and command_bidi_pipe to use it. Note that unlike _cmd_exec that execv's a git command as an external process, command_bidi_pipe is called from the main line of control, and the execution environment needs to be restored after open2() does its magic. Signed-off-by: Masatake Osanai <unpush@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-08-13perl/Makefile: Unset INSTALL_BASE when making perl.makÆvar Arnfjörð Bjarmason
PREFIX and INSTALL_BASE are mutually exclusive. If both are supplied by INSTALL_BASE being set in PERL_MM_OPT ExtUtils::MakeMaker will produce an error: $ echo $PERL_MM_OPT INSTALL_BASE=/home/avar/perl5 $ make -C perl PERL_PATH='/usr/bin/perl' prefix='/home/avar' perl.mak make: Entering directory `/home/avar/g/git/perl' /usr/bin/perl Makefile.PL PREFIX='/home/avar' Only one of PREFIX or INSTALL_BASE can be given. Not both. make: *** [perl.mak] Error 255 make: Leaving directory `/home/avar/g/git/perl' Change the perl Makefile to work around this by explicitly unsetting INSTALL_BASE. INSTALL_BASE is set in PERL_MM_OPT by e.g. the popular local::lib package, from its documentation: eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib 2>/dev/null) Many other environments might also have set PERL_MM_OPT before building Git. This change enables us to build in these environments. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-18Git.pm: better error messagePhilippe Bruhat (BooK)
Provide the bad directory name alongside with $! Note: $! is set if there is "No such file or directory", but isn't set if the file exists but is not a directory. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-05git-svn: support fetch with autocrlf onErik Faye-Lund
Before commit d3c9634e, performing a "git svn rebase" that fetched a change containing CRLFs corrupted the git-svn meta-data. This was worked around in d3c9634e by setting core.autocrlf to "false" in the per-repo config when initing the clone. However, if the config variable was later changed, the corruption would still occur. This patch tries to fix it while allowing core.autocrlf to be enabled, by disabling filters when when hashing. git-svn is currently the only call-site for hash_and_insert_object (apart from the test-suite), so changing it should be safe. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-02-04Typofixes outside documentation areaJunio C Hamano
begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-26perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIRBrandon Casey
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>
2009-09-22pay attention to DESTDIR when building with NO_PERL_MAKEMAKERJunio C Hamano
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>
2009-05-09Git.pm: Always set Repository to absolute path if autodetectingFrank Lichtenheld
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>
2009-05-09Git.pm: Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld
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>
2009-04-05add --html-path to get the location of installed HTML docsMarkus Heidelberg
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>
2009-01-14Merge branch 'maint'Junio C Hamano
* maint: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-14Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-14Git.pm: call Error::Simple() properlyJay Soffian
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>
2009-01-01Git.pm: correctly handle directory name that evaluates to "false"Philippe Bruhat (BooK)
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>
2008-12-22Always show which directory is not a git repositoryRichard Hartmann
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>
2008-11-14Git.pm: Make _temp_cache use the repository directoryMarten Svanfeldt (dev)
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>
2008-10-20Git.pm: do not break inheritanceChristian Jaeger
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>
2008-09-10Git.pm: Use File::Temp->tempfile instead of ->newMarcus Griep
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-08-16Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep
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>
2008-08-13Git.pm: Add faculties to allow temp files to be cachedMarcus Griep
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>
2008-08-07perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER sectionBrandon Casey
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>
2008-08-05Fix typo in perl/Git.pmAbhijit Menon-Sen
Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-05Fix hash slice syntax errorAbhijit Menon-Sen
Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-05Git.pm: localise $? in command_close_bidi_pipe()Abhijit Menon-Sen
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>
2008-07-30Replace uses of "git-var" with "git var"Todd Zullinger
Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25perl/Makefile: update NO_PERL_MAKEMAKER sectionBrandon Casey
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>
2008-07-09Git.pm: Add remote_refs() git-ls-remote frontendPetr Baudis
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>
2008-06-02Git.pm: fix return value of config methodLea Wiemann
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>
2008-06-02Git.pm: fix documentation of hash_objectLea Wiemann
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>
2008-05-28Git::cat_blob: allow using an empty blob to fix git-svn breakageJunio C Hamano
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>
2008-05-23Git.pm: Add hash_and_insert_object and cat_blobAdam Roben
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>
2008-05-23Git.pm: Add command_bidi_pipe and command_close_bidi_pipeAdam Roben
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>
2008-03-15Git.pm: Don't require repository instance for identFrank Lichtenheld
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>
2008-03-15Git.pm: Don't require a repository instance for configFrank Lichtenheld
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>
2007-12-11Don't cache DESTDIR in perl/perl.mak.Gerrit Pape
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>
2007-12-06Color support for "git-add -i"Junio C Hamano
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>
2007-12-01Add config_int() method to the Git perl moduleJakub Narebski
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>
2007-11-07When exec() fails include the failing command in the error messageAsk Bjørn Hansen
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>
2007-08-23Install man3 manpages to $PREFIX/share/man/man3 even for site installsmartin f. krafft
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>
2007-08-23Fix git-remote for ActiveState PerlAlex Riesen
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>