Skip to content

Commit

Permalink
version: decouple --brief and --builtin
Browse files Browse the repository at this point in the history
"git cola version --builtin" previously implied "--brief".
Decouple these options so that "git cola version --builtin" changes just
the version part of the message.

"git cola --version --brief" can be used to get the original behavior.

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed May 5, 2024
1 parent 9b84f8a commit 973b54f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions cola/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,20 @@ def git_version(context):
return result


def cola_version():
def cola_version(builtin=False):
"""A version string for consumption by humans"""
suffix = version()
if builtin:
suffix = builtin_version()
else:
suffix = version()
return 'cola version %s' % suffix


def print_version(builtin=False, brief=False):
if builtin:
if builtin and brief:
msg = builtin_version()
elif brief:
msg = version()
else:
msg = cola_version()
msg = cola_version(builtin=builtin)
print(msg)
2 changes: 1 addition & 1 deletion garden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ variables:
mandir: ${prefix}/share/man/man1
cola_app: ${TREE_PATH}/git-cola.app
cola_app_resources: ${cola_app}/Contents/Resources
cola_full_version: $ ./bin/git-cola version --brief
cola_full_version: $ ./bin/git-cola version --brief --builtin
cola_version: $ sed -e "s/VERSION = '\(.*\)'/\1/" cola/_version.py
is_virtualenv: |
$ ${PYTHON} -c '
Expand Down

0 comments on commit 973b54f

Please sign in to comment.