Git Product home page Git Product logo

git-reviewers's Issues

make base branch configurable

Currently the base branch which changes are compared against is hardcoded to master:

def get_changed_files(self) -> List[str]:
""" Find the changed files between current status and master """
git_diff_files_command = ['git', 'diff', 'master', '--name-only']

This is an issue because in many scenarios, git reviewers can be run on a branch which would be based on another branch such as origin/master. If that diverges from master then the whole algorithm is not based on the right changes, and in the worst case it results in terrible performance as seen in #40.

So ideally this should be configurable via a CLI option, since the base branch will vary per repo. However a good first start would be to default to comparing against the branch configured as $mybranch's upstream branch by the branch.$mybranch.remote and branch.$mybranch.merge configuration options.

installation fails due to Counter missing from collections

$ pip3 install --user git+https://github.com/albertyw/git-reviewers.git                                                                                       
Collecting git+https://github.com/albertyw/git-reviewers.git                                                                                                     
  Cloning https://github.com/albertyw/git-reviewers.git to /tmp/pip-065tb0r7-build                                                                               
    Complete output from command python setup.py egg_info:                                                                                                       
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-065tb0r7-build/setup.py", line 8, in <module>
        from git_reviewers import reviewers
      File "/tmp/pip-065tb0r7-build/git_reviewers/reviewers.py", line 136, in <module>
        class FindHistoricalReviewers(FindFileLogReviewers):
      File "/tmp/pip-065tb0r7-build/git_reviewers/reviewers.py", line 137, in FindHistoricalReviewers
        def get_reviewers(self) -> typing.Counter[str]:
    AttributeError: module 'typing' has no attribute 'Counter'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-065tb0r7-build/ 

This happens with Python 3.5.3, but not 3.6.1.

performance issue

I did a fresh pip install and ran it, but strace showed it running git shortlog -sne in many files in the repo, and each one takes about 0.25s to complete, so on a large repo this seems to take forever. Since there was no visible feedback, I initially assumed it had hung.

Bad error message when arc whoami fails

$ git reviewers
 Exception
[cURL/7] (https://code.uberinternal.com/api/user.whoami) <CURLE_COULDNT_CONNECT> The cURL library raised an error while making a request. You may be able to find more information about this error (error code: 7) on the cURL site: http://curl.haxx.se/libcurl/c/libcurl-errors.html#CURLECOULDNTCONNECT
(Run with `--trace` for a full exception trace.)
Traceback (most recent call last):
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 315, in <module>
    main()
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 310, in main
    reviewers_list = get_reviewers(config)
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 205, in get_reviewers
    most_common = FindArcCommitReviewers(config) \
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 77, in filter_phabricator_activated
    usernames = [self.parse_phabricator(*x) for x in username_processes]
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 77, in <listcomp>
    usernames = [self.parse_phabricator(*x) for x in username_processes]
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 63, in parse_phabricator
    phab_output = json.loads(output_str)
  File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Make file-based diff work on committed code

Running git reviewers on code that has already been committed (onto a branch) does not get any results. git reviewers should do a diff between the current branch and the master.

reviewers.py: error: unrecognized arguments: --path=./

Right after installation, I get this error message:

$ git reviewers
usage: reviewers.py [-h] [-v] [-i IGNORE] [-c]
reviewers.py: error: unrecognized arguments: --path=./

Indeed, the --path argument is not listed in the --help output, neither can be found in the code. If I remove the --path=${GIT_PREFIX:-./}, it works just fine.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Update readme

List strategies for getting reviewers, remove path argument.

Error when running

When running git reviewers -c

Traceback (most recent call last):
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 192, in <module>
    main()
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 188, in main
    show_reviewers(reviewers_list, args.copy)
  File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 141, in show_reviewers
    p.communicate(input=reviewer_string)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 828, in communicate
    self._stdin_write(input)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 781, in _stdin_write
    self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.