Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support older version of git #16

Closed
it4need opened this issue Oct 17, 2020 · 4 comments
Closed

Support older version of git #16

it4need opened this issue Oct 17, 2020 · 4 comments

Comments

@it4need
Copy link

it4need commented Oct 17, 2020

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/)?

@sileence
Copy link
Member

@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!

@dimitriacosta
Copy link
Contributor

dimitriacosta commented Oct 17, 2020

I'll take this one @sileence

@sileence
Copy link
Member

sileence commented Oct 18, 2020

@it4need please have a look at @dimitriacosta PR #17 Does that solve the issue?

@jeffochoa
Copy link
Collaborator

This seems to be fixed now by #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants