From e7da347520486ce33bb77d241b574787c0ec18e8 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 17 Apr 2006 10:27:59 +1000 Subject: [PATCH 1/3] gitk: Fix bug caused by missing commitlisted elements This bug was reported by Yann Dirson, and results in an 'Error: expected boolean value but got ""' dialog when scrolling to the bottom of the graph under some circumstances. The issue is that git-rev-list isn't outputting all the boundary commits when it is asked for commits affecting only certain files. We already cope with that by adding the missing boundary commits in addextraid, but there we weren't adding a 0 to the end of the commitlisted list when we added the extra id to the end of the displayorder list. This fixes it by appending 0 to commitlisted in addextraid, thus keeping commitlisted and displayorder in sync. Signed-off-by: Paul Mackerras --- gitk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gitk b/gitk index f88c06e565..87e71629af 100755 --- a/gitk +++ b/gitk @@ -1116,11 +1116,12 @@ proc layoutrows {row endrow last} { proc addextraid {id row} { global displayorder commitrow commitinfo - global commitidx + global commitidx commitlisted global parentlist childlist children incr commitidx lappend displayorder $id + lappend commitlisted 0 lappend parentlist {} set commitrow($id) $row readcommit $id @@ -1500,7 +1501,7 @@ proc drawcmittext {id row col rmx} { proc drawcmitrow {row} { global displayorder rowidlist global idrowranges idrangedrawn iddrawn - global commitinfo commitlisted parentlist numcommits + global commitinfo parentlist numcommits if {$row >= $numcommits} return foreach id [lindex $rowidlist $row] { From e6bfaf3e33beba9431490a4f5c7a9753986554c4 Mon Sep 17 00:00:00 2001 From: A Large Angry SCM Date: Sun, 16 Apr 2006 20:17:38 -0700 Subject: [PATCH 2/3] Makefile fixups. Signed-off-by: A Large Angry SCM Signed-off-by: Junio C Hamano --- Makefile | 2 +- t/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1130af4f38..8371f7f522 100644 --- a/Makefile +++ b/Makefile @@ -653,7 +653,7 @@ rpm: dist clean: rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ $(LIB_FILE) $(XDIFF_LIB) - rm -f $(ALL_PROGRAMS) git$X + rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags rm -rf $(GIT_TARNAME) rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz diff --git a/t/Makefile b/t/Makefile index fe65f53c5f..549598575b 100644 --- a/t/Makefile +++ b/t/Makefile @@ -25,5 +25,5 @@ clean: rm -fr trash .PHONY: $(T) clean -.NOPARALLEL: +.NOTPARALLEL: From 1b65a5aa449e2ea99a68f5d13c5521d0dc64dfd1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 16 Apr 2006 18:12:49 -0700 Subject: [PATCH 3/3] rev-list --boundary: show boundary commits even when limited otherwise. The boundary commits are shown for UI like gitk to draw them as soon as topo-order sorting allows, and should not be omitted by get_revision() filtering logic. As long as their immediate child commits are shown, we should not filter them out. Signed-off-by: Junio C Hamano --- http-push.c | 10 +++++----- rev-list.c | 4 ++-- revision.c | 29 +++++++++++++++++++++++++++-- revision.h | 3 ++- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/http-push.c b/http-push.c index 19a0f772e7..114d01bced 100644 --- a/http-push.c +++ b/http-push.c @@ -60,12 +60,12 @@ enum XML_Status { #define LOCK_TIME 600 #define LOCK_REFRESH 30 -/* bits #0-6 in revision.h */ +/* bits #0-15 in revision.h */ -#define LOCAL (1u << 7) -#define REMOTE (1u << 8) -#define FETCHING (1u << 9) -#define PUSHING (1u << 10) +#define LOCAL (1u<<16) +#define REMOTE (1u<<17) +#define FETCHING (1u<<18) +#define PUSHING (1u<<19) /* We allow "recursive" symbolic refs. Only within reason, though */ #define MAXDEPTH 5 diff --git a/rev-list.c b/rev-list.c index 963707a495..f5511e72db 100644 --- a/rev-list.c +++ b/rev-list.c @@ -8,9 +8,9 @@ #include "diff.h" #include "revision.h" -/* bits #0-6 in revision.h */ +/* bits #0-15 in revision.h */ -#define COUNTED (1u<<7) +#define COUNTED (1u<<16) static const char rev_list_usage[] = "git-rev-list [OPTION] ... [ -- paths... ]\n" diff --git a/revision.c b/revision.c index 0505f3f455..e1f9816bd7 100644 --- a/revision.c +++ b/revision.c @@ -750,6 +750,17 @@ static void rewrite_parents(struct rev_info *revs, struct commit *commit) } } +static void mark_boundary_to_show(struct commit *commit) +{ + struct commit_list *p = commit->parents; + while (p) { + commit = p->item; + p = p->next; + if (commit->object.flags & BOUNDARY) + commit->object.flags |= BOUNDARY_SHOW; + } +} + struct commit *get_revision(struct rev_info *revs) { struct commit_list *list = revs->commits; @@ -787,8 +798,20 @@ struct commit *get_revision(struct rev_info *revs) } if (commit->object.flags & SHOWN) continue; - if (!(commit->object.flags & BOUNDARY) && - (commit->object.flags & UNINTERESTING)) + + /* We want to show boundary commits only when their + * children are shown. When path-limiter is in effect, + * rewrite_parents() drops some commits from getting shown, + * and there is no point showing boundary parents that + * are not shown. After rewrite_parents() rewrites the + * parents of a commit that is shown, we mark the boundary + * parents with BOUNDARY_SHOW. + */ + if (commit->object.flags & BOUNDARY_SHOW) { + commit->object.flags |= SHOWN; + return commit; + } + if (commit->object.flags & UNINTERESTING) continue; if (revs->min_age != -1 && (commit->date > revs->min_age)) continue; @@ -801,6 +824,8 @@ struct commit *get_revision(struct rev_info *revs) if (revs->parents) rewrite_parents(revs, commit); } + if (revs->boundary) + mark_boundary_to_show(commit); commit->object.flags |= SHOWN; return commit; } while (revs->commits); diff --git a/revision.h b/revision.h index 8970b57e3c..4b27043510 100644 --- a/revision.h +++ b/revision.h @@ -7,7 +7,8 @@ #define SHOWN (1u<<3) #define TMP_MARK (1u<<4) /* for isolated cases; clean after use */ #define BOUNDARY (1u<<5) -#define ADDED (1u<<6) /* Parents already parsed and added? */ +#define BOUNDARY_SHOW (1u<<6) +#define ADDED (1u<<7) /* Parents already parsed and added? */ struct rev_info;