Coder Social home page Coder Social logo

Comments (7)

sevens avatar sevens commented on June 14, 2024 1

...
Edited note to self: the disgusting 30-minute solution is just to modify the offending logic to check for .gitignore , .gitkeep, and .gitattributes files, I guess. That will buy some time to work out a more proper solution.

FYI: might want to add .gitmodules as well ;) (from git submodules)

from cheat.

chrisallenlane avatar chrisallenlane commented on June 14, 2024

Ah, damn. I can confirm this behavior. As you've pointed out, this is surely due to some of the changes implemented on Friday.

Thanks for the very thorough bug report. I'll see if I can scrape together some time to fix this tomorrow.

from cheat.

chrisallenlane avatar chrisallenlane commented on June 14, 2024

Note to self: it's obvious now that attempting to base this logic off of string parsing is the path to ruin. I need to re-implement all of this using go-git.

Edited note to self: the disgusting 30-minute solution is just to modify the offending logic to check for .gitignore , .gitkeep, and .gitattributes files, I guess. That will buy some time to work out a more proper solution.

from cheat.

chrisallenlane avatar chrisallenlane commented on June 14, 2024

@sevens, please try the 4.3.3 release, which was published moments ago:
https://github.com/cheat/cheat/releases/tag/4.3.3

I believe this should solve the problem.

I'm going to optimistically close this ticket as resolved, but feel free to re-open if necessary.

Thanks!

from cheat.

sevens avatar sevens commented on June 14, 2024

Thanks for the quick fix! I've tested it on 2 machines and the fix works for me.

FWIW: I just realized that .git can also be a plain file in case of a worktree checkout, just to keep things simple I gues... I just did a quick test with this, using the community cheatsheets repository, and this doesn't give an error. However, .git (and .github/*) do appear in the cheat -l output, no idea if either of them did before 4.3.3. Output:

$ CHEAT_CONFIG_PATH=./conf.yml cheat -l | head -5
title:                    file:                                    tags:
.git                      cheatsheets-wt/.git                      test
.github/LICENSE.txt       cheatsheets-wt/.github/LICENSE.txt       test
.github/README.md         cheatsheets-wt/.github/README.md         test
7z                        cheatsheets-wt/7z                        compression,test

Edit: this isn't an actual problem for me as I'm not using it in this way (well, I am using a git worktree for cheatsheets but the .git file is outside of the cheatpath).

from cheat.

chrisallenlane avatar chrisallenlane commented on June 14, 2024

@sevens, thanks for following up.

Ah, geez. That's annoying. This has been shockingly hard to get right. There's a huge amount of nuance to all of this that I didn't anticipate.

At least we aren't crashing anymore, though.

With the last release, I made an invisible but important change: when the installer runs, git operations (the cloning) are now performed by go-git, rather than a shell call to git on the PATH.

Now that go-git is in the project, I can refactor all of this problematic code to determine where we are using git operations rather than string parsing, because the string parsing approach seems fraught with peril.

Time permitting, I'll take a crack at that next weekend. In the meantime, at least we aren't crashing.

Thanks for the help 🙂

from cheat.

sevens avatar sevens commented on June 14, 2024

Yeah, using a library is probably much safer (and future-proof, e.g. the whole worktree stuff is fairly new AFAIK, and still somewhat experimental). Good luck with refactoring.

You're welcome, and thanks for making cheat in the first place; I find it very useful and use it daily!

from cheat.

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.