Support older version of git
it4need opened this issue · 4 comments
I'm currently using Homesteads (v10.8
) default git installation (git version 2.17.1
) and everytime I execute phpunit
I'll get
Runtime: PHP 7.4.5
Configuration: /home/vagrant/code/phpunit.xml
error: unknown option `show-current'
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
or: git branch [<options>] [-r] (-d | -D) <branch-name>...
or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>
or: git branch [<options>] (-c | -C) [<old-branch>] <new-branch>
or: git branch [<options>] [-r | -a] [--points-at]
or: git branch [<options>] [-r | -a] [--format]
Generic options
-v, --verbose show hash and subject, give twice for upstream branch
-q, --quiet suppress informational messages
-t, --track set up tracking mode (see git-pull(1))
-u, --set-upstream-to <upstream>
change the upstream info
--unset-upstream Unset the upstream info
--color[=<when>] use colored output
-r, --remotes act on remote-tracking branches
--contains <commit> print only branches that contain the commit
--no-contains <commit>
print only branches that don't contain the commit
--abbrev[=<n>] use <n> digits to display SHA-1s
Specific git-branch actions:
-a, --all list both remote-tracking and local branches
-d, --delete delete fully merged branch
-D delete branch (even if not merged)
-m, --move move/rename a branch and its reflog
-M move/rename a branch, even if target exists
-c, --copy copy a branch and its reflog
-C copy a branch, even if target exists
--list list branch names
-l, --create-reflog create the branch's reflog
--edit-description edit the description for the branch
-f, --force force creation, move/rename, deletion
--merged <commit> print only branches that are merged
--no-merged <commit> print only branches that are not merged
--column[=<style>] list branches in columns
--sort <key> field name to sort on
--points-at <object> print only branches of the object
-i, --ignore-case sorting and filtering are case insensitive
--format <format> format to use for the output
I think it's because git version 2.17.1
, which is installed in
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
doesn't support -show-current
what you are using in src/Utils/GitInfo.php:9
.
Maybe you can implement such a workaround for it (maybe start over here: projectcontour/contour@9dced68 or https://www.techiedelight.com/determine-current-branch-name-git/)?
@it4need I'll have a look into that soon, in the meantime, check this out, you can implement your own way to get the info from the VCS: 87fb010#diff-e4546512b975d673aacb40028e0d4cee0f96fa30ebfeb2a8f85ce499179ec649R74
Thanks for reporting the issue!
I'll take this one @sileence
@it4need please have a look at @dimitriacosta PR #17 Does that solve the issue?