Git Product home page Git Product logo

Comments (9)

initialcommit-io avatar initialcommit-io commented on August 31, 2024 1

Ah yes, well the reason is that so far I have only implemented the bare bones $ git-sim stash command which only accepts filename arguments to add to the stash. Currently sub-sub commands like pop and apply are not implemented, but I'll work on it and update this ticket when deployed!

from git-sim.

paketb0te avatar paketb0te commented on August 31, 2024 1

@abhijitnathwani I am not sure if you saw it in the discussion of #43, HERE are the docs for nested subcommands in Typer :)

from git-sim.

abhijitnathwani avatar abhijitnathwani commented on August 31, 2024

Hi @initialcommit-io
I was working on this issue and made some progress. I was thinking to add support for push, pop, and apply subcommands for stash as others such as list, patch will be difficult to represent in the current schema of 3 columns. So git-sim stash and git-sim stash push will be effectively the same.
For pop and apply I was thinking to mark data from staging to working dir. However, to differentiate between pop (which does delete the stash entry after getting POPed) and apply (which does not delete the stash entry), could have strikethrough effect on the file name for pop which indicates those changes will no longer be available in the stash and for apply we could leave it as is.
Proposed apply subcommand sim:

git-sim-stash_02-05-23_21-24-10

Let me know your thoughts on it.

Also, do you know how to apply the strikethrough effect on Manim text objects? I believe we need to switch to MarkUpText but even then, I couldn't find how to apply the effect after populating the names dictionary that we have. I have 0 idea about Manim and any pointers here are appreciated!

from git-sim.

initialcommit-io avatar initialcommit-io commented on August 31, 2024

@abhijitnathwani Thanks a lot for this and great work on it so far. Good points about only using subcommands that make sense in a 3-column layout for now.

Also I like your idea for the strikethough for commands that delete the stashed entry. I just did some testing in Manim and was able to get the strikethrough to work like this:

m.MarkupText(
    "<span strikethrough='true' strikethrough_color='"
    + self.fontColor
    + "'>"
    + self.trim_path(f)
    + "</span>",
    font="Monospace",
    font_size=24,
    color=self.fontColor,
    )

The text objects are currently created in the setup_and_draw_zones() method in GitSimBaseCommand. I see 2 options for integrating this:

  1. Add a keyword argument like strikethrough=False to that method, where you can pass in one or more column indexes to strike through.

  2. Separate the text object creation starting on line 617 into a new method like "createZoneText()" that can be overridden in command subclasses like GitSimStash to implement the strikethrough there.

I'll leave that decision up to you, if you think one option works better than the other.

from git-sim.

initialcommit-io avatar initialcommit-io commented on August 31, 2024

@abhijitnathwani FYI I worked with @paketb0te to do some pretty significant refactoring to switch from argparse to Typer. Just wanted to give you a heads up since I know you already started on this.

from git-sim.

abhijitnathwani avatar abhijitnathwani commented on August 31, 2024

@initialcommit-io yeah, I saw the PR getting merged into the main branch. I was following the discussion on the Typer. I thought I'd finish this PR before that :D
Anyway, I'll go through the required changes for parsing the arguments using Typer and implement accordingly. Thanks for the heads up!

from git-sim.

initialcommit-io avatar initialcommit-io commented on August 31, 2024

@abhijitnathwani Thanks for this and for accommodating the big changes...

from git-sim.

abhijitnathwani avatar abhijitnathwani commented on August 31, 2024

Hi @initialcommit-io ,
Sorry for the delay in completing this. I am done with the feature development. I had one quick question for you. I am not sure how do we want to handle the files list in stash pop or stash apply ? Generally, files are not a part of the git stash subcommand as it accepts the stash entry to be applied. I was thinking to add a print if the user adds files as the argument to apply/pop and simulate it on all the changed files in the working directory.

Proposed approach:

PS D:\git-sim> git-sim stash pop git_sim/stash.py
Files are not required in apply/pop subcommand. Ignoring the file list.....
Simulating: git stash pop git_sim/stash.py
Output image location: D:\foss_contribution\git-sim\git-sim_media\images\git-sim-stash_02-15-23_21-42-48.jpg
PS D:\git-sim> git-sim stash pop
Simulating: git stash pop 
Output image location: D:\foss_contribution\git-sim\git-sim_media\images\git-sim-stash_02-15-23_21-43-01.jpg

from git-sim.

initialcommit-io avatar initialcommit-io commented on August 31, 2024

@abhijitnathwani Sure I think that sounds good. One thing to note, I added a --stdout option that writes the image data directly to standard output, so in the case that is set we need to suppress all printed output so it doesn't interfere with the raw image data.

Feel free to submit the PR when ready and I'll take a look.

from git-sim.

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.