Hi, On Tue, 28 Aug 2007, Jeff King wrote:Okay, I could have been clearer: make rev_name a linked list, where only the first contains the actual root of the name (i.e. "v2.6.22-rc1"). This can be made const char *, so that it is not allocated. Then, like you described, you can have instances of rev_name, pointing to other instances of rev_name instead of a root. And to speed up comparison (and to know whether to point to a rev_name or a const char *) you can store the number of merge traversals: struct rev_name { union { /* root is used when traversals == 0, otherwise previous */ struct rev_name *previous; const char *root; } p; int generation; int traversals; } Then comparison would be something like int cmp_name(struct rev_name *n1, struct rev_name *n2) { int result = 0; if (n1->traversals != n2->traversals) return n1->traversals - n2->traversals; do { if (n1->generation != n2->generation) result = n1->generation - n2->generation; n1 = n1->p.previous; n2 = n2->p.previous; } while (n1->traversals); return result; } Name generation would be a bit more expensive, but then it is the operation which is called only rarely. Ciao, Dscho - 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
| Rafael J. Wysocki | 2.6.27-rc4-git1: Reported regressions from 2.6.26 |
| Tim Tassonis | reiser4 for 2.6.27-rc1 |
| Robin Lee Powell | NFS hang + umount -f: better behaviour requested. |
| Florian Schmidt | blacklist kernel boot option |
git: | |
| Robert Schiele | Re: Shell script cleanups/style changes? |
| Linus Torvalds | Re: git on MacOSX and files with decomposed utf-8 file names |
| Shawn O. Pearce | [PATCH] Correct dir.c to compile on Solaris 9 |
| Junio C Hamano | [RFD] On deprecating "git-foo" for builtins |
| Richard Stallman | Real men don't attack straw men |
| Juan Miscaro | When will OpenBSD support UTF8? |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Richard Daemon | Re: booting openbsd on eee without cd-rom |
| Mark Lord | Re: 2.6.25-rc8: FTP transfer errors |
| Jeff Kirsher | [BUG] NULL pointer dereference in skb_dequeue |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Bruno Randolf | [PATCH] add macro for printing mac addresses |
