Merge branch 'jc/boundary' into next
authorJunio C Hamano <junkio@cox.net>
Mon, 17 Apr 2006 05:07:28 +0000 (22:07 -0700)
committerJunio C Hamano <junkio@cox.net>
Mon, 17 Apr 2006 05:07:28 +0000 (22:07 -0700)
* jc/boundary:
rev-list --boundary: show boundary commits even when limited otherwise.
Makefile fixups.
gitk: Fix bug caused by missing commitlisted elements

Makefile
gitk
http-push.c
rev-list.c
revision.c
revision.h
t/Makefile
index 69ca05b2f96dac2ac72faf3a6ecf5328558f8156..84a4b84226cef5ac058760935a2770a3c164f436 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -656,7 +656,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 test-date$X test-delta$X test-gsimm$X
        rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
        rm -rf $(GIT_TARNAME)
diff --git a/gitk b/gitk
index f88c06e565ce34cd3985ea22d35e33735ed4f0fa..87e71629afd4b2eca8d1c768bea0a20815405b2b 100755 (executable)
--- 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] {
index 4a9dcf2bf64887735573d7c02b6b9f21ad4644f6..b4327d92438d9596b7286ead06152ad3156b6e2c 100644 (file)
@@ -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
index 33741ebbc4eec2ab7abdd9b5c045c7a6ec3cada6..b75da12408c58576264a72014c4791969c253308 100644 (file)
@@ -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] <commit-id>... [ -- paths... ]\n"
index f8fb02885589e3243b4b44692594861f98843d69..3cd6a2ed9f978776b2a021747f3f0995ebb70b28 100644 (file)
@@ -856,6 +856,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;
@@ -893,8 +904,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;
@@ -907,6 +930,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);
index 74dc5ef179e9778b874ceee7aefc6162892b116a..872bcd81725d08d20ece460a5898e0c9ea2ca3a1 100644 (file)
@@ -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;
 
index fe65f53c5fbcf07bb69214b0f0cff8aef551e906..549598575b9fdcefe857ddef1b6d980a9773b033 100644 (file)
@@ -25,5 +25,5 @@ clean:
        rm -fr trash
 
 .PHONY: $(T) clean
-.NOPARALLEL:
+.NOTPARALLEL: