From: Jakub Narebski <jnareb@gmail.com>
To: Subho Banerjee <subs.zero@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: GSoC Application [ Parallelism + Git.pm ]
Date: Thu, 22 Mar 2012 14:33:03 +0100 [thread overview]
Message-ID: <201203221433.03616.jnareb@gmail.com> (raw)
In-Reply-To: <CAB3zAY0atsiXkBDxaRkC+WGzQUSOYgTnRZmOXdqKiXRw_DKkjQ@mail.gmail.com>
On Wed, 21 Mar 2012, Subho Banerjee wrote:
> I had some time to look through the perl module in the Git sources and
> I wanted to summarize the changes that need to be made -
>
> [Primary Task]
> [1] Move exception handling from Error::Simple to Try::Tiny and Exception::Class
Well, that is not as much "primary task" as "minimal scope"...
We have also decide if we want to keep compatibility layer, including
git_cmd_try. Git commands in Perl can be rewriten to using Try::Tiny
directly, but I wonder if there are out of tree Perl scripts and modules
that use Git module, and would be broken by not preserving backward
compatibility.
Another issue of note is whether we want to have all non-core Git.pm
prerequisites included like private-Error.pm (though I think in 'inc/'
or something).
> [Additional]
> [2] A Git::Config module that parses the .gitconfig file and the
> .git/config file in each repository (Is it one of these files or both?)
I don't think parsing git config file format in Perl is a good idea.
What I had in mind was to use `git config -l -z` output, reading all
configuration at once with a single git command.
Note that this would require converting to specific types, like e.g.
turning true values of git config (e.g. string "true") into Perl
true (1). The --int, --bool, --bool-or-int and --path should be easy;
the problem could be with --get-colorbool and --get-color.
Optionally (if possible) make it so Git / Git::Repo object uses either
one "git config --get <key>" for each $git->config(<key>) request, or
cached values from single "git config -l -z" via Git::Config, depending
on constructor options ('lazy_config' => 1). Then we could fall back
to one command for one access for unknown types...
> [3] Parsing Tree and Commit objects and then traverse the tree
> structure in Perl through a Git::Commit module.
'commit', 'tag' and 'tree', and parsing and formatting ident fields.
Note that there is a difference between 'raw' output format ("git cat-file"),
and e.g. "git ls-tree" for 'tree' objects.
If by 'traverse the tree structure in Perl through a Git::Commit module.'
you mean traversing DAG of revisions, then I think it is out of scope.
And there is also matter of parsing diff output (raw/tree, numstat,
patchset).
> [4] Cleaning-up improving the API.
> In general move towards an module that can access and change data in
> the configuration and commit status using Perl instead of the fork and
> IPC being used now.
Yes, so that most if not all operations can be done on the level of Git.pm
methods or subroutines, and not having to invoke git commands and parse
their output by hand.
This probably needs to be done by examining what git commands in Perl
need.
> Is this what you expect as a part of the GSoC work? Could you please
> tell me if I am missing something.
Another task could be CPAN-ification of Git.pm. This _could_ include
creating a separate repository for Git.pm (with all thats entailed),
and subtree-mergeing it into git.git like git-gui and gitk are.
Yet another task could be making all git commands in Perl use Git.pm
(well, at least those actively maintained).
Perhaps also cleaning those Perl::Critic warnings that make sense.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2012-03-22 13:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-18 7:36 GSoC Application [ Parallelism + Git.pm ] Subho Banerjee
2012-03-18 16:31 ` Jakub Narebski
2012-03-21 18:52 ` Subho Banerjee
2012-03-22 13:33 ` Jakub Narebski [this message]
2012-03-21 12:47 ` Thomas Rast
2012-03-21 13:53 ` Subho Banerjee
2012-03-21 14:10 ` Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201203221433.03616.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=subs.zero@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).