diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-10-30 07:43:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-30 07:43:39 +0100 |
commit | 77d503757d6328703f9571a4432dd83800bc26bb (patch) | |
tree | 55b106aab90b9b44a8d8e7cc38af63f2a3e743b9 /revision.h | |
parent | Sixth batch for 2.20 (diff) | |
parent | list-objects: support for skipping tree traversal (diff) | |
download | git-77d503757d6328703f9571a4432dd83800bc26bb.tar.xz git-77d503757d6328703f9571a4432dd83800bc26bb.zip |
Merge branch 'md/filter-trees'
The "rev-list --filter" feature learned to exclude all trees via
"tree:0" filter.
* md/filter-trees:
list-objects: support for skipping tree traversal
filter-trees: code clean-up of tests
list-objects-filter: implement filter tree:0
list-objects-filter-options: do not over-strbuf_init
list-objects-filter: use BUG rather than die
revision: mark non-user-given objects instead
rev-list: handle missing tree objects properly
list-objects: always parse trees gently
list-objects: refactor to process_tree_contents
list-objects: store common func args in struct
Diffstat (limited to 'revision.h')
-rw-r--r-- | revision.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/revision.h b/revision.h index bc30a3023e..1cd0c4b200 100644 --- a/revision.h +++ b/revision.h @@ -21,9 +21,16 @@ #define SYMMETRIC_LEFT (1u<<8) #define PATCHSAME (1u<<9) #define BOTTOM (1u<<10) -#define USER_GIVEN (1u<<25) /* given directly by the user */ +/* + * Indicates object was reached by traversal. i.e. not given by user on + * command-line or stdin. + * NEEDSWORK: NOT_USER_GIVEN doesn't apply to commits because we only support + * filtering trees and blobs, but it may be useful to support filtering commits + * in the future. + */ +#define NOT_USER_GIVEN (1u<<25) #define TRACK_LINEAR (1u<<26) -#define ALL_REV_FLAGS (((1u<<11)-1) | USER_GIVEN | TRACK_LINEAR) +#define ALL_REV_FLAGS (((1u<<11)-1) | NOT_USER_GIVEN | TRACK_LINEAR) #define DECORATE_SHORT_REFS 1 #define DECORATE_FULL_REFS 2 @@ -133,6 +140,21 @@ struct rev_info { line_level_traverse:1, tree_blobs_in_commit_order:1, + /* + * Blobs are shown without regard for their existence. + * But not so for trees: unless exclude_promisor_objects + * is set and the tree in question is a promisor object; + * OR ignore_missing_links is set, the revision walker + * dies with a "bad tree object HASH" message when + * encountering a missing tree. For callers that can + * handle missing trees and want them to be filterable + * and showable, set this to true. The revision walker + * will filter and show such a missing tree as usual, + * but will not attempt to recurse into this tree + * object. + */ + do_not_die_on_missing_tree:1, + /* for internal use only */ exclude_promisor_objects:1; |