The following example partially reimplements the git describe command
and some of its options.
These commands should work:
- Describe HEAD with default options (describe)
- Describe specified revision (describe master~2)
- Describe specified revisions (describe master~2 HEAD~3)
- Describe HEAD with dirty state suffix (describe --dirty=*)
- Describe consider all refs (describe --all master)
- Describe consider lightweight tags (describe --tags temp-tag)
- Describe show non-default abbreviated size (describe --abbrev=10)
- Describe always output the long format if matches a tag (describe --long v1.0)
- Describe consider only tags of specified pattern (describe --match v*-release)
- Describe show the fallback result (describe --always)
- Describe follow only the first parent commit (describe --first-parent)
The command line parsing logic is simplified and doesn't handle
all of the use cases.
The following example partially reimplements the git describe command and some of its options.
These commands should work:
- Describe HEAD with default options (describe) - Describe specified revision (describe master~2) - Describe specified revisions (describe master~2 HEAD~3) - Describe HEAD with dirty state suffix (describe --dirty=*) - Describe consider all refs (describe --all master) - Describe consider lightweight tags (describe --tags temp-tag) - Describe show non-default abbreviated size (describe --abbrev=10) - Describe always output the long format if matches a tag (describe --long v1.0) - Describe consider only tags of specified pattern (describe --match v*-release) - Describe show the fallback result (describe --always) - Describe follow only the first parent commit (describe --first-parent)
The command line parsing logic is simplified and doesn't handle all of the use cases.