MCPcopy Create free account
hub / github.com/libgit2/pygit2 / describe

Method describe

pygit2/repository.py:1109–1235  ·  view source on GitHub ↗

Describe a commit-ish or the current working tree. Returns: The description (str). Parameters: committish : `str`, :class:`~.Reference`, or :class:`~.Commit` Commit-ish object or object name to describe, or `None` to describe the current wo

(
        self,
        committish: str | Reference | Commit | None = None,
        max_candidates_tags: int | None = None,
        describe_strategy: DescribeStrategy = DescribeStrategy.DEFAULT,
        pattern: str | None = None,
        only_follow_first_parent: bool | None = None,
        show_commit_oid_as_fallback: bool | None = None,
        abbreviated_size: int | None = None,
        always_use_long_format: bool | None = None,
        dirty_suffix: str | None = None,
    )

Source from the content-addressed store, hash-verified

1107 # Describe
1108 #
1109 def describe(
1110 self,
1111 committish: str | Reference | Commit | None = None,
1112 max_candidates_tags: int | None = None,
1113 describe_strategy: DescribeStrategy = DescribeStrategy.DEFAULT,
1114 pattern: str | None = None,
1115 only_follow_first_parent: bool | None = None,
1116 show_commit_oid_as_fallback: bool | None = None,
1117 abbreviated_size: int | None = None,
1118 always_use_long_format: bool | None = None,
1119 dirty_suffix: str | None = None,
1120 ) -> str:
1121 """
1122 Describe a commit-ish or the current working tree.
1123
1124 Returns: The description (str).
1125
1126 Parameters:
1127
1128 committish : `str`, :class:`~.Reference`, or :class:`~.Commit`
1129 Commit-ish object or object name to describe, or `None` to describe
1130 the current working tree.
1131
1132 max_candidates_tags : int
1133 The number of candidate tags to consider. Increasing above 10 will
1134 take slightly longer but may produce a more accurate result. A
1135 value of 0 will cause only exact matches to be output.
1136
1137 describe_strategy : DescribeStrategy
1138 Can be one of:
1139
1140 * `DescribeStrategy.DEFAULT` - Only match annotated tags.
1141 * `DescribeStrategy.TAGS` - Match everything under refs/tags/
1142 (includes lightweight tags).
1143 * `DescribeStrategy.ALL` - Match everything under refs/ (includes
1144 branches).
1145
1146 pattern : str
1147 Only consider tags matching the given `glob(7)` pattern, excluding
1148 the "refs/tags/" prefix.
1149
1150 only_follow_first_parent : bool
1151 Follow only the first parent commit upon seeing a merge commit.
1152
1153 show_commit_oid_as_fallback : bool
1154 Show uniquely abbreviated commit object as fallback.
1155
1156 abbreviated_size : int
1157 The minimum number of hexadecimal digits to show for abbreviated
1158 object names. A value of 0 will suppress long format, only showing
1159 the closest tag.
1160
1161 always_use_long_format : bool
1162 Always output the long format (the nearest tag, the number of
1163 commits, and the abbreviated commit name) even when the committish
1164 matches a tag.
1165
1166 dirty_suffix : str

Callers 11

test_describeFunction · 0.80
test_describe_strategiesFunction · 0.80
test_describe_patternFunction · 0.80
test_describe_committishFunction · 0.80
test_describe_dirtyFunction · 0.80

Calls 3

to_bytesFunction · 0.85
check_errorFunction · 0.85
stringMethod · 0.80

Tested by 11

test_describeFunction · 0.64
test_describe_strategiesFunction · 0.64
test_describe_patternFunction · 0.64
test_describe_committishFunction · 0.64
test_describe_dirtyFunction · 0.64