login
Header Space

 
 

Re: [PATCH] name-rev: Fix non-shortest description

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Uwe <ukleinek@...>, <git@...>, <gitster@...>
Date: Tuesday, August 28, 2007 - 6:26 am

On Tue, Aug 28, 2007 at 11:03:22AM +0100, Johannes Schindelin wrote:


Hrm. I was puzzled at first by what you meant, and then I thought about
some more, and came up with this. Which is perhaps what you intended all
along, or maybe not.

We are going to store the same prefixes over and over again. For
example, when storing v2.6.22-rc1~1038^2~20^2~5, we can consider the
sequence (1/1038, 2/20, 2/5). There are likely to be many nearby commits
sharing 1/1038, and a few sharing 2/20.

We can't make a linked list in the forward direction, since the '1/1038'
will go to many suffixes. But if we start our list backwards, like:

 2/5 -> 2/20 -> 1/1038 -> v2.6.22-rc1

then I think we can get away with just allocating the head of the list,
and pointing to the rest.

I'm not sure if this would be a net win, though. We incur one pointer
per merge traversal. And moreover, when we come up with a better name
for a rev, we can't just deallocate the old one since it might be in use
by other revs.

Unless, perhaps, rather than allocating list pointers, each commit just
got a name and a 'next commit'. So if I have decided that a commit's
best name is foo~20, and another commit points to it with information
'parent 2, generation 10', then I know that it's foo~20^2~10. And if
foo~20 gets a better name, we will automatically pick that up.

Hmm. I think we could reduce memory usage quite a bit. But now rev_names
would be much more expensive (since we would have to follow the list to
its beginning just to see how two names compare!).

So perhaps this isn't worth it at all, and just a simple dynamic array
is a better bet.

-Peff
-
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
name-rev does not show the shortest path, Uwe , (Thu Aug 23, 6:38 am)
[PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Mon Aug 27, 7:37 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 4:20 am)
Re: [PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Tue Aug 28, 5:15 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 5:25 am)
Re: [PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Tue Aug 28, 6:03 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 6:26 am)
Re: [PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Tue Aug 28, 7:02 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 7:11 am)
Re: [PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Tue Aug 28, 7:28 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 7:34 am)
Re: [PATCH] name-rev: Fix non-shortest description, Johannes Schindelin, (Tue Aug 28, 4:39 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 5:00 am)
Re: [PATCH] name-rev: Fix non-shortest description, Jeff King, (Tue Aug 28, 5:26 am)
Re: name-rev does not show the shortest path, Julian Phillips, (Fri Aug 24, 7:55 am)
Re: name-rev does not show the shortest path, Julian Phillips, (Fri Aug 24, 11:21 am)
Re: name-rev does not show the shortest path, Junio C Hamano, (Fri Aug 24, 2:33 pm)
Re: name-rev does not show the shortest path, Johannes Schindelin, (Sat Aug 25, 11:04 am)
Re: name-rev does not show the shortest path, Jeff King, (Sun Aug 26, 5:23 am)
Re: name-rev does not show the shortest path, Johannes Schindelin, (Sun Aug 26, 11:38 am)
Re: name-rev does not show the shortest path, Jeff King, (Mon Aug 27, 5:24 am)
Re: name-rev does not show the shortest path, Johannes Schindelin, (Mon Aug 27, 5:57 am)
Re: name-rev does not show the shortest path, Johannes Schindelin, (Mon Aug 27, 7:18 am)
speck-geostationary