On Wed, 9 Feb 2011, Junio C Hamano wrote: > Martin von Zweigbergk <martin.von.zweigbergk@xxxxxxxxx> writes: > > > +extern void *RERERE_UTIL_STAGED; > > This is for what kind? The contents on the filesystem is ready to go, > added to the index, but still in MERGE_RR (i.e. "git rerere" not run yet)? Correct. > Is the real problem that git-mergetool is not running rerere when it > should, I wonder... You mean that maybe it should call rerere for files that are added to the index? > > it = string_list_insert(conflict, (const char *)e->name); > > - it->util = NULL; > > + it->util = RERERE_UTIL_PUNTED; > > if (ce_stage(e) == 1) { > > + it->util = RERERE_UTIL_STAGED; > > Hmm, I thought that you were taling about paths that the user > hand-resolved and then ran "git add" on. Why is this marked "STAGED"? Very good question. It shouldn't. > Either your logic is wrong, or the name of the symbol is. The former. What I really wanted to check is if the file has been added to the index. I am currently struggling with how to do this correctly. My inexperience with the git internals makes it a very slow process with a lot of guesses and trial and error. > > - if (!conflict.items[i].util) > > - continue; /* punted */ > > + if (conflict.items[i].util == RERERE_UTIL_PUNTED || > > + conflict.items[i].util == RERERE_UTIL_STAGED) > > + continue; > > There are a few repetition of "if it is marked with PUNTED or STAGED"; can > you make it into a small helper function and give it a _meaningful_ name? > What does it mean for an entry to be marked with either of these marks? There is another big problem here. I had not realized that the util field would be freed later (being spoilt by GCing languages, I guess) and that will of course fail if it is one of the two constants I defined. I stupidly did not run the commands manually, but relied only on the test cases, so I didn't notice the segfault at the end. Somehow all the test cases still pass. I think this means that anyone intending to run rerere should not build pu at the moment, right? I'm really sorry about the inconvenience :-(. /Martin -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html