1 /*
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
3 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Distribution License v. 1.0 which is available at
7 * https://www.eclipse.org/org/documents/edl-v10.php.
8 *
9 * SPDX-License-Identifier: BSD-3-Clause
10 */
11
12 package org.eclipse.jgit.revwalk;
13
14 /**
15 * Sorting strategies supported by {@link org.eclipse.jgit.revwalk.RevWalk} and
16 * {@link org.eclipse.jgit.revwalk.ObjectWalk}.
17 */
18 public enum RevSort {
19 /**
20 * No specific sorting is requested.
21 * <p>
22 * Applications should not rely upon the ordering produced by this strategy.
23 * Any ordering in the output is caused by low level implementation details
24 * and may change without notice.
25 */
26 NONE,
27
28 /**
29 * Sort by commit time, descending (newest first, oldest last).
30 * <p>
31 * This strategy can be combined with {@link #TOPO}.
32 */
33 COMMIT_TIME_DESC,
34
35 /**
36 * Topological sorting (all children before parents).
37 * <p>
38 * This strategy can be combined with {@link #COMMIT_TIME_DESC}.
39 */
40 TOPO,
41
42 /**
43 * Topological sorting (all children before parents) without intermixing
44 * lines of history.
45 * <p>
46 * This behavior more closely resembles C Git's git-log --topo-order than
47 * {@link #TOPO}. See C Git's topo-order <a href=
48 * "https://git-scm.com/docs/git-log#Documentation/git-log.txt---topo-order">description</a>.
49 *
50 * @since 5.8
51 */
52 TOPO_KEEP_BRANCH_TOGETHER,
53
54 /**
55 * Flip the output into the reverse ordering.
56 * <p>
57 * This strategy can be combined with the others described by this type as
58 * it is usually performed at the very end.
59 */
60 REVERSE,
61
62 /**
63 * Include {@link RevFlag#UNINTERESTING} boundary commits after all others.
64 * In {@link ObjectWalk}, objects associated with such commits (trees,
65 * blobs), and all other objects marked explicitly as UNINTERESTING are also
66 * included.
67 * <p>
68 * A boundary commit is a UNINTERESTING parent of an interesting commit that
69 * was previously output.
70 */
71 BOUNDARY;
72 }