You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommitGraphConstants.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2021, Tencent.
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.internal.storage.commitgraph;
  11. /**
  12. * Constants relating to commit-graph.
  13. */
  14. class CommitGraphConstants {
  15. static final int COMMIT_GRAPH_MAGIC = 0x43475048; /* "CGPH" */
  16. static final int CHUNK_ID_OID_FANOUT = 0x4f494446; /* "OIDF" */
  17. static final int CHUNK_ID_OID_LOOKUP = 0x4f49444c; /* "OIDL" */
  18. static final int CHUNK_ID_COMMIT_DATA = 0x43444154; /* "CDAT" */
  19. static final int CHUNK_ID_EXTRA_EDGE_LIST = 0x45444745; /* "EDGE" */
  20. static final int GRAPH_CHUNK_LOOKUP_WIDTH = 12;
  21. static final int COMMIT_DATA_EXTRA_LENGTH = 16;
  22. /** Mask to make the last edgeValue into position */
  23. static final int GRAPH_EDGE_LAST_MASK = 0x7fffffff;
  24. /** EdgeValue & GRAPH_LAST_EDGE != 0 means it is the last edgeValue */
  25. static final int GRAPH_LAST_EDGE = 0x80000000;
  26. /** EdgeValue == GRAPH_NO_PARENT means it has no parents */
  27. static final int GRAPH_NO_PARENT = 0x70000000;
  28. /**
  29. * EdgeValue & GRAPH_EXTRA_EDGES_NEEDED != 0 means it's other parents are in
  30. * Chunk Extra Edge List
  31. */
  32. static final int GRAPH_EXTRA_EDGES_NEEDED = 0x80000000;
  33. }