git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH] Git.pm: discourage casual use

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 2, 2010, 19:05 UTC
Message-ID
<20101202190546.GI3962@burratino>
In-Reply-To
<AANLkTimKKssBbtuLKCqG9WGbOe+-CH4pc5PDaNxCH_PS@mail.gmail.com>

Git's internal perl interface still does not have a stable API, and meanwhile CPAN has a number of modules to fulfill the need for a perl git interface. The line

	# Totally unstable API.
	$VERSION = '0.01';

in the source makes this clear enough, but users who just looked at git-svn.perl and then tried "perldoc Git" would not notice. Add a note to the manual to warn the reader.

Inspired-by: Yves Orton <demerphq@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
demerphq wrote:
Show 7 quoted lines
> And well the line:
> 
> # Totally unstable API.
> $VERSION = '0.01';
> 
> STRONGLY suggests that the module should not be used by code outside
> the Git package itself.
So how about something like this patch, to start?
diff --git a/perl/Git.pm b/perl/Git.pm
index 6cb0dd1..7f6c500 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -63,12 +63,16 @@ require Exporter;
 
 =head1 DESCRIPTION
 
-This module provides Perl scripts easy way to interface the Git version control
-system. The modules have an easy and well-tested way to call arbitrary Git
+This module provides an easy way to interact with the Git version control
+system for Git's internal perl scripts.
+The modules have an easy and well-tested way to call arbitrary Git
 commands; in the future, the interface will also provide specialized methods
 for doing easily operations which are not totally trivial to do over
 the generic command interface.
 
+Note: this module should not be used by code outside the Git package itself,
+since the API is not stable yet.
+
 While some commands can be executed outside of any context (e.g. 'version'
 or 'init'), most operations require a repository context, which in practice
 means getting an instance of the Git object using the repository() constructor.
Previous: demerphqNext: Junio C Hamano
Message 9 of 19 in “Problems using perl's Git.pm module”
  1. Josef WolfDec 2, 2010
  2. Ævar Arnfjörð BjarmasonDec 2, 2010
  3. Jonathan NiederDec 2, 2010
  4. Ævar Arnfjörð BjarmasonDec 2, 2010
  5. Junio C HamanoDec 2, 2010
  6. demerphqDec 2, 2010
  7. Jonathan NiederDec 2, 2010
  8. demerphqDec 2, 2010
  9. Git.pm: discourage casual useJonathan Nieder, Dec 2, 2010
  10. Junio C HamanoDec 2, 2010
  11. Jonathan NiederDec 2, 2010
  12. Josef WolfDec 3, 2010
  13. demerphqDec 3, 2010
  14. Junio C HamanoDec 2, 2010
  15. demerphqDec 2, 2010
  16. Josef WolfDec 3, 2010
  17. Jonathan NiederDec 3, 2010
  18. Junio C HamanoDec 2, 2010
  19. Josef WolfDec 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.