Skip to content

Commit

Permalink
Git.pm: Implement Git::version()
Browse files Browse the repository at this point in the history
Git::version() returns the Git version string.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Jul 3, 2006
1 parent 8062f81 commit 63df97a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,10 @@ $(XDIFF_LIB): $(XDIFF_OBJS)


perl/Makefile: perl/Git.pm perl/Makefile.PL
(cd perl && $(PERL_PATH) Makefile.PL PREFIX="$(prefix)" DEFINE="$(ALL_CFLAGS)" LIBS="$(LIBS)")
(cd perl && $(PERL_PATH) Makefile.PL \
PREFIX="$(prefix)" \
DEFINE="$(ALL_CFLAGS) -DGIT_VERSION=\\\"$(GIT_VERSION)\\\"" \
LIBS="$(LIBS)")

doc:
$(MAKE) -C Documentation all
Expand Down
14 changes: 13 additions & 1 deletion perl/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require Exporter;

# Methods which can be called as standalone functions as well:
@EXPORT_OK = qw(command command_oneline command_pipe command_noisy
exec_path hash_object);
version exec_path hash_object);


=head1 DESCRIPTION
Expand Down Expand Up @@ -285,6 +285,18 @@ sub command_noisy {
}


=item version ()
Return the Git version in use.
Implementation of this function is very fast; no external command calls
are involved.
=cut

# Implemented in Git.xs.


=item exec_path ()
Return path to the git sub-command executables (the same as
Expand Down
10 changes: 10 additions & 0 deletions perl/Git.xs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ PROTOTYPES: DISABLE
# /* TODO: xs_call_gate(). See Git.pm. */


const char *
xs_version()
CODE:
{
RETVAL = GIT_VERSION;
}
OUTPUT:
RETVAL


const char *
xs_exec_path()
CODE:
Expand Down

0 comments on commit 63df97a

Please sign in to comment.