Skip to content

Main content

Git Tree Mode Object Kind

Classify canonical Git tree entry mode strings into tree, blob, or submodule commit object kinds.

Loading tool…

Description

Map one recognized Git tree mode to its object kind.

Development metadata distinguishes source-map deltas, package-person formatting, executable shorthand and Git object modes. A string with package-like syntax need not satisfy the complete registry or package contract. Formatting a person, extracting a command name or mapping a mode does not inspect files or modify a repository.

Map one recognized Git tree mode to its object kind.

When to use this tool

Use Git Tree Mode Object Kind when you already have mode and need to map one recognized Git tree mode to its object kind.

How to use the tool and how it works

  1. Enter mode. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read objectKind. Use the output convention below.

Accept 040000, 100644, 100755, 120000 or 160000; map 040000 to tree, 160000 to commit and the three file/symlink modes to blob.1

Git distinguishes directory trees, file/symlink blobs and gitlinks to commits. The mode mapping records those kinds without inspecting an object or following a submodule or symbolic link.2

Input fieldMeaning and unitsAccepted input
modeExact listed six-digit Git mode spelling, not a numeric permissions value.Required. Text; one of "040000", "100644", "100755", "120000", "160000"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
objectKindObject KindRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "mode": "100755"
  },
  "output": {
    "objectKind": "blob"
  }
}

Limitations and assumptions

  • Input is the exact six-digit spelling. No repository, object, executable file, link target or submodule commit is inspected.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Validate the full source map, package metadata or Git object when conformance matters. Use the relevant complete format and actual file/object information; a local delta or grammar check does not establish a valid package, executable, source mapping or tree entry.

References

  1. Calculation and input contract: development/git-tree-mode-object-kind — tool.io

  2. Git fast-import: File modes — Git

Similar or alternative tools