Re: start of git2 (based on libgit2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Sat, Mar 26, 2011 at 12:54:25AM +0100, Vincent van Ravesteijn wrote:
>> 
>> I guess a lot can be copied from Git itself. Actually
>> builtin/rev-list.c consists mostly of command line arguments parsing
>> methods, and outputting functions. The key is to parse what you want
>> to know and ask libgit2 to provide the info. If libgit2 has
>> implemented the basic functionality that is needed, the rest would be
>> relatively simple.
>
> I wouldn't worry about having _every_ argument. Some arguments are much
> less frequently used than others. For example, start with basic stuff,
> like including and excluding commits (e.g., "branch1 ^branch2"),
> --max-count, --{min,max}-age, --grep, and others. Do common things like
> path limiting. And then once all that is done and tested, start worrying
> about things like --cherry-pick (or maybe not, and focus on the basics
> of other simple commands).

I agree that for a summer student project, aiming at basic stuff makes
more sense than trying to chew a large bite that cannot be managed within
the timeframe and not achieving anything.

"A..B" requires you to walk the ancestry chain. Limiting history with
pathspec while simplifying merges needs to use the tree-diff machinery;
and filtering commits by looking at the message with "--grep" needs to
call into the grep machinery.  Depending on how much libgit2 has already
covered the basic blocks, even the above list might be too much, I am
afraid.

A good news is that among the larger and more important basic building
blocks in C git, there is only one part that was designed from day one to
disregard the reusability and instead aimed for speed and simplicity, and
that is the history and object walking. The way the in-core object pool is
managed and especially the way per-object flags are designed to be used
clearly show that the revision walker machinery can take it granted that
the calling programs are run-once-and-clean-via-exit.

But other major parts are designed to be reusable and I would imagine that
it shouldn't be hard to link with them (or better yet, find counterparts
in libgit2). "diff" machinery below the diffcore layer (i.e. the entry
points "diff-lib.c" calls into, e.g. starting at diff_addremove(), then
running the diffcore machinery with diffcore_std() and finally getting the
result from diff_flush() callchain) and "grep" machinery below the
"grep.c" (but not "builtin/grep.c") are designed not to depend on the
process level global variables.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]