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

Re: Darcs-git: a few notes for Git hackers

From
BRBrad Roberts <braddr@puremagic.com>
Date
May 10, 2005, 12:55 UTC
Message-ID
<Pine.LNX.4.44.0505100546010.2136-100000@bellevue.puremagic.com>
In-Reply-To
<Pine.LNX.4.44.0505091549210.2136-100000@bellevue.puremagic.com>
On Mon, 9 May 2005, Brad Roberts wrote:
Show 23 quoted lines
> Date: Mon, 9 May 2005 15:50:33 -0700 (PDT)
> From: Brad Roberts <braddr@puremagic.com>
> To: Petr Baudis <pasky@ucw.cz>
> Cc: Juliusz Chroboczek <Juliusz.Chroboczek@pps.jussieu.fr>,
>      Git Mailing List <git@vger.kernel.org>, darcs-devel@abridgegame.org
> Subject: Re: Darcs-git: a few notes for Git hackers
>
> > >  - there's no way to have multiple simultaneous caches, short of
> > >    hacking at the values of Git's global variables by hand.
> >
> > See the Brad Robert's patches of Apr 21. I've decided not to apply them
> > since it appears a lot has changed since then and it would be some pain;
> > but they may be a worthy starting point for a more up-to-date patch.
> >
> > --
> > 				Petr "Pasky" Baudis
>
> Since there's interest, I'll pull tip of your tree and re-do them.  I
> haven't bothered todate since no one seemed interested.  Do you want them
> piece meal like I did last time or just one big diff?
>
> Later,
> Brad

I wasn't able to finish redoing these against linus tip, but I got most of it done (patches 1-14 of the original 19):

  http://gameboy2.puremagic.com:8090/
  rsync://gameboy2.puremagic.com/git/

The second, third, and forth to last changes need a careful review, they're direct applications of the original patches which were lightly tested during the first round and nothing other than compile tested in this round.

I suspect the remaining parts of the original patch series will go in fairly smoothly. If no one gets to them before tonight I'll finish it up after work.

Later, Brad

The commit comments:
Signed-off-by: Brad Roberts <braddr@puremagic.com>
!-------------------------------------------------------------flip-
- remove the no-longer-true comment about the cache being in native byte order
- move the cache_header struct into read-cache.c since it's in internal detail
  of the cache, not a publicly accessed element
!-------------------------------------------------------------flip-
Drop the active_cache and active_nr parameters to write_cache
!-------------------------------------------------------------flip-
- Introduce set_cache_entry(ce, pos)
- Migrate update-cache.c, the only place that does a active_cache[pos] = ce to use it
- Migrate all the same style code in read-cache.c to use it also, except for
  read_cache itself which is setting up the initial active_cache entries
TODO: rewrite the code that deal with pointers into the active_cache array such as
read-tree.c's merging code.
!-------------------------------------------------------------flip-
Introduce get_cache_entry(int pos) and use it for all trivial calls like:
  ce = active_cache[pos]
TODO: rework the non-trivial active_cache manipulations
!-------------------------------------------------------------flip-
remove active_cache_changed from cache.h
!-------------------------------------------------------------flip-
Introduce get_num_cache_entries() and migrate all the trivial callers to it
!-------------------------------------------------------------flip-
Remove active_alloc from cache.h
!-------------------------------------------------------------flip-

Restructure the diff algorythm to use indexes rather than pointer math. The resulting code is probably a little less efficient but abstracts the data structure.

!-------------------------------------------------------------flip-

Restructure the write tree algorythm to use indexes rather than moving the base pointer and reducing the num entries and start using the cache abstraction apis.

!-------------------------------------------------------------flip-
Move from pointer math to indexes and use the abstractions
!-------------------------------------------------------------flip-
- convert the last caller from touching active_cache directly
- drop active_cache and active_nr from cache.h
!-------------------------------------------------------------flip-
Previous: Junio C HamanoNext: Daniel Barkalow
Message 11 of 12 in “Darcs-git: a few notes for Git hackers”
  1. Juliusz ChroboczekMay 9, 2005
  2. Petr BaudisMay 9, 2005
  3. Juliusz ChroboczekMay 9, 2005
  4. H. Peter AnvinMay 9, 2005
  5. Juliusz ChroboczekMay 9, 2005
  6. H. Peter AnvinMay 9, 2005
  7. Juliusz ChroboczekMay 9, 2005
  8. Brad RobertsMay 9, 2005
  9. Petr BaudisMay 9, 2005
  10. Junio C HamanoMay 9, 2005
  11. Brad RobertsMay 10, 2005
  12. Daniel BarkalowMay 10, 2005

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.