wfxr / forgit

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

Should `gcp` only show commits that are valid to pick? #264

Closed cjappl closed 1 year ago

cjappl commented 1 year ago

Currently, to populate the list in gcp, we run the following command

git cherry "$base" "$target" --abbrev -v 

This produces a list of commits where + commits have not been cherry picked yet, and minus commits HAVE been cherry picked.

Would it be more useful to just output commits that haven't been cherry picked over?

One solution to do that would be use:

git log --left-only --graph --cherry-pick --oneline $base...$target

This command only shows the commits that have not been picked over to $target, and omits the ones that have. Really reduces the visual noise!

Any thoughts? @wfxr @carlfriedrich @sandr01d ?

cjappl commented 1 year ago

Ok: Just hacked together a version of this before doing a very messy big cherry pick and it was a godsend. Very helpful

cjappl commented 1 year ago

Does anyone know if the following is possible:

Normally when you log commits using "git log --cherry-pick" or similar, it shows two categories: commits that have been cherry picked, and commits that have not.

However, sometimes during a commit, a manual merge is needed. After this commit is merged if you try to cherry pick again, the original commit will show up as "needs to be cherry picked". This is presumably due to the fact that the commit needed modification.

Is there any way to filter those commits from a list like this? I have already committed the change, so I want it out of my "todo" list.

I think in an ideal world gcp would show all commits that needed to be picked, and no more. That would be a pretty clean interface.

carlfriedrich commented 1 year ago

I don't use cherry picking that frequently, so I can't help with your question. But the proposal sounds totally reasonable for me.

cjappl commented 1 year ago

Consider yourself lucky!! :) I'll put together a review based on what I have now, seems like it could be a good step forward.