View Javadoc
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  	 * Flip the output into the reverse ordering.
44  	 * <p>
45  	 * This strategy can be combined with the others described by this type as
46  	 * it is usually performed at the very end.
47  	 */
48  	REVERSE,
49  
50  	/**
51  	 * Include {@link RevFlag#UNINTERESTING} boundary commits after all others.
52  	 * In {@link ObjectWalk}, objects associated with such commits (trees,
53  	 * blobs), and all other objects marked explicitly as UNINTERESTING are also
54  	 * included.
55  	 * <p>
56  	 * A boundary commit is a UNINTERESTING parent of an interesting commit that
57  	 * was previously output.
58  	 */
59  	BOUNDARY;
60  }