tig icon indicating copy to clipboard operation
tig copied to clipboard

Hope to support more parameter of git log

Open GrandZhuo opened this issue 4 years ago • 3 comments

Avid fan of tig!!!

I want to use tig to compare different branches. For example, tig master..dev tig master ^dev tig master...dev, they all work well.

But when I use some parameter of git log, it doesn't work as expected. For example, tig --left-right master...dev, the prefix is allways '>', which is not correct.

Also, I found that --cherry-markand--cherry-pickdo not work too. These parameters are very usefull when compare branches.

Would you consider supporting these parameters? Or is there any other solution to my problem?

git version 2.25.1 tig version 2.5.0 ncurses version 5.7.20081102 readline version 8.0

GrandZhuo avatar Mar 25 '20 16:03 GrandZhuo

I found that I can use git log --left-right --cherry-pick --pretty=raw master...dev | tig --pretty=raw to compare two branches, and the --cherry-pick parameter works well however --left-right still doesn't work.

GrandZhuo avatar Mar 30 '20 08:03 GrandZhuo

I've also run into this for -G and -S.

I wonder, why not just pass through all options to git log Or alternatively, have a command which does so? I thought that maybe tig log is exactly this, but e.g. tig log -S foo shows no output, while git log -S foo does, so that does not seem to be what git log is for.

matthijskooijman avatar Sep 29 '20 10:09 matthijskooijman

Wait, scratch my comment, that's a different problem. Seems I should specify -Sfoo rather than -S foo, since in the latter case, foo is interpreted as a revision rather than an option. I filed #1040 about improving this.

The options you name, --left-right and --cherry-mark do not really influence which commits git log returns, only how they are displayed. Normally, tig runs git log to decide which commits to show and once you "open" a commit to show details, it runs git show to show it.

It seems that tig is smart enough to also pass --left-right to git show in this case, but that doesn't help, since left/right has no real meaning for a single commit, only relative to other commits.

I would expect --cherry-pick to work, since it omits commits from the output, but I haven't got a good testsetup to test here.

matthijskooijman avatar Sep 29 '20 11:09 matthijskooijman