aboutsummaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-05 13:10:06 -0800
committerJunio C Hamano <junkio@cox.net>2007-03-06 01:08:34 -0800
commit86ab4906a7c86719cae33b28dac1a4157d665867 (patch)
tree0a72ef4ce20773bdd0e086f14f2a880c0d848067 /revision.h
parentba66c58637734a7a70196515a43328c2e92016c8 (diff)
downloadgit-86ab4906a7c86719cae33b28dac1a4157d665867.tar.gz
git-86ab4906a7c86719cae33b28dac1a4157d665867.tar.xz
revision walker: Fix --boundary when limited
This cleans up the boundary processing in the commit walker. It - rips out the boundary logic from the commit walker. Placing "negative" commits in the revs->commits list was Ok if all we cared about "boundary" was the UNINTERESTING limiting case, but conceptually it was wrong. - makes get_revision_1() function to walk the commits and return the results as if there is no funny postprocessing flags such as --reverse, --skip nor --max-count. - makes get_revision() function the postprocessing phase: If reverse is given, wait for get_revision_1() to give everything that it would normally give, and then reverse it before consuming. If skip is given, skip that many before going further. If max is given, stop when we gave out that many. Now that we are about to return one positive commit, mark the parents of that commit to be potential boundaries before returning, iff we are doing the boundary processing. Return the commit. - After get_revision() finishes giving out all the positive commits, if we are doing the boundary processing, we look at the parents that we marked as potential boundaries earlier, see if they are really boundaries, and give them out. It loses more code than it adds, even when the new gc_boundary() function, which is purely for early optimization, is counted. Note that this patch is purely for eyeballing and discussion only. It breaks git-bundle's verify logic because the logic does not use BOUNDARY_SHOW flag for its internal computation anymore. After we correct it not to attempt to affect the boundary processing by setting the BOUNDARY_SHOW flag, we can remove BOUNDARY_SHOW from revision.h and use that bit assignment for the new CHILD_SHOWN flag. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.h')
-rw-r--r--revision.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/revision.h b/revision.h
index 5fec1846f..6579a446e 100644
--- a/revision.h
+++ b/revision.h
@@ -10,6 +10,7 @@
#define BOUNDARY_SHOW (1u<<6)
#define ADDED (1u<<7) /* Parents already parsed and added? */
#define SYMMETRIC_LEFT (1u<<8)
+#define CHILD_SHOWN (1u<<9)
struct rev_info;
struct log_info;
@@ -21,6 +22,9 @@ struct rev_info {
struct commit_list *commits;
struct object_array pending;
+ /* Parents of shown commits */
+ struct object_array boundary_commits;
+
/* Basic information */
const char *prefix;
void *prune_data;
@@ -40,10 +44,10 @@ struct rev_info {
edge_hint:1,
limited:1,
unpacked:1, /* see also ignore_packed below */
- boundary:1,
+ boundary:2,
left_right:1,
parents:1,
- reverse:2;
+ reverse:1;
/* Diff flags */
unsigned int diff:1,