RevSort.java

  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. package org.eclipse.jgit.revwalk;

  12. /**
  13.  * Sorting strategies supported by {@link org.eclipse.jgit.revwalk.RevWalk} and
  14.  * {@link org.eclipse.jgit.revwalk.ObjectWalk}.
  15.  */
  16. public enum RevSort {
  17.     /**
  18.      * No specific sorting is requested.
  19.      * <p>
  20.      * Applications should not rely upon the ordering produced by this strategy.
  21.      * Any ordering in the output is caused by low level implementation details
  22.      * and may change without notice.
  23.      */
  24.     NONE,

  25.     /**
  26.      * Sort by commit time, descending (newest first, oldest last).
  27.      * <p>
  28.      * This strategy can be combined with {@link #TOPO}.
  29.      */
  30.     COMMIT_TIME_DESC,

  31.     /**
  32.      * Topological sorting (all children before parents).
  33.      * <p>
  34.      * This strategy can be combined with {@link #COMMIT_TIME_DESC}.
  35.      */
  36.     TOPO,

  37.     /**
  38.      * Topological sorting (all children before parents) without intermixing
  39.      * lines of history.
  40.      * <p>
  41.      * This behavior more closely resembles C Git's git-log --topo-order than
  42.      * {@link #TOPO}. See C Git's topo-order <a href=
  43.      * "https://git-scm.com/docs/git-log#Documentation/git-log.txt---topo-order">description</a>.
  44.      *
  45.      * @since 5.8
  46.      */
  47.     TOPO_KEEP_BRANCH_TOGETHER,

  48.     /**
  49.      * Flip the output into the reverse ordering.
  50.      * <p>
  51.      * This strategy can be combined with the others described by this type as
  52.      * it is usually performed at the very end.
  53.      */
  54.     REVERSE,

  55.     /**
  56.      * Include {@link RevFlag#UNINTERESTING} boundary commits after all others.
  57.      * In {@link ObjectWalk}, objects associated with such commits (trees,
  58.      * blobs), and all other objects marked explicitly as UNINTERESTING are also
  59.      * included.
  60.      * <p>
  61.      * A boundary commit is a UNINTERESTING parent of an interesting commit that
  62.      * was previously output.
  63.      */
  64.     BOUNDARY;
  65. }