git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Taht <mike.taht@timesys.com>
To: Brad Roberts <braddr@puremagic.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] libgit
Date: Sun, 17 Apr 2005 01:08:51 -0700	[thread overview]
Message-ID: <42621993.10800@timesys.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0504170027500.2625-100000@bellevue.puremagic.com>

Brad Roberts wrote:
>>Converted git to libgit. Moved all the main() calls into a single
>>multi-call binary - git-main.
>>Made extern a bunch of functions that were static. Verified it at least
>>still minimally worked.
>>Note: this is only a first step towards creating a generic library.
>>Figuring out what functions and variables *truly* need to be exported,
>>renaming them to a git_<function> api, making it thread safe
>>... and not least of all, keeping up with everybody working out of the
>>base tree... are problems that remain. Also - cleaning up the UI.
> 
> 
> Why do all that static and main rearrangement?  It would be a lot simpler
> and cleaner to simply rename the main's in place and add the new
> dispatcher by itself.

0) I like multi-call binaries.

1) I wanted to get a first pass at what functions needed to be exported, 
and pulling out the mains was the fastest way to see what might be  needed.

2) Agreed, about half of git-main.c needs to move back into the 
libraries, but that depends on deciding on the API for the formentioned 
functions... and leaving the mains parsing argv in the library itself 
seemed silly. So I moved them out. See 1)

In particular gotta chose the prefix itself git_<function> or 
cg_<_function> or cogito_<function>. I lean towards git_ myself - 
it'short and unique-looking, though I haven't verified that

When the useful to export functions are clearly identified they have to 
become named thus.

3) I'd really like to commonalize the UI and use longopts for the 
argument parsing. Linus indicated a preference for a certain argument 
order, longopts doesn't do that.

4) Like to make git thread safe (and ultimately, thread using - parallel 
diff, merge, fsck) and that means eliminating the globals, where 
appropriate. I've been thinking through the issues there (how about 
(GIT_THREAD)->some_variable and (GIT-GLOBAL)->some_variable where those 
define out when threads are disabled? Etc. There needs to be a git_init 
that does things like correctly and universally setting up the defaults, 
and atexit, etc, file locking needs to fixed...

5) I wanted to get something that still compiled, worked, and out for 
comment before I went to bed. :)

my current plan is to break out git.h back into it's subject 
"update-cache.h" etc, move all that into include/git, turn git.h into a 
master lazy man's include, come up with a scheme for the globals, get 
some sort of thread cleanliness and take a crack at making it shared.

and now to bed. All: Feel free to implement any of that....

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


-- 

Mike Taht


   "If you wait long enough, it will go away... after having done its 
damage.
If it was bad, it will be back."

  reply	other threads:[~2005-04-17  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17  7:30 [PATCH] libgit Brad Roberts
2005-04-17  8:08 ` Mike Taht [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-17  3:12 Mike Taht
2005-04-17  3:46 ` Randy.Dunlap
2005-04-17  4:08   ` Mike Taht

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=42621993.10800@timesys.com \
    --to=mike.taht@timesys.com \
    --cc=braddr@puremagic.com \
    --cc=git@vger.kernel.org \
    /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).