Git.pm: Implement Git::version()
Git::version() returns the Git version string. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Petr Baudis committed
Jun 24, 2006 at 04:34 UTC
63df97ae7baeedc3ce04995139fa0f6bc5eea76c
3 files changed
+27
-2
Makefile
+4
-1
@@ -610,7 +610,10 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
610
611
612
perl/Makefile: perl/Git.pm perl/Makefile.PL
613
- (cd perl && $(PERL_PATH) Makefile.PL PREFIX="$(prefix)" DEFINE="$(ALL_CFLAGS)" LIBS="$(LIBS)")
613
+ (cd perl && $(PERL_PATH) Makefile.PL \
614
+ PREFIX="$(prefix)" \
615
+ DEFINE="$(ALL_CFLAGS) -DGIT_VERSION=\\\"$(GIT_VERSION)\\\"" \
616
+ LIBS="$(LIBS)")
617
618
doc:
619
$(MAKE) -C Documentation all
perl/Git.pm
+13
-1
@@ -48,7 +48,7 @@ require Exporter;
48
49
# Methods which can be called as standalone functions as well:
50
@EXPORT_OK = qw(command command_oneline command_pipe command_noisy
51
- exec_path hash_object);
51
+ version exec_path hash_object);
52
53
54
=head1 DESCRIPTION
@@ -285,6 +285,18 @@ sub command_noisy {
285
}
286
287
288
+=item version ()
289
+
290
+Return the Git version in use.
291
+
292
+Implementation of this function is very fast; no external command calls
293
+are involved.
294
+
295
+=cut
296
+
297
+# Implemented in Git.xs.
298
+
299
+
300
=item exec_path ()
301
302
Return path to the git sub-command executables (the same as
perl/Git.xs
+10
@@ -23,6 +23,16 @@ PROTOTYPES: DISABLE
23
# /* TODO: xs_call_gate(). See Git.pm. */
24
25
26
+const char *
27
+xs_version()
28
+CODE:
29
+{
30
+ RETVAL = GIT_VERSION;
31
+}
32
+OUTPUT:
33
+ RETVAL
34
+
35
+
36
const char *
37
xs_exec_path()
38
CODE: