2011/8/18 Junio C Hamano <gitster@xxxxxxxxx>: > Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes: > >> @@ -638,6 +640,9 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit) >> log.parent = NULL; >> opt->loginfo = &log; >> >> + if (!commit->parents && lookup_commit_graft(commit->object.sha1)) >> + add_name_decoration(DECORATION_GRAFTED, "grafted", >> + &commit->object); > > I am not very enthused about this change. > > We have already looked up the commit when we parsed it, and then we again > have to call lookup_commit_graft() which would yield false for most of the > commits? which is why there's "!commit->parents" check. I made this patch with shallow clone in mind. You probably have seen that if grafts are used to extend history instead of cutting it, it won't show. > Does this work with replacements and shallows, by the way? Shallows, yes (that was my aim). Replacements, no. A better way would be go over commit_graft[] and replace_object[] arrays, decorate all grafted/replaced commits, instead of checking in log_tree_commit(). -- Duy -- 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