mirror of
https://github.com/initialcommit-com/git-sim.git
synced 2026-04-26 19:15:51 +03:00
[GH-ISSUE #1] Error when running git-sim stash push/pop #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/git-sim#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tanmaypandey7 on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/1
Originally assigned to: @abhijitnathwani on GitHub.
Hi, when trying to simulate the pop operation, i am getting the following error.
Although, not using the
pushcommand and giving the file name directly seems to workSame happens with pop command.
@initialcommit-io commented on GitHub (Jan 23, 2023):
Ah yes, well the reason is that so far I have only implemented the bare bones
$ git-sim stashcommand which only accepts filename arguments to add to the stash. Currently sub-sub commands likepopandapplyare not implemented, but I'll work on it and update this ticket when deployed!@abhijitnathwani commented on GitHub (Feb 5, 2023):
Hi @initialcommit-io
I was working on this issue and made some progress. I was thinking to add support for
push,pop, andapplysubcommands for stash as others such aslist,patchwill be difficult to represent in the current schema of 3 columns. Sogit-sim stashandgit-sim stash pushwill be effectively the same.For
popandapplyI was thinking to mark data fromstagingtoworkingdir. However, to differentiate betweenpop(which does delete the stash entry after getting POPed) andapply(which does not delete the stash entry), could havestrikethrougheffect on the file name forpopwhich indicates those changes will no longer be available in the stash and forapplywe could leave it as is.Proposed
applysubcommand sim:Let me know your thoughts on it.
Also, do you know how to apply the
strikethrougheffect on Manim text objects? I believe we need to switch toMarkUpTextbut 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!@initialcommit-io commented on GitHub (Feb 5, 2023):
@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:
The text objects are currently created in the
setup_and_draw_zones()method inGitSimBaseCommand. I see 2 options for integrating this:Add a keyword argument like
strikethrough=Falseto that method, where you can pass in one or more column indexes to strike through.Separate the text object creation starting on line 617 into a new method like "createZoneText()" that can be overridden in command subclasses like
GitSimStashto implement the strikethrough there.I'll leave that decision up to you, if you think one option works better than the other.
@initialcommit-io commented on GitHub (Feb 10, 2023):
@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.
@abhijitnathwani commented on GitHub (Feb 10, 2023):
@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!
@initialcommit-io commented on GitHub (Feb 11, 2023):
@abhijitnathwani Thanks for this and for accommodating the big changes...
@abhijitnathwani commented on GitHub (Feb 15, 2023):
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 poporstash 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:
@paketb0te commented on GitHub (Feb 15, 2023):
@abhijitnathwani I am not sure if you saw it in the discussion of #43, HERE are the docs for nested subcommands in Typer :)
@initialcommit-io commented on GitHub (Feb 15, 2023):
@abhijitnathwani Sure I think that sounds good. One thing to note, I added a
--stdoutoption 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.