![]() ![]() ![]() The code would previously call setup_collided_checkout_detection() and report_collided_checkout() even when o->dry_run. ![]() These two calls to git_attr_set_direction() cancel each other out and thus can be omitted when o->dry_run is true just as they already are when !o->update. When (o->dry_run & o->update), the original would have two calls to git_attr_set_direction() surrounding a bunch of skipped updates.Technically, commit 7847892716 ( unlink_entry(): introduce schedule_dir_for_removal(),, Git v1.6.3-rc0) should have made that call conditional, but it didn't matter in practice because remove_scheduled_dirs() becomes a no-op when all the calls to unlink_entry() are skipped. The original called remove_scheduled_dirs() unconditionally.It's possible this call belongs in another function, but it is certainly needed as tests will fail if it is removed. However, commit 33ecf7eb61 (Discard " deleted" cache entries after using them to update the working tree,, Git v1.5.5-rc0) put the discarding of unused cache entries in check_updates() so we still need to keep the call to remove_marked_cache_entries(). The fact that check_updates() does not actually turn into a no-op when updates are not wanted may be slightly surprising.There are a few things that make the conversion not quite obvious: Simplify the code by checking this condition at the beginning of the function, and when it is true, do the few things that are relevant and return early. In fact, this function almost turns into a no-op whenever the condition !o->update || o->dry_run (Note that o->dry_run is a near-synonym for !o->update, but not quite as per commit 2c9078d05bf2 (" unpack-trees: add the dry_run flag to unpack_trees_options",, Git v1.7.6-rc0).) (Merged by Junio C Hamano - gitster - in commit a3648c0, ) unpack-trees: exit check_updates() early if updates are not wantedĬheck_updates() has a lot of code that repeatedly checks whether o->update or o->dry_run are set. See commit 26f924d () by Elijah Newren ( newren). The git stash command is convenient, when it works, but when it gets you into corner cases, it can become extremely difficult to use.This should improve with Git 2.25.2 (March 2020), which adds code simplification. Stashes are commits, and this weirdness is one reason I actually recommend avoiding git stash if possible. This is because the set of commits that store a stash are. (Note: I am not an R or ipynb user, so I am not sure what this is all about here.)ġRemember, git stash pop just means git stash apply & git stash drop: do the apply first, and then if and only if the apply succeeds, drop the now-applied stash.ĢTechnically it runs git merge-recursive directly, rather than using git merge. These commands all assume a Unix-like shell, of course make any necessary alterations for whatever shell / CLI you use. This step merges into those three files, along with everything else that git stash pop does. ![]() This makes a place to save the three files, then uses git restore to undo your current changes, so that git merge can merge these three files. Git restore -s HEAD -SW h2oai_driver.py quantile_lift.R scratch.ipynb For instance: cd userĬp h2oai_driver.py quantile_lift.R scratch.ipynb /tmp/save If that is what you mean, then just do that. files and put back the ones I had just before I ran git stash pop. Perhaps, by this, you mean: After restoring the stashed changes, I'd like to discard the updated user/. 2 That merge operation is going to overwrite those three files.īut I don't need any changes in user/. The reason git stash pop is complaining here is that the application of a stash-the git stash apply step 1-involves running git merge. Stashing might let you pop the other stash, but then you have a new stash, and what will you do with that? □ So, let's look at another option. You could follow that advice, but it leads you down a rabbit hole, especially if you use git stash for this. (i have nothing to commit or stash so i can't follow the advice commit your changes or stash them before you merge) ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |