Due to taking time off this year, I'll end up in a low income tax bracket that puts me in the 0% long term capital gains tax bracket. I'd like to harvest some gains before the years end and take advantage of this, but I still like a lot of these stocks that have produced the gain and want to stay invested in them. My plan is as follows: before years end, harvest gains right up to the amount of the next highest long term capital gains bracket (15%), and then immediately repurchase the same stocks, leaving my portfolio the same but having taken substantial gains at the 0% rate.
Is this logic sound? Do I have to worry about running afoul of any stipulations that prevent this? I know there's a wash rule for losses, but AFAIK there's nothing that prevents me from doing this for gains.