Code Monkey home page Code Monkey logo

Comments (14)

kissgyorgy avatar kissgyorgy commented on April 28, 2024 4

but it's a start :)

No it's not. It's nowhere near the consistency and quality to the current version at all. There is no step from a modest solution like that to a pleasant UI like lazygit is currently.
Please don't poison a great project with a bad solution like that. Accept it that it takes time or rather don't do it please.

from lazygit.

fiendish avatar fiendish commented on April 28, 2024 2

@kissgyorgy hey, now. It's no worse than the current alternative, which is to switch to a different program for this functionality. This is just a shortcut for that. I'm sure that @jesseduffield also wants to find a way to integrate this into the UI, but I for one would rather not have nothing in the meantime.

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024 2

I've got a PR up for this feature now. Please feel free to test the PR, I'll be merging it soon :)

from lazygit.

from-nibly avatar from-nibly commented on April 28, 2024 1

+1 I think this would get me to switch from git kraken.

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024 1

Closing :)

I want to add more to this feature in the future, namely the ability to easily un-stage lines and even delete lines, but this specific issue is addressed

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024

Yeah that's something I very much want to add. I tried doing an interactive shell session with git add -p but couldn't quite get it working. It's definitely something I want in the app

from lazygit.

v3rm0n avatar v3rm0n commented on April 28, 2024

I would definitely try to switch from tig if I could stage lines, lazygit looks much nicer.

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024

@kissgyorgy @v3rm0n @from-nibly I've just pushed a commit to master which allows you to hit 't' and get redirected to a subprocess of git add --patch for the selected file. It's not as good as a UI in the app itself, but it's a start :)

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024

@kissgyorgy we differ in our ideologies here. As I originally made lazygit to help me with git, the mentality has always been to iteratively improve without breaking any existing features. Switching to the git add -p subprocess is not as good as having a subprocess communicated to via the UI, as I stated in my above comment, but I have already made use of it in my own use of the app, and the switching-to-subprocess pattern will be around for various other things like committing when a password is required, or switching to vi, for some time until we work out how to integrate properly with the subprocesses. Though I want lazygit to be a tool with a highly polished UI, it's still in early days (not v1.0.0 yet) and so tradeoffs like this will happen as we iron out the kinks.

Having said that, if you ever post a comment with a tone like that again (removed swear word notwithstanding) I'm blocking you from the repo. It's not a nice thing to wake up to.

from lazygit.

kissgyorgy avatar kissgyorgy commented on April 28, 2024

Yea, sorry about the tone, it was not very nice, and I removed it immediately when I realized.
But as I told earlier, I was searching for a long time for something like this and would be sad to see quality diminish after a great start.

I didn't looked into it before, but I see you are running git commands with os/exec, but wouldn't it be easier using a libgit2 wrapper? It's also more efficient for sure because you don't have the subprocess and text parsing overhead.

it's still in early days (not v1.0.0 yet)

Please don't make that an excuse. Why couldn't it be great from the start?

from lazygit.

kissgyorgy avatar kissgyorgy commented on April 28, 2024

but wouldn't it be easier using a libgit2 wrapper

Ok, I see that go-git is a pure-Go Git manipulator library, but I'm just curious then, why do you need os/exec calls? Are there missing commands from go-git?

from lazygit.

jesseduffield avatar jesseduffield commented on April 28, 2024

All good, and yeah I see your perspective as well. Regarding go-git, pretty much all the calls to git right now can be swapped out for go-git (I only became aware of that project recently). I've gotten started on that process, e.g. in this commit 4832d36
But some things will take a little more time because the code depends on the format of the output. Looking at the go-git examples, it seems like there's some good stuff for the async operations that we could use. Having said that, their support for git add is limited, so we'd need to come up with a solution that involves making a patch file based on user input and then applying that.

from lazygit.

kissgyorgy avatar kissgyorgy commented on April 28, 2024

process, e.g. in this commit 4832d36

Very nice!

from lazygit.

glvr182 avatar glvr182 commented on April 28, 2024

@jesseduffield I think the #338 concludes this issue.

from lazygit.

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.