wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

Provide an input branch with gcp again #252

Closed cjappl closed 1 year ago

cjappl commented 1 year ago

Noticed there was a change recently that broke the ability to pass in an input branch to gcp.

This change is the following:

PLEASE HELP ME REVIEW THIS, @carlfriedrich and @wfxr. I am such a bash syntax newbie, I don't know if I'm writing bad code 😄

Check list

Description

Type of change

Test environment

cjappl commented 1 year ago

also, if someone could pull this down and test it on their machine, that would also be great. Again, very new with bash syntax so I want to get used to it, but I'm nervous about mistakes :)

cjappl commented 1 year ago

Test cases:

In a repo with a main branch and a feature branch:

  1. Checkout feature
  2. gcp main - should result in a list of commits from main, you should be able to tab select the commits to cherry pick them
  3. gcp - should come up with a list of all the branches in the repo. selecting one of them will bring up a list of commits from that branch
  4. gcp someBranchThatDoesntExist should behave like 3, just ignore the bad input (should we error out here??)
carlfriedrich commented 1 year ago

@cjappl Thanks for your patch. I actually don't know why the heck I have added this git checkout line?! I will take a look into this in the next days. :-)

cjappl commented 1 year ago

Thanks!! Appreciate it :)

On Mon, Nov 28, 2022 at 1:24 AM, Tim @.***> wrote:

@.***(https://github.com/cjappl) Thanks for your patch. I actually don't know why the heck I have added this git checkout line?! I will take a look into this in the next days. :-)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

cjappl commented 1 year ago

Great suggestions @carlfriedrich ! Let me know if that fixes those up. I have tested and confirmed the functionality still works as intended. Now with less annoying "stuck in the loop" when you give an input branch. Definitely a good improvement.

cjappl commented 1 year ago

Sounds good @carlfriedrich ! Will "Squash and Merge" do what you're wanting? That's what I usually do anyway. when I submit.

Screen Shot 2022-12-06 at 7 33 53 PM
carlfriedrich commented 1 year ago

@cjappl Yep, that's fine! The new commit message for the squash commit will appear in the changelog then.