Hi, On Thu, 7 Dec 2006, Andreas Ericsson wrote:Yes. The reset thingie is already in place: clear_commit_marks(). It would have to be enhanced a little, though: 1) the function rewrite_parents(), should add another flag, HALFORPHANED, and 2) clear_commit_marks() should unset the "parsed" flag of the commits for which HALFORPHANED is reset. -- snip -- diff --git a/commit.c b/commit.c index d5103cd..fd225c8 100644 --- a/commit.c +++ b/commit.c @@ -431,6 +431,10 @@ void clear_commit_marks(struct commit *commit, unsigned int mark) { struct commit_list *parents; + /* were parents rewritten? */ + if ((mark & commit->object.flags) & HALFORPHANED) + commit->object.parsed = 0; + commit->object.flags &= ~mark; parents = commit->parents; while (parents) { diff --git a/revision.c b/revision.c index 993bb66..461ee06 100644 --- a/revision.c +++ b/revision.c @@ -1097,6 +1097,7 @@ static void rewrite_parents(struct rev_info *revs, struct commit *commit) struct commit_list *parent = *pp; if (rewrite_one(revs, &parent->item) < 0) { *pp = parent->next; + commit->object.flags |= HALFORPHANED; continue; } pp = &parent->next; diff --git a/revision.h b/revision.h index 3adab95..544238c 100644 --- a/revision.h +++ b/revision.h @@ -9,6 +9,7 @@ #define BOUNDARY (1u<<5) #define BOUNDARY_SHOW (1u<<6) #define ADDED (1u<<7) /* Parents already parsed and added? */ +#define HALFORPHANED (1u<<8) /* parents were rewritten */ struct rev_info; struct log_info; -- snap -- Note that this is just the idea. This particular implementation opens a gaping memory leak, since the buffer of the commit is not free()d, and a reparse would probably not pick up on the fact that the parent commits are already in memory. 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
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| James Bottomley | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| Michal Piotrowski | Re: 2.6.21-rc5-mm4 |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Frans Pop | svc: failed to register lockdv1 RPC service (errno 97). |
| Lovich, Vitali | RE: [PATCH] Packet socket: mmapped IO: PACKET_TX_RING |
git: | |
