Git Product home page Git Product logo

Comments (8)

LeandroVCastro avatar LeandroVCastro commented on June 5, 2024 2

same here

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

Thanks for reporting, I will check it out soon.

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

Could you please provide the .git/HEAD file? It seems that there is a corner case that GitHacker didn't handle correctly. @LeandroVCastro @JacobOzn

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

Currently, GitHacker parses the .git/HEAD file to get the current branch name using the RegExp (ref: refs/heads/([a-zA-Z\d_-]+)). GitHacker asserts that the number of current branch name equals 1 (see code).

The content of .git/HEAD file will be like the following block by default.

ref: refs/heads/master

But when the git repo checkouts to some commit (say c768909c5199e94b13d2bae023986a6817df840d), the content of .git/HEAD file will be like:

c768909c5199e94b13d2bae023986a6817df840d

Under that circumstance, the RegExp can not match any result, so the assertion will fail.

I will try to figure out how to fix this issue. Thanks a lot for reporting this bug.

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

I pushed a hotfix to remedy this bug.

Please check it out.

pip install -U git+https://github.com/WangYihang/GitHacker

from githacker.

goodmaney avatar goodmaney commented on June 5, 2024

I pushed a hotfix to remedy this bug.

Please check it out.

pip install -U git+https://github.com/WangYihang/GitHacker

not work too.
Traceback (most recent call last):
File "/home/xx/.local/bin/githacker", line 8, in
sys.exit(main())
File "/home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py", line 475, in main
result = GitHacker(
File "/home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py", line 77, in init
self.complete_basic_files_list()
File "/home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py", line 322, in complete_basic_files_list
branch_names += self.parse_current_branch_name()
File "/home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py", line 284, in parse_current_branch_name
assert len(branch_names) == 1
AssertionError

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

@yyg12345678910, thanks for reporting.

It sees that your /home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py file is not equivalent to the file https://github.com/WangYihang/GitHacker/blob/master/GitHacker/__init__.py in latest master branch.

File "/home/xx/.local/lib/python3.10/site-packages/GitHacker/init.py", line 284, in parse_current_branch_name
assert len(branch_names) == 1

See the latest code in line 284.

assert len(branch_names) <= 1

I will release the fixed version soon. Before that, please use the following command to reinstall GitHacker, sorry for the inconvenience.

pip uninstall GitHacker
git clone https://github.com/WangYihang/GitHacker
cd GitHacker/
pip install -r requirements.txt 
python setup.py install

from githacker.

Related Issues (20)

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.